';
@@ -609,13 +624,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$sql = "SELECT t.rowid, t.fk_task, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm,";
$sql .= " pt.ref, pt.label,";
- $sql .= " u.lastname, u.firstname";
+ $sql .= " u.lastname, u.firstname, u.login, u.photo";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
if (empty($projectidforalltimes)) $sql .= " AND t.fk_task =".$object->id;
else $sql.= " AND pt.fk_projet IN (".$projectidforalltimes.")";
if ($search_ref) $sql .= natural_search('c.ref', $search_ref);
if ($search_note) $sql .= natural_search('t.note', $search_note);
+ if ($search_task_ref) $sql .= natural_search('pt.ref', $search_task_ref);
+ if ($search_task_label) $sql .= natural_search('pt.label', $search_task_label);
+ if ($search_user > 0) $sql .= natural_search('t.fk_user', $search_user);
$sql .= $db->order($sortfield, $sortorder);
$var=true;
@@ -711,50 +729,23 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '
';
print '
'."\n";
- print '
';
- if (! empty($arrayfields['t.task_date']['checked'])) print_liste_field_titre($arrayfields['t.task_date']['label'],$_SERVER['PHP_SELF'],'t.task_date,t.task_datehour,t.rowid','',$params,'',$sortfield,$sortorder);
- if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task
- {
- if (! empty($arrayfields['t.task_ref']['checked'])) print_liste_field_titre($arrayfields['t.task_ref']['label'],$_SERVER['PHP_SELF'],'pt.ref','',$params,'',$sortfield,$sortorder);
- if (! empty($arrayfields['t.task_label']['checked'])) print_liste_field_titre($arrayfields['t.task_label']['label'],$_SERVER['PHP_SELF'],'pt.label','',$params,'',$sortfield,$sortorder);
- }
- if (! empty($arrayfields['author']['checked'])) print_liste_field_titre($arrayfields['author']['label'],$_SERVER['PHP_SELF'],'','',$params,'',$sortfield,$sortorder);
- if (! empty($arrayfields['t.note']['checked'])) print_liste_field_titre($arrayfields['t.note']['label'],$_SERVER['PHP_SELF'],'t.note','',$params,'',$sortfield,$sortorder);
- if (! empty($arrayfields['t.task_duration']['checked'])) print_liste_field_titre($arrayfields['t.task_duration']['label'],$_SERVER['PHP_SELF'],'t.task_duration','',$params,'align="right"',$sortfield,$sortorder);
- if (! empty($arrayfields['value']['checked'])) print_liste_field_titre($arrayfields['value']['label'],$_SERVER['PHP_SELF'],'','',$params,'align="right"',$sortfield,$sortorder);
- // Extra fields
- /*
- if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
- {
- foreach($extrafields->attribute_label as $key => $val)
- {
- if (! empty($arrayfields["ef.".$key]['checked']))
- {
- $align=$extrafields->getAlignFlag($key);
- print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
- }
- }
- }*/
- // Hook fields
- $parameters=array('arrayfields'=>$arrayfields);
- $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
- print "
\n";
-
// Fields title search
- print '
';
- // LIST_OF_TD_TITLE_SEARCH
+ print '
';
+ // Date
if (! empty($arrayfields['t.task_date']['checked'])) print '
';
if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task
{
- if (! empty($arrayfields['t.task_ref']['checked'])) print '
';
- if (! empty($arrayfields['t.task_label']['checked'])) print '
';
+ if (! empty($arrayfields['t.task_ref']['checked'])) print '
';
+ if (! empty($arrayfields['t.task_label']['checked'])) print '
';
}
- if (! empty($arrayfields['author']['checked'])) print '
';
- if (! empty($arrayfields['t.note']['checked'])) print '
';
- if (! empty($arrayfields['t.task_duration']['checked'])) print '
';
- if (! empty($arrayfields['value']['checked'])) print '
';
+ // Author
+ if (! empty($arrayfields['author']['checked'])) print '
';
+ // Note
+ if (! empty($arrayfields['t.note']['checked'])) print '
';
+ // Duration
+ if (! empty($arrayfields['t.task_duration']['checked'])) print '
';
+ // Value in currency
+ if (! empty($arrayfields['value']['checked'])) print '
';
// Extra fields
/*
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
@@ -784,11 +775,42 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
- print '