NEW: actioncomm list: add description column (hidden by default)

This commit is contained in:
Marc de Lima Lucio 2019-01-09 11:54:03 +01:00
parent 6ca163c68b
commit de7dfd3423

View File

@ -58,6 +58,7 @@ else
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
$search_title=GETPOST('search_title','alpha');
$search_note=GETPOST('search_note','alpha');
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int'));
$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int'));
@ -123,6 +124,7 @@ $arrayfields=array(
'owner'=>array('label'=>"Owner", 'checked'=>1),
'c.libelle'=>array('label'=>"Type", 'checked'=>1),
'a.label'=>array('label'=>"Title", 'checked'=>1),
'a.note'=>array('label'=>'Description', 'checked'=>0),
'a.datep'=>array('label'=>"DateStart", 'checked'=>1),
'a.datep2'=>array('label'=>"DateEnd", 'checked'=>1),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
@ -171,6 +173,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
{
//$actioncode='';
$search_title='';
$search_note='';
$datestart='';
$dateend='';
$status='';
@ -217,6 +220,7 @@ if ($type) $param.="&type=".$type;
if ($usergroup) $param.="&usergroup=".$usergroup;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_title != '') $param.='&search_title='.$search_title;
if ($search_note != '') $param.='&search_note='.$search_note;
if (GETPOST('datestartday','int')) $param.='&datestartday='.GETPOST('datestartday','int');
if (GETPOST('datestartmonth','int')) $param.='&datestartmonth='.GETPOST('datestartmonth','int');
if (GETPOST('datestartyear','int')) $param.='&datestartyear='.GETPOST('datestartyear','int');
@ -229,7 +233,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$sql = "SELECT";
if ($usergroup > 0) $sql.=" DISTINCT";
$sql.= " s.nom as societe, s.rowid as socid, s.client,";
$sql.= " a.id, a.label, a.datep as dp, a.datep2 as dp2,";
$sql.= " a.id, a.label, a.note, a.datep as dp, a.datep2 as dp2,";
$sql.= ' a.fk_user_author,a.fk_user_action,';
$sql.= " a.fk_contact, a.note, a.percent as percent,";
$sql.= " a.fk_element, a.elementtype,";
@ -301,6 +305,7 @@ if ($status == '100') { $sql.= " AND a.percent = 100"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
if ($search_title) $sql.=natural_search("a.label", $search_title);
if ($search_note) $sql.=natural_search('a.note', $search_note);
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{
@ -442,6 +447,7 @@ if ($resql)
if (! empty($arrayfields['owner']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['c.libelle']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['a.label']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.'"></td>';
if (! empty($arrayfields['a.note']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.'"></td>';
if (! empty($arrayfields['a.datep']['checked'])) {
print '<td class="liste_titre nowraponall" align="center">';
print $form->select_date($datestart, 'datestart', 0, 0, 1, '', 1, 0, 1);
@ -483,6 +489,7 @@ if ($resql)
if (! empty($arrayfields['owner']['checked'])) print_liste_field_titre($arrayfields['owner']['label'], $_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
if (! empty($arrayfields['c.libelle']['checked'])) print_liste_field_titre($arrayfields['c.libelle']['label'], $_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
if (! empty($arrayfields['a.label']['checked'])) print_liste_field_titre($arrayfields['a.label']['label'], $_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
if (! empty($arrayfields['a.note']['checked'])) print_liste_field_titre($arrayfields['a.note']['label'], $_SERVER["PHP_SELF"],"a.note",$param,"","",$sortfield,$sortorder);
//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['a.datep2']['checked'])) print_liste_field_titre($arrayfields['a.datep2']['label'], $_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
@ -527,6 +534,7 @@ if ($resql)
$actionstatic->type_label=$obj->type_label;
$actionstatic->type_picto=$obj->type_picto;
$actionstatic->label=$obj->label;
$actionstatic->note=dol_htmlentitiesbr($obj->note);
print '<tr class="oddeven">';
@ -580,6 +588,14 @@ if ($resql)
print '</td>';
}
// Description
if (! empty($arrayfields['a.note']['checked'])) {
print '<td class="tdoverflowonsmartphone">';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note, 0));
print $form->textwithtooltip(dol_trunc($text,40), $actionstatic->note);
print '</td>';
}
// Start date
if (! empty($arrayfields['a.datep']['checked'])) {
print '<td align="center">';