'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '
';
print '';
@@ -985,7 +1104,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print '| '.$langs->trans("ProgressDeclared").' | ';
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
- print ' | ';
+ print ' | ';
}
print ' | ';
print "
\n";
@@ -1002,9 +1121,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
// Task
if (empty($id))
{
- print '';
- $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
- print ' | ';
+ print '';
+ $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
+ print ' | ';
}
// Contributor
@@ -1048,8 +1167,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
// Invoiced
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
- print '';
- print ' | ';
+ print '';
+ print ' | ';
}
print '';
@@ -1073,16 +1192,16 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
if (!empty($moreforfilter))
{
- print ' ';
- print $moreforfilter;
- print ' ';
+ print '';
+ print $moreforfilter;
+ print ' ';
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
- print '';
+ print ' ';
print ' '."\n";
// Fields title search
@@ -1096,23 +1215,23 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
$formother->select_year($search_year, 'search_year', 1, 20, 5);
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 ' | ';
- }
- // Author
- if (!empty($arrayfields['author']['checked'])) print ''.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200').' | ';
+ 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 ' | ';
+ }
+ // Author
+ if (!empty($arrayfields['author']['checked'])) print ''.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200').' | ';
// Note
- if (!empty($arrayfields['t.note']['checked'])) print ' | ';
+ if (!empty($arrayfields['t.note']['checked'])) print ' | ';
// Duration
- if (!empty($arrayfields['t.task_duration']['checked'])) print ' | ';
+ if (!empty($arrayfields['t.task_duration']['checked'])) print ' | ';
// Value in main currency
- if (!empty($arrayfields['value']['checked'])) print ' | ';
- // Value billed
- if (!empty($arrayfields['valuebilled']['checked'])) print ''.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).' | ';
+ if (!empty($arrayfields['value']['checked'])) print ' | ';
+ // Value billed
+ if (!empty($arrayfields['valuebilled']['checked'])) print ''.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).' | ';
- /*
+ /*
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
*/
@@ -1128,26 +1247,26 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
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', '', $param, '', $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', '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['t.task_label']['checked'])) print_liste_field_titre($arrayfields['t.task_label']['label'], $_SERVER['PHP_SELF'], 'pt.label', '', $param, '', $sortfield, $sortorder);
- }
- if (!empty($arrayfields['author']['checked'])) print_liste_field_titre($arrayfields['author']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
- if (!empty($arrayfields['t.note']['checked'])) print_liste_field_titre($arrayfields['t.note']['label'], $_SERVER['PHP_SELF'], 't.note', '', $param, '', $sortfield, $sortorder);
+ 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', '', $param, '', $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', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['t.task_label']['checked'])) print_liste_field_titre($arrayfields['t.task_label']['label'], $_SERVER['PHP_SELF'], 'pt.label', '', $param, '', $sortfield, $sortorder);
+ }
+ if (!empty($arrayfields['author']['checked'])) print_liste_field_titre($arrayfields['author']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields['t.note']['checked'])) print_liste_field_titre($arrayfields['t.note']['label'], $_SERVER['PHP_SELF'], 't.note', '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['t.task_duration']['checked'])) print_liste_field_titre($arrayfields['t.task_duration']['label'], $_SERVER['PHP_SELF'], 't.task_duration', '', $param, '', $sortfield, $sortorder, 'right ');
- if (!empty($arrayfields['value']['checked'])) print_liste_field_titre($arrayfields['value']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right ');
- if (!empty($arrayfields['valuebilled']['checked'])) print_liste_field_titre($arrayfields['valuebilled']['label'], $_SERVER['PHP_SELF'], 'il.total_ht', '', $param, '', $sortfield, $sortorder, 'center ');
+ if (!empty($arrayfields['value']['checked'])) print_liste_field_titre($arrayfields['value']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right ');
+ if (!empty($arrayfields['valuebilled']['checked'])) print_liste_field_titre($arrayfields['valuebilled']['label'], $_SERVER['PHP_SELF'], 'il.total_ht', '', $param, '', $sortfield, $sortorder, 'center ');
/*
- // Extra fields
+ // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
*/
- // Hook fields
+ // Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
- $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"], "", '', '', 'width="80"', $sortfield, $sortorder, 'center maxwidthsearch ');
+ $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"], "", '', '', 'width="80"', $sortfield, $sortorder, 'center maxwidthsearch ');
print " \n";
$tasktmp = new Task($db);
@@ -1162,7 +1281,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
$totalarray = array();
foreach ($tasks as $task_time)
{
- if ($i >= $limit) break;
+ if ($i >= $limit) break;
print '';
@@ -1172,125 +1291,125 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
// Date
if (!empty($arrayfields['t.task_date']['checked']))
{
- print '| ';
- if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
- {
- if (empty($task_time->task_date_withhour))
- {
- print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 3, 3, 2, "timespent_date", 1, 0);
- }
- else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0);
- }
- else
- {
- print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
- }
- print ' | ';
- if (!$i) $totalarray['nbfield']++;
+ print '';
+ if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ if (empty($task_time->task_date_withhour))
+ {
+ print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 3, 3, 2, "timespent_date", 1, 0);
+ }
+ else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0);
+ }
+ else
+ {
+ print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
+ }
+ print ' | ';
+ if (!$i) $totalarray['nbfield']++;
}
// Task ref
- if (!empty($arrayfields['t.task_ref']['checked']))
- {
- if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
- {
- print '';
- $tasktmp->id = $task_time->fk_task;
- $tasktmp->ref = $task_time->ref;
- $tasktmp->label = $task_time->label;
- print $tasktmp->getNomUrl(1, 'withproject', 'time');
- print ' | ';
- if (!$i) $totalarray['nbfield']++;
- }
- }
+ if (!empty($arrayfields['t.task_ref']['checked']))
+ {
+ if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
+ {
+ print '';
+ $tasktmp->id = $task_time->fk_task;
+ $tasktmp->ref = $task_time->ref;
+ $tasktmp->label = $task_time->label;
+ print $tasktmp->getNomUrl(1, 'withproject', 'time');
+ print ' | ';
+ if (!$i) $totalarray['nbfield']++;
+ }
+ }
// Task label
- if (!empty($arrayfields['t.task_label']['checked']))
- {
- if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
- {
- print '';
- print $task_time->label;
- print ' | ';
- if (!$i) $totalarray['nbfield']++;
- }
- }
+ if (!empty($arrayfields['t.task_label']['checked']))
+ {
+ if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
+ {
+ print '';
+ print $task_time->label;
+ print ' | ';
+ if (!$i) $totalarray['nbfield']++;
+ }
+ }
- // User
- if (!empty($arrayfields['author']['checked']))
- {
- print '';
- if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
- {
- if (empty($object->id)) $object->fetch($id);
- $contactsoftask = $object->getListContactId('internal');
- if (!in_array($task_time->fk_user, $contactsoftask)) {
- $contactsoftask[] = $task_time->fk_user;
- }
- if (count($contactsoftask) > 0) {
- print img_object('', 'user', 'class="hideonsmartphone"');
- print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
- } else {
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
- }
- }
- else
- {
- $userstatic->id = $task_time->fk_user;
- $userstatic->lastname = $task_time->lastname;
- $userstatic->firstname = $task_time->firstname;
- $userstatic->photo = $task_time->photo;
- $userstatic->statut = $task_time->user_status;
- print $userstatic->getNomUrl(-1);
- }
- print ' | ';
- if (!$i) $totalarray['nbfield']++;
- }
+ // User
+ if (!empty($arrayfields['author']['checked']))
+ {
+ print '';
+ if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ if (empty($object->id)) $object->fetch($id);
+ $contactsoftask = $object->getListContactId('internal');
+ if (!in_array($task_time->fk_user, $contactsoftask)) {
+ $contactsoftask[] = $task_time->fk_user;
+ }
+ if (count($contactsoftask) > 0) {
+ print img_object('', 'user', 'class="hideonsmartphone"');
+ print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
+ } else {
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
+ }
+ }
+ else
+ {
+ $userstatic->id = $task_time->fk_user;
+ $userstatic->lastname = $task_time->lastname;
+ $userstatic->firstname = $task_time->firstname;
+ $userstatic->photo = $task_time->photo;
+ $userstatic->statut = $task_time->user_status;
+ print $userstatic->getNomUrl(-1);
+ }
+ print ' | ';
+ if (!$i) $totalarray['nbfield']++;
+ }
// Note
- if (!empty($arrayfields['t.note']['checked']))
- {
- print '';
- if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
- {
- print '';
- }
- else
- {
- print dol_nl2br($task_time->note);
- }
- print ' | ';
- if (!$i) $totalarray['nbfield']++;
- }
- elseif ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
- {
- print '';
- }
+ if (!empty($arrayfields['t.note']['checked']))
+ {
+ print '';
+ if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ print '';
+ }
+ else
+ {
+ print dol_nl2br($task_time->note);
+ }
+ print ' | ';
+ if (!$i) $totalarray['nbfield']++;
+ }
+ elseif ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ print '';
+ }
// Time spent
- if (!empty($arrayfields['t.task_duration']['checked']))
- {
- print '';
- if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
- {
- print '';
- print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
- }
- else
- {
- print convertSecondToTime($task_time->task_duration, 'allhourmin');
- }
- print ' | ';
- if (!$i) $totalarray['nbfield']++;
- if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 't.task_duration';
- $totalarray['val']['t.task_duration'] += $task_time->task_duration;
- if (!$i) $totalarray['totaldurationfield'] = $totalarray['nbfield'];
- $totalarray['totalduration'] += $task_time->task_duration;
- }
+ if (!empty($arrayfields['t.task_duration']['checked']))
+ {
+ print '';
+ if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ print '';
+ print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
+ }
+ else
+ {
+ print convertSecondToTime($task_time->task_duration, 'allhourmin');
+ }
+ print ' | ';
+ if (!$i) $totalarray['nbfield']++;
+ if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 't.task_duration';
+ $totalarray['val']['t.task_duration'] += $task_time->task_duration;
+ if (!$i) $totalarray['totaldurationfield'] = $totalarray['nbfield'];
+ $totalarray['totalduration'] += $task_time->task_duration;
+ }
// Value spent
- if (!empty($arrayfields['value']['checked']))
- {
+ if (!empty($arrayfields['value']['checked']))
+ {
print '';
$value = price2num($task_time->thm * $task_time->task_duration / 3600);
print price($value, 1, $langs, 1, -1, -1, $conf->currency);
@@ -1300,51 +1419,51 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
$totalarray['val']['value'] += $value;
if (!$i) $totalarray['totalvaluefield'] = $totalarray['nbfield'];
$totalarray['totalvalue'] += $value;
- }
+ }
- // Invoiced
- if (!empty($arrayfields['valuebilled']['checked']))
- {
- print ' | '; // invoice_id and invoice_line_id
- if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT))
- {
- if ($projectstatic->usage_bill_time)
- {
- if ($task_time->invoice_id)
- {
- $result = $tmpinvoice->fetch($task_time->invoice_id);
- if ($result > 0)
- {
- print $tmpinvoice->getNomUrl(1);
- }
- }
- else
- {
- print $langs->trans("No");
- }
- }
- else
- {
- print ''.$langs->trans("NA").'';
- }
- }
- print ' | ';
- if (!$i) $totalarray['nbfield']++;
- if (!$i) $totalarray['totalvaluebilledfield'] = $totalarray['nbfield'];
- $totalarray['totalvaluebilled'] += $valuebilled;
- }
+ // Invoiced
+ if (!empty($arrayfields['valuebilled']['checked']))
+ {
+ print ''; // invoice_id and invoice_line_id
+ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT))
+ {
+ if ($projectstatic->usage_bill_time)
+ {
+ if ($task_time->invoice_id)
+ {
+ $result = $tmpinvoice->fetch($task_time->invoice_id);
+ if ($result > 0)
+ {
+ print $tmpinvoice->getNomUrl(1);
+ }
+ }
+ else
+ {
+ print $langs->trans("No");
+ }
+ }
+ else
+ {
+ print ''.$langs->trans("NA").'';
+ }
+ }
+ print ' | ';
+ if (!$i) $totalarray['nbfield']++;
+ if (!$i) $totalarray['totalvaluebilledfield'] = $totalarray['nbfield'];
+ $totalarray['totalvaluebilled'] += $valuebilled;
+ }
- /*
- // Extra fields
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
- */
+ /*
+ // Extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
+ */
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$task_time);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- // Action column
+ // Action column
print '';
if (($action == 'editline' || $action == 'splitline') && $_GET['lineid'] == $task_time->rowid)
{
@@ -1353,19 +1472,19 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print ' ';
print '';
}
- elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks
+ elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks
{
if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer)
{
- if ($conf->MAIN_FEATURES_LEVEL >= 2)
- {
- print ' ';
- print 'fk_task.'&action=splitline&lineid='.$task_time->rowid.$param.'">';
- print img_split();
- print '';
- }
+ if ($conf->MAIN_FEATURES_LEVEL >= 2)
+ {
+ print ' ';
+ print 'fk_task.'&action=splitline&lineid='.$task_time->rowid.$param.'">';
+ print img_split();
+ print '';
+ }
- print ' ';
+ print ' ';
print 'fk_task.'&action=editline&lineid='.$task_time->rowid.$param.'">';
print img_edit();
print '';
@@ -1375,17 +1494,17 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print img_delete();
print '';
- if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
- $selected = 0;
- if (in_array($task_time->rowid, $arrayofselected)) $selected = 1;
- print ' ';
- print '';
+ $selected = 0;
+ if (in_array($task_time->rowid, $arrayofselected)) $selected = 1;
+ print ' ';
+ print '';
}
- }
+ }
}
- print ' | ';
- if (!$i) $totalarray['nbfield']++;
+ print '';
+ if (!$i) $totalarray['nbfield']++;
print " \n";
@@ -1393,298 +1512,298 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
{
- print '';
+ print ' ';
- // Date
- if (!empty($arrayfields['t.task_date']['checked']))
- {
- print '| ';
- if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- if (empty($task_time->task_date_withhour))
- {
- print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 3, 3, 2, "timespent_date", 1, 0);
- }
- else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0);
- }
- else
- {
- print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
- }
- print ' | ';
- }
+ // Date
+ if (!empty($arrayfields['t.task_date']['checked']))
+ {
+ print '';
+ if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ if (empty($task_time->task_date_withhour))
+ {
+ print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 3, 3, 2, "timespent_date", 1, 0);
+ }
+ else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline', 1, 1, 2, "timespent_date", 1, 0);
+ }
+ else
+ {
+ print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
+ }
+ print ' | ';
+ }
- // Task ref
- if (!empty($arrayfields['t.task_ref']['checked']))
- {
- if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
- {
- print '';
- $tasktmp->id = $task_time->fk_task;
- $tasktmp->ref = $task_time->ref;
- $tasktmp->label = $task_time->label;
- print $tasktmp->getNomUrl(1, 'withproject', 'time');
- print ' | ';
- }
- }
+ // Task ref
+ if (!empty($arrayfields['t.task_ref']['checked']))
+ {
+ if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
+ {
+ print '';
+ $tasktmp->id = $task_time->fk_task;
+ $tasktmp->ref = $task_time->ref;
+ $tasktmp->label = $task_time->label;
+ print $tasktmp->getNomUrl(1, 'withproject', 'time');
+ print ' | ';
+ }
+ }
- // Task label
- if (!empty($arrayfields['t.task_label']['checked']))
- {
- if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
- {
- print '';
- print $task_time->label;
- print ' | ';
- }
- }
+ // Task label
+ if (!empty($arrayfields['t.task_label']['checked']))
+ {
+ if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
+ {
+ print '';
+ print $task_time->label;
+ print ' | ';
+ }
+ }
- // User
- if (!empty($arrayfields['author']['checked']))
- {
- print '';
- if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- if (empty($object->id)) $object->fetch($id);
- $contactsoftask = $object->getListContactId('internal');
- if (!in_array($task_time->fk_user, $contactsoftask)) {
- $contactsoftask[] = $task_time->fk_user;
- }
- if (count($contactsoftask) > 0) {
- print img_object('', 'user', 'class="hideonsmartphone"');
- print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
- } else {
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
- }
- }
- else
- {
- $userstatic->id = $task_time->fk_user;
- $userstatic->lastname = $task_time->lastname;
- $userstatic->firstname = $task_time->firstname;
- $userstatic->photo = $task_time->photo;
- $userstatic->statut = $task_time->user_status;
- print $userstatic->getNomUrl(-1);
- }
- print ' | ';
- }
+ // User
+ if (!empty($arrayfields['author']['checked']))
+ {
+ print '';
+ if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ if (empty($object->id)) $object->fetch($id);
+ $contactsoftask = $object->getListContactId('internal');
+ if (!in_array($task_time->fk_user, $contactsoftask)) {
+ $contactsoftask[] = $task_time->fk_user;
+ }
+ if (count($contactsoftask) > 0) {
+ print img_object('', 'user', 'class="hideonsmartphone"');
+ print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
+ } else {
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
+ }
+ }
+ else
+ {
+ $userstatic->id = $task_time->fk_user;
+ $userstatic->lastname = $task_time->lastname;
+ $userstatic->firstname = $task_time->firstname;
+ $userstatic->photo = $task_time->photo;
+ $userstatic->statut = $task_time->user_status;
+ print $userstatic->getNomUrl(-1);
+ }
+ print ' | ';
+ }
- // Note
- if (!empty($arrayfields['t.note']['checked']))
- {
- print '';
- if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- print '';
- }
- else
- {
- print dol_nl2br($task_time->note);
- }
- print ' | ';
- }
- elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- print '';
- }
+ // Note
+ if (!empty($arrayfields['t.note']['checked']))
+ {
+ print '';
+ if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ print '';
+ }
+ else
+ {
+ print dol_nl2br($task_time->note);
+ }
+ print ' | ';
+ }
+ elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ print '';
+ }
- // Time spent
- if (!empty($arrayfields['t.task_duration']['checked']))
- {
- print '';
- if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- print '';
- print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
- }
- else
- {
- print convertSecondToTime($task_time->task_duration, 'allhourmin');
- }
- print ' | ';
- }
+ // Time spent
+ if (!empty($arrayfields['t.task_duration']['checked']))
+ {
+ print '';
+ if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ print '';
+ print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');
+ }
+ else
+ {
+ print convertSecondToTime($task_time->task_duration, 'allhourmin');
+ }
+ print ' | ';
+ }
- // Value spent
- if (!empty($arrayfields['value']['checked']))
- {
- print '';
- $value = price2num($task_time->thm * $task_time->task_duration / 3600);
- print price($value, 1, $langs, 1, -1, -1, $conf->currency);
- print ' | ';
- }
+ // Value spent
+ if (!empty($arrayfields['value']['checked']))
+ {
+ print '';
+ $value = price2num($task_time->thm * $task_time->task_duration / 3600);
+ print price($value, 1, $langs, 1, -1, -1, $conf->currency);
+ print ' | ';
+ }
- // Value billed
- if (!empty($arrayfields['valuebilled']['checked']))
- {
- print '';
- $valuebilled = price2num($task_time->total_ht);
- if (isset($task_time->total_ht)) print price($valuebilled, 1, $langs, 1, -1, -1, $conf->currency);
- print ' | ';
- }
+ // Value billed
+ if (!empty($arrayfields['valuebilled']['checked']))
+ {
+ print '';
+ $valuebilled = price2num($task_time->total_ht);
+ if (isset($task_time->total_ht)) print price($valuebilled, 1, $langs, 1, -1, -1, $conf->currency);
+ print ' | ';
+ }
- /*
- // Extra fields
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
- */
+ /*
+ // Extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
+ */
- // Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$task_time);
- $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
+ // Fields from hook
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$task_time);
+ $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
- // Action column
- print '';
- print ' | ';
+ // Action column
+ print '';
+ print ' | ';
- print " \n";
+ print "\n";
- // Line for second dispatching
+ // Line for second dispatching
- print '';
+ print ' ';
- // Date
- if (!empty($arrayfields['t.task_date']['checked']))
- {
- print '| ';
- if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- if (empty($task_time->task_date_withhour))
- {
- print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 3, 3, 2, "timespent_date", 1, 0);
- }
- else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 1, 1, 2, "timespent_date", 1, 0);
- }
- else
- {
- print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
- }
- print ' | ';
- }
+ // Date
+ if (!empty($arrayfields['t.task_date']['checked']))
+ {
+ print '';
+ if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ if (empty($task_time->task_date_withhour))
+ {
+ print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 3, 3, 2, "timespent_date", 1, 0);
+ }
+ else print $form->selectDate(($date2 ? $date2 : $date1), 'timeline_2', 1, 1, 2, "timespent_date", 1, 0);
+ }
+ else
+ {
+ print dol_print_date(($date2 ? $date2 : $date1), ($task_time->task_date_withhour ? 'dayhour' : 'day'));
+ }
+ print ' | ';
+ }
- // Task ref
- if (!empty($arrayfields['t.task_ref']['checked']))
- {
- if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
- {
- print '';
- $tasktmp->id = $task_time->fk_task;
- $tasktmp->ref = $task_time->ref;
- $tasktmp->label = $task_time->label;
- print $tasktmp->getNomUrl(1, 'withproject', 'time');
- print ' | ';
- }
- }
+ // Task ref
+ if (!empty($arrayfields['t.task_ref']['checked']))
+ {
+ if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
+ {
+ print '';
+ $tasktmp->id = $task_time->fk_task;
+ $tasktmp->ref = $task_time->ref;
+ $tasktmp->label = $task_time->label;
+ print $tasktmp->getNomUrl(1, 'withproject', 'time');
+ print ' | ';
+ }
+ }
- // Task label
- if (!empty($arrayfields['t.task_label']['checked']))
- {
- if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
- {
- print '';
- print $task_time->label;
- print ' | ';
- }
- }
+ // Task label
+ if (!empty($arrayfields['t.task_label']['checked']))
+ {
+ if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) // Not a dedicated task
+ {
+ print '';
+ print $task_time->label;
+ print ' | ';
+ }
+ }
- // User
- if (!empty($arrayfields['author']['checked']))
- {
- print '';
- if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- if (empty($object->id)) $object->fetch($id);
- $contactsoftask = $object->getListContactId('internal');
- if (!in_array($task_time->fk_user, $contactsoftask)) {
- $contactsoftask[] = $task_time->fk_user;
- }
- if (count($contactsoftask) > 0) {
- print img_object('', 'user', 'class="hideonsmartphone"');
- print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask);
- } else {
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
- }
- }
- else
- {
- $userstatic->id = $task_time->fk_user;
- $userstatic->lastname = $task_time->lastname;
- $userstatic->firstname = $task_time->firstname;
- $userstatic->photo = $task_time->photo;
- $userstatic->statut = $task_time->user_status;
- print $userstatic->getNomUrl(-1);
- }
- print ' | ';
- }
+ // User
+ if (!empty($arrayfields['author']['checked']))
+ {
+ print '';
+ if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ if (empty($object->id)) $object->fetch($id);
+ $contactsoftask = $object->getListContactId('internal');
+ if (!in_array($task_time->fk_user, $contactsoftask)) {
+ $contactsoftask[] = $task_time->fk_user;
+ }
+ if (count($contactsoftask) > 0) {
+ print img_object('', 'user', 'class="hideonsmartphone"');
+ print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask);
+ } else {
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
+ }
+ }
+ else
+ {
+ $userstatic->id = $task_time->fk_user;
+ $userstatic->lastname = $task_time->lastname;
+ $userstatic->firstname = $task_time->firstname;
+ $userstatic->photo = $task_time->photo;
+ $userstatic->statut = $task_time->user_status;
+ print $userstatic->getNomUrl(-1);
+ }
+ print ' | ';
+ }
- // Note
- if (!empty($arrayfields['t.note']['checked']))
- {
- print '';
- if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- print '';
- }
- else
- {
- print dol_nl2br($task_time->note);
- }
- print ' | ';
- }
- elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- print '';
- }
+ // Note
+ if (!empty($arrayfields['t.note']['checked']))
+ {
+ print '';
+ if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ print '';
+ }
+ else
+ {
+ print dol_nl2br($task_time->note);
+ }
+ print ' | ';
+ }
+ elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ print '';
+ }
- // Time spent
- if (!empty($arrayfields['t.task_duration']['checked']))
- {
- print '';
- if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
- {
- print '';
- print $form->select_duration('new_duration_2', 0, 0, 'text');
- }
- else
- {
- print convertSecondToTime($task_time->task_duration, 'allhourmin');
- }
- print ' | ';
- }
+ // Time spent
+ if (!empty($arrayfields['t.task_duration']['checked']))
+ {
+ print '';
+ if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid)
+ {
+ print '';
+ print $form->select_duration('new_duration_2', 0, 0, 'text');
+ }
+ else
+ {
+ print convertSecondToTime($task_time->task_duration, 'allhourmin');
+ }
+ print ' | ';
+ }
- // Value spent
- if (!empty($arrayfields['value']['checked']))
- {
- print '';
- $value = 0;
- print price($value, 1, $langs, 1, -1, -1, $conf->currency);
- print ' | ';
- }
+ // Value spent
+ if (!empty($arrayfields['value']['checked']))
+ {
+ print '';
+ $value = 0;
+ print price($value, 1, $langs, 1, -1, -1, $conf->currency);
+ print ' | ';
+ }
- // Value billed
- if (!empty($arrayfields['valuebilled']['checked']))
- {
- print '';
- $valuebilled = price2num($task_time->total_ht);
- if (isset($task_time->total_ht)) print price($valuebilled, 1, $langs, 1, -1, -1, $conf->currency);
- print ' | ';
- }
+ // Value billed
+ if (!empty($arrayfields['valuebilled']['checked']))
+ {
+ print '';
+ $valuebilled = price2num($task_time->total_ht);
+ if (isset($task_time->total_ht)) print price($valuebilled, 1, $langs, 1, -1, -1, $conf->currency);
+ print ' | ';
+ }
- /*
- // Extra fields
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
- */
+ /*
+ // Extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
+ */
- // Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$task_time);
- $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
+ // Fields from hook
+ $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$task_time);
+ $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
- // Action column
- print '';
- print ' | ';
+ // Action column
+ print '';
+ print ' | ';
- print " \n";
+ print "\n";
}
$i++;
|