27 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
38 global $db, $langs, $conf, $user;
43 $head[$h][0] = DOL_URL_ROOT.
'/projet/card.php?id='.$object->id;
44 $head[$h][1] = $langs->trans(
"Project");
45 $head[$h][2] =
'project';
48 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
49 $head[$h][0] = DOL_URL_ROOT.
'/projet/contact.php?id='.$object->id;
50 $head[$h][1] = $langs->trans(
"ProjectContact");
51 if ($nbContact > 0) $head[$h][1].=
' <span class="badge">'.$nbContact.
'</span>';
52 $head[$h][2] =
'contact';
55 if (empty($conf->global->PROJECT_HIDE_TASKS))
58 $head[$h][0] = DOL_URL_ROOT.
'/projet/tasks.php?id='.$object->id;
59 $head[$h][1] = $langs->trans(
"Tasks");
61 require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
62 $taskstatic=
new Task($db);
63 $nbTasks=count($taskstatic->getTasksArray(0, 0, $object->id, 0, 0));
64 if ($nbTasks > 0) $head[$h][1].=
' <span class="badge">'.($nbTasks).
'</span>';
65 $head[$h][2] =
'tasks';
69 $sql =
"SELECT t.rowid";
72 $sql .=
" FROM ".MAIN_DB_PREFIX.
"projet_task_time as t, ".MAIN_DB_PREFIX.
"projet_task as pt";
73 $sql .=
" WHERE t.fk_task = pt.rowid";
74 $sql .=
" AND pt.fk_projet =".$object->id;
78 $obj = $db->fetch_object(
$resql);
79 if ($obj) $nbTimeSpent=1;
83 $head[$h][0] = DOL_URL_ROOT.
'/projet/tasks/time.php?withproject=1&projectid='.$object->id;
84 $head[$h][1] = $langs->trans(
"TimeSpent");
85 if ($nbTimeSpent > 0) $head[$h][1].=
' <span class="badge">...</span>';
86 $head[$h][2] =
'timespent';
90 if (! empty($conf->fournisseur->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)
91 || ! empty($conf->facture->enabled) || ! empty($conf->contrat->enabled)
92 || ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled))
94 $head[$h][0] = DOL_URL_ROOT.
'/projet/element.php?id='.$object->id;
95 $head[$h][1] = $langs->trans(
"ProjectOverview");
96 $head[$h][2] =
'element';
107 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
110 if(!empty($object->note_private)) $nbNote++;
111 if(!empty($object->note_public)) $nbNote++;
112 $head[$h][0] = DOL_URL_ROOT.
'/projet/note.php?id='.$object->id;
113 $head[$h][1] = $langs->trans(
'Notes');
114 if ($nbNote > 0) $head[$h][1].=
' <span class="badge">'.$nbNote.
'</span>';
115 $head[$h][2] =
'notes';
119 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
120 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
122 $nbFiles = count(
dol_dir_list($upload_dir,
'files',0,
'',
'(\.meta|_preview.*\.png)$'));
123 $nbLinks=
Link::count($db, $object->element, $object->id);
124 $head[$h][0] = DOL_URL_ROOT.
'/projet/document.php?id='.$object->id;
125 $head[$h][1] = $langs->trans(
'Documents');
126 if (($nbFiles+$nbLinks) > 0) $head[$h][1].=
' <span class="badge">'.($nbFiles+$nbLinks).
'</span>';
127 $head[$h][2] =
'document';
131 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT))
133 $nbComments = $object->getNbComments();
134 $head[$h][0] = DOL_URL_ROOT.
'/projet/comment.php?id='.$object->id;
135 $head[$h][1] = $langs->trans(
"CommentLink");
136 if ($nbComments > 0) $head[$h][1].=
' <span class="badge">'.$nbComments.
'</span>';
137 $head[$h][2] =
'project_comment';
141 $head[$h][0] = DOL_URL_ROOT.
'/projet/info.php?id='.$object->id;
142 $head[$h][1].= $langs->trans(
"Events");
143 if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
146 $head[$h][1].= $langs->trans(
"Agenda");
148 $head[$h][2] =
'agenda';
165 global $db, $langs, $conf, $user;
169 $head[$h][0] = DOL_URL_ROOT.
'/projet/tasks/task.php?id='.$object->id.(GETPOST(
'withproject')?
'&withproject=1':
'');
170 $head[$h][1] = $langs->trans(
"Card");
171 $head[$h][2] =
'task_task';
174 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
175 $head[$h][0] = DOL_URL_ROOT.
'/projet/tasks/contact.php?id='.$object->id.(GETPOST(
'withproject')?
'&withproject=1':
'');
176 $head[$h][1] = $langs->trans(
"TaskRessourceLinks");
177 if ($nbContact > 0) $head[$h][1].=
' <span class="badge">'.$nbContact.
'</span>';
178 $head[$h][2] =
'task_contact';
183 $sql =
"SELECT t.rowid";
186 $sql .=
" FROM ".MAIN_DB_PREFIX.
"projet_task_time as t";
187 $sql .=
" WHERE t.fk_task =".$object->id;
188 $resql = $db->query($sql);
191 $obj = $db->fetch_object(
$resql);
192 if ($obj) $nbTimeSpent=1;
196 $head[$h][0] = DOL_URL_ROOT.
'/projet/tasks/time.php?id='.$object->id.(GETPOST(
'withproject')?
'&withproject=1':
'');
197 $head[$h][1] = $langs->trans(
"TimeSpent");
198 if ($nbTimeSpent > 0) $head[$h][1].=
' <span class="badge">...</span>';
199 $head[$h][2] =
'task_time';
208 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
211 if(!empty($object->note_private)) $nbNote++;
212 if(!empty($object->note_public)) $nbNote++;
213 $head[$h][0] = DOL_URL_ROOT.
'/projet/tasks/note.php?id='.$object->id.(GETPOST(
'withproject')?
'&withproject=1':
'');
214 $head[$h][1] = $langs->trans(
'Notes');
215 if ($nbNote > 0) $head[$h][1].=
' <span class="badge">'.$nbNote.
'</span>';
216 $head[$h][2] =
'task_notes';
220 $head[$h][0] = DOL_URL_ROOT.
'/projet/tasks/document.php?id='.$object->id.(GETPOST(
'withproject')?
'&withproject=1':
'');
221 $filesdir = $conf->projet->dir_output .
"/" .
dol_sanitizeFileName($object->project->ref) .
'/' .dol_sanitizeFileName($object->ref);
222 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
223 include_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
224 $nbFiles = count(
dol_dir_list($filesdir,
'files',0,
'',
'(\.meta|_preview.*\.png)$'));
225 $nbLinks=
Link::count($db, $object->element, $object->id);
226 $head[$h][1] = $langs->trans(
'Documents');
227 if (($nbFiles+$nbLinks) > 0) $head[$h][1].=
' <span class="badge">'.($nbFiles+$nbLinks).
'</span>';
228 $head[$h][2] =
'task_document';
232 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK))
234 $nbComments = $object->getNbComments();
235 $head[$h][0] = DOL_URL_ROOT.
'/projet/tasks/comment.php?id='.$object->id.(GETPOST(
'withproject')?
'&withproject=1':
'');
236 $head[$h][1] = $langs->trans(
"CommentLink");
237 if ($nbComments > 0) $head[$h][1].=
' <span class="badge">'.$nbComments.
'</span>';
238 $head[$h][2] =
'task_comment';
256 global $langs, $conf, $user;
263 $param.=($mode?
'&mode='.$mode:
'');
264 if (is_object($fuser) && $fuser->id > 0 && $fuser->id != $user->id) $param.=
'&search_usertoprocessid='.$fuser->id;
266 if (empty($conf->global->PROJECT_DISABLE_TIMESHEET_PERWEEK))
268 $head[$h][0] = DOL_URL_ROOT.
"/projet/activity/perweek.php".($param?
'?'.$param:
'');
269 $head[$h][1] = $langs->trans(
"InputPerWeek");
270 $head[$h][2] =
'inputperweek';
274 if (empty($conf->global->PROJECT_DISABLE_TIMESHEET_PERTIME))
276 $head[$h][0] = DOL_URL_ROOT.
"/projet/activity/perday.php".($param?
'?'.$param:
'');
277 $head[$h][1] = $langs->trans(
"InputPerDay");
278 $head[$h][2] =
'inputperday';
305 global $langs, $conf, $user;
311 $head[$h][0] = DOL_URL_ROOT.
"/projet/admin/project.php";
312 $head[$h][1] = $langs->trans(
"Projects");
313 $head[$h][2] =
'project';
318 $head[$h][0] = DOL_URL_ROOT.
"/projet/admin/project_extrafields.php";
319 $head[$h][1] = $langs->trans(
"ExtraFieldsProject");
320 $head[$h][2] =
'attributes';
323 $head[$h][0] = DOL_URL_ROOT.
'/projet/admin/project_task_extrafields.php';
324 $head[$h][1] = $langs->trans(
"ExtraFieldsProjectTask");
325 $head[$h][2] =
'attributes_task';
350 function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId=
'', $addordertick=0, $projectidfortotallink=0, $filterprogresscalc=
'')
352 global $user, $bc, $langs, $conf, $db;
353 global $projectstatic, $taskstatic;
357 $projectsArrayId=explode(
',',$projectsListId);
358 if ($filterprogresscalc!==
'') {
359 foreach ($lines as $key=>$line) {
360 if (!empty($line->planned_workload) && !empty($line->duration)) {
361 $filterprogresscalc = str_replace(
' = ',
' == ', $filterprogresscalc);
362 if (!eval($filterprogresscalc)) {
367 $lines=array_values($lines);
370 $numlines=count($lines);
373 global $total_projectlinesa_spent,$total_projectlinesa_planned,$total_projectlinesa_spent_if_planned;
376 $total_projectlinesa_spent=0;
377 $total_projectlinesa_planned=0;
378 $total_projectlinesa_spent_if_planned=0;
381 for ($i = 0 ; $i < $numlines ; $i++)
383 if ($parent == 0 && $level >= 0) $level = 0;
388 if ($lines[$i]->fk_parent == $parent || $level < 0)
395 if (is_array($taskrole))
398 if (! isset($taskrole[$lines[$i]->
id]) && $lines[$i]->
id != $lines[$i]->fk_parent)
401 $foundtaskforuserdeeper=0;
404 if ($foundtaskforuserdeeper > 0)
418 if (empty($user->rights->projet->all->lire))
421 if (! in_array($lines[$i]->fk_project, $projectsArrayId))
434 if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
437 $lastprojectid=$lines[$i]->fk_project;
440 print '<tr '.$bc[$var].
' id="row-'.$lines[$i]->id.
'">'.
"\n";
447 $projectstatic->id=$lines[$i]->fk_project;
448 $projectstatic->ref=$lines[$i]->projectref;
449 $projectstatic->public=$lines[$i]->public;
450 $projectstatic->title=$lines[$i]->projectlabel;
451 if ($lines[$i]->
public || in_array($lines[$i]->fk_project,$projectsArrayId) || ! empty($user->rights->projet->all->lire))
print $projectstatic->getNomUrl(1);
452 else print $projectstatic->getNomUrl(1,
'nolink');
458 $projectstatic->statut=$lines[$i]->projectstatus;
459 print $projectstatic->getLibStatut(2);
467 print '<i>'.img_object(
'',
'projecttask').
' '.$lines[$i]->ref.
'</i>';
471 $taskstatic->id=$lines[$i]->id;
472 $taskstatic->ref=$lines[$i]->ref;
473 $taskstatic->label=($taskrole[$lines[$i]->id]?$langs->trans(
"YourRole").
': '.$taskrole[$lines[$i]->id]:
'');
474 print $taskstatic->getNomUrl(1,
'withproject');
480 if ($showlineingray)
print '<i>';
482 for ($k = 0 ; $k < $level ; $k++)
484 print " ";
486 print $lines[$i]->label;
487 if ($showlineingray)
print '</i>';
492 print '<td align="center">';
497 print '<td align="center">';
498 $taskstatic->projectstatus = $lines[$i]->projectstatus;
499 $taskstatic->progress = $lines[$i]->progress;
500 $taskstatic->fk_statut = $lines[$i]->status;
501 $taskstatic->datee = $lines[$i]->date_end;
506 $plannedworkloadoutputformat=
'allhourmin';
507 $timespentoutputformat=
'allhourmin';
508 if (! empty($conf->global->PROJECT_PLANNED_WORKLOAD_FORMAT)) $plannedworkloadoutputformat=$conf->global->PROJECT_PLANNED_WORKLOAD_FORMAT;
509 if (! empty($conf->global->PROJECT_TIMES_SPENT_FORMAT)) $timespentoutputformat=$conf->global->PROJECT_TIME_SPENT_FORMAT;
512 print '<td align="right">';
515 if ($lines[$i]->planned_workload !=
'')
525 print '<td align="right">';
526 if ($showlineingray)
print '<i>';
527 else print '<a href="'.DOL_URL_ROOT.
'/projet/tasks/time.php?id='.$lines[$i]->id.($showproject?
'':
'&withproject=1').
'">';
530 if ($showlineingray)
print '</i>';
535 print '<td align="right">';
536 if ($lines[$i]->planned_workload || $lines[$i]->duration)
538 if ($lines[$i]->planned_workload)
print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload,2).
' %';
539 else print '<span class="opacitymedium">'.$langs->trans(
'WorkloadNotDefined').
'</span>';
544 print '<td align="right">';
545 if ($lines[$i]->progress !=
'')
547 print $lines[$i]->progress.
' %';
552 if (! empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST))
555 foreach(array(
'internal',
'external') as $source)
557 $tab = $lines[$i]->liste_contact(-1,$source);
560 foreach ($tab as $contacttask){
562 if ($source ==
'internal') $c =
new User($db);
564 $c->fetch($contacttask[
'id']);
565 print $c->getNomUrl(1) .
' (' . $contacttask[
'libelle'] .
')' .
'<br>';
575 print '<td align="center" class="tdlineupdown hideonsmartphone"> </td>';
580 if (! $showlineingray) $inc++;
585 if ($lines[$i]->
id)
projectLinesa($inc, $lines[$i]->
id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick);
589 $total_projectlinesa_spent += $lines[$i]->duration;
590 $total_projectlinesa_planned += $lines[$i]->planned_workload;
591 if ($lines[$i]->planned_workload) $total_projectlinesa_spent_if_planned += $lines[$i]->duration;
600 if (($total_projectlinesa_planned > 0 || $total_projectlinesa_spent > 0) && $level <= 0)
602 print '<tr class="liste_total nodrag nodrop">';
603 print '<td class="liste_total">'.$langs->trans(
"Total").
'</td>';
604 if ($showproject)
print '<td></td><td></td>';
608 print '<td align="right" class="nowrap liste_total">';
611 print '<td align="right" class="nowrap liste_total">';
612 if ($projectidfortotallink > 0)
print '<a href="'.DOL_URL_ROOT.
'/projet/tasks/time.php?projectid='.$projectidfortotallink.($showproject?
'':
'&withproject=1').
'">';
614 if ($projectidfortotallink > 0)
print '</a>';
616 print '<td align="right" class="nowrap liste_total">';
617 if ($total_projectlinesa_planned)
print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned,2).
' %';
621 if (! empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST))
625 if ($addordertick)
print '<td class="hideonsmartphone"></td>';
650 function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak=0)
652 global $conf, $db, $user, $bc, $langs;
653 global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
656 $totalforeachline=array();
657 $workloadforid=array();
658 $lineswithoutlevel0=array();
660 $numlines=count($lines);
665 for ($i = 0 ; $i < $numlines ; $i++)
667 if ($lines[$i]->fk_task_parent) $lineswithoutlevel0[]=$lines[$i];
671 if (empty($oldprojectforbreak))
673 $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:-1);
677 for ($i = 0 ; $i < $numlines ; $i++)
679 if ($parent == 0) $level = 0;
684 if (empty($mine) || ! empty($tasksrole[$lines[$i]->
id]))
689 if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
691 $lastprojectid=$lines[$i]->fk_project;
694 $projectstatic->id = $lines[$i]->fk_project;
698 if (empty($workloadforid[$projectstatic->id]))
702 $projectstatic->loadTimeSpent($preselectedday, 0, $fuser->id);
703 $workloadforid[$projectstatic->id]=1;
707 $projectstatic->id=$lines[$i]->fk_project;
708 $projectstatic->ref=$lines[$i]->project_ref;
709 $projectstatic->title=$lines[$i]->project_label;
710 $projectstatic->public=$lines[$i]->public;
712 $taskstatic->id=$lines[$i]->task_id;
713 $taskstatic->ref=($lines[$i]->task_ref?$lines[$i]->task_ref:$lines[$i]->task_id);
714 $taskstatic->label=$lines[$i]->task_label;
715 $taskstatic->date_start=$lines[$i]->date_start;
716 $taskstatic->date_end=$lines[$i]->date_end;
718 $thirdpartystatic->id=$lines[$i]->socid;
719 $thirdpartystatic->name=$lines[$i]->thirdparty_name;
720 $thirdpartystatic->email=$lines[$i]->thirdparty_email;
722 if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
724 print '<tr class="oddeven trforbreak">'.
"\n";
725 print '<td colspan="11">';
726 print $projectstatic->getNomUrl(1,
'',0,$langs->transnoentitiesnoconv(
"YourRole").
': '.$projectsrole[$lines[$i]->fk_project]);
727 if ($projectstatic->title)
730 print $projectstatic->title;
736 if ($oldprojectforbreak != -1) $oldprojectforbreak = $projectstatic->id;
738 print '<tr class="oddeven">'.
"\n";
749 if ($oldprojectforbreak == -1)
751 print $projectstatic->getNomUrl(1,
'',0,$langs->transnoentitiesnoconv(
"YourRole").
': '.$projectsrole[$lines[$i]->fk_project]);
752 print '<br>'.$projectstatic->title;
757 print '<td class="tdoverflowmax100">';
758 if ($thirdpartystatic->id > 0)
print $thirdpartystatic->getNomUrl(1,
'project', 10);
763 print '<!-- Task id = '.$lines[$i]->id.
' -->';
764 for ($k = 0 ; $k < $level ; $k++)
print " ";
765 print $taskstatic->getNomUrl(1,
'withproject',
'time');
768 for ($k = 0 ; $k < $level ; $k++)
print " ";
769 print $taskstatic->label;
776 print '<td align="center">';
780 $disabledproject=1;$disabledtask=1;
785 if ($lines[$i]->
public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
791 if ($restricteditformytask && empty($tasksrole[$lines[$i]->
id]))
797 print '<td class="nowrap" align="center">';
802 if (! $isavailable[$preselectedday][
'morning'] && ! $isavailable[$preselectedday][
'afternoon']) $cssonholiday.=
'onholidayallday ';
803 elseif (! $isavailable[$preselectedday][
'morning']) $cssonholiday.=
'onholidaymorning ';
804 elseif (! $isavailable[$preselectedday][
'afternoon']) $cssonholiday.=
'onholidayafternoon ';
807 print '<td align="center" class="duration'.($cssonholiday?
' '.$cssonholiday:
'').
'">';
809 $dayWorkLoad = $lines[$i]->timespent_duration;
810 $totalforeachline[$preselectedday]+=$lines[$i]->timespent_duration;
813 if ($dayWorkLoad > 0) $alreadyspent=
convertSecondToTime($lines[$i]->timespent_duration,
'allhourmin');
819 print '<script type="text/javascript">';
820 print "jQuery(document).ready(function () {\n";
821 print " jQuery('.inputhour, .inputminute').bind('keyup', function(e) { updateTotal(0, '".$modeinput.
"') });";
828 print '<td align="center">';
829 print '<textarea name="'.$lines[$i]->id.
'note" rows="'.ROWS_2.
'" id="'.$lines[$i]->id.
'note"'.($disabledtask?
' disabled="disabled"':
'').
'>';
830 print $lines[$i]->timespent_note;
835 print '<td align="right">';
855 return $totalforeachline;
876 function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak=0)
878 global $conf, $db, $user, $bc, $langs;
879 global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
882 $totalforeachday=array();
883 $workloadforid=array();
884 $lineswithoutlevel0=array();
886 $numlines=count($lines);
891 for ($i = 0 ; $i < $numlines ; $i++)
893 if ($lines[$i]->fk_task_parent) $lineswithoutlevel0[]=$lines[$i];
897 if (empty($oldprojectforbreak))
899 $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:-1);
903 for ($i = 0 ; $i < $numlines ; $i++)
905 if ($parent == 0) $level = 0;
907 if ($lines[$i]->fk_task_parent == $parent)
910 if (empty($mine) || ! empty($tasksrole[$lines[$i]->
id]))
914 if ($restricteditformytask == 2 && empty($tasksrole[$lines[$i]->
id]))
920 if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
922 $lastprojectid=$lines[$i]->fk_project;
925 $projectstatic->id = $lines[$i]->fk_project;
929 if (empty($workloadforid[$projectstatic->id]))
933 $projectstatic->loadTimeSpent($preselectedday, 0, $fuser->id);
934 $workloadforid[$projectstatic->id]=1;
938 $projectstatic->id=$lines[$i]->fk_project;
939 $projectstatic->ref=$lines[$i]->projectref;
940 $projectstatic->title=$lines[$i]->projectlabel;
941 $projectstatic->public=$lines[$i]->public;
943 $taskstatic->id=$lines[$i]->id;
944 $taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id);
945 $taskstatic->label=$lines[$i]->label;
946 $taskstatic->date_start=$lines[$i]->date_start;
947 $taskstatic->date_end=$lines[$i]->date_end;
949 $thirdpartystatic->id=$lines[$i]->socid;
950 $thirdpartystatic->name=$lines[$i]->thirdparty_name;
951 $thirdpartystatic->email=$lines[$i]->thirdparty_email;
953 if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
955 print '<tr class="oddeven trforbreak">'.
"\n";
956 print '<td colspan="9">';
957 print $projectstatic->getNomUrl(1,
'',0,
'<strong>'.$langs->transnoentitiesnoconv(
"YourRole").
':</strong> '.$projectsrole[$lines[$i]->fk_project]);
958 if ($thirdpartystatic->id > 0)
print ' - '.$thirdpartystatic->getNomUrl(1);
959 if ($projectstatic->title)
962 print $projectstatic->title;
968 if ($oldprojectforbreak != -1) $oldprojectforbreak = $projectstatic->id;
970 print '<tr class="oddeven">'.
"\n";
991 print '<!-- Task id = '.$lines[$i]->id.
' -->';
992 for ($k = 0 ; $k < $level ; $k++)
print " ";
993 print $taskstatic->getNomUrl(1,
'withproject',
'time');
996 for ($k = 0 ; $k < $level ; $k++)
print " ";
997 print $taskstatic->label;
1004 print '<td align="right" class="leftborder plannedworkload">';
1010 print '<td align="right">';
1011 print $formother->select_percent($lines[$i]->progress, $lines[$i]->
id .
'progress');
1015 print '<td align="right">';
1017 if ($lines[$i]->duration)
1019 print '<a href="'.DOL_URL_ROOT.
'/projet/tasks/time.php?id='.$lines[$i]->id.
'">';
1027 print '<td align="right">';
1028 $tmptimespent=$taskstatic->getSummaryOfTimeSpent($fuser->id);
1033 $disabledproject=1;$disabledtask=1;
1038 if ($lines[$i]->
public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
1044 if ($restricteditformytask && empty($tasksrole[$lines[$i]->
id]))
1050 print '<td class="nowrap leftborder" align="center">';
1051 $tableCell = $form->selectDate($preselectedday, $lines[$i]->
id, 1, 1, 2,
"addtime", 0, 0, $disabledtask);
1056 if (! $isavailable[$preselectedday][
'morning'] && ! $isavailable[$preselectedday][
'afternoon']) $cssonholiday.=
'onholidayallday ';
1057 elseif (! $isavailable[$preselectedday][
'morning']) $cssonholiday.=
'onholidaymorning ';
1058 elseif (! $isavailable[$preselectedday][
'afternoon']) $cssonholiday.=
'onholidayafternoon ';
1062 $idw = $tmparray[
'wday'];
1064 global $numstartworkingday, $numendworkingday;
1066 if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday)
1068 $cssweekend=
'weekend';
1072 print '<td class="center duration'.($cssonholiday?
' '.$cssonholiday:
'').($cssweekend?
' '.$cssweekend:
'').
'">';
1073 $dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id];
1074 $totalforeachday[$preselectedday]+=$dayWorkLoad;
1082 $tableCell.=
'<span class="timesheetalreadyrecorded" title="texttoreplace"><input type="text" class="center" size="2" disabled id="timespent['.$inc.
']['.$idw.
']" name="task['.$lines[$i]->id.
']['.$idw.
']" value="'.$alreadyspent.
'"></span>';
1083 $tableCell.=
'<span class="hideonsmartphone"> + </span>';
1085 $tableCell.=$form->select_duration($lines[$i]->
id.
'duration',
'',$disabledtask,
'text',0,1);
1091 print '<script type="text/javascript">';
1092 print "jQuery(document).ready(function () {\n";
1093 print " jQuery('.inputhour, .inputminute').bind('keyup', function(e) { updateTotal(0, '".$modeinput.
"') });";
1100 print '<td align="center">';
1101 print '<textarea name="'.$lines[$i]->id.
'note" rows="'.ROWS_2.
'" id="'.$lines[$i]->id.
'note"'.($disabledtask?
' disabled="disabled"':
'').
'>';
1102 print '</textarea>';
1106 print '<td align="right">';
1107 if ((! $lines[$i]->
public) && $disabledproject)
print $form->textwithpicto(
'',$langs->trans(
"UserIsNotContactOfProject"));
1108 else if ($disabledtask)
1110 $titleassigntask = $langs->trans(
"AssignTaskToMe");
1111 if ($fuser->id != $user->id) $titleassigntask = $langs->trans(
"AssignTaskToUser",
'...');
1113 print $form->textwithpicto(
'',$langs->trans(
"TaskIsNotAssignedToUser", $titleassigntask));
1122 if ($lines[$i]->
id > 0)
1126 $ret =
projectLinesPerDay($inc, $lines[$i]->
id, $fuser, ($parent == 0 ? $lineswithoutlevel0 : $lines), $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $preselectedday, $isavailable, $oldprojectforbreak);
1129 foreach($ret as $key => $val)
1131 $totalforeachday[$key]+=$val;
1144 return $totalforeachday;
1165 function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak=0)
1167 global $conf, $db, $user, $bc, $langs;
1168 global $form, $formother, $projectstatic, $taskstatic, $thirdpartystatic;
1170 $numlines=count($lines);
1173 $workloadforid=array();
1174 $totalforeachday=array();
1175 $lineswithoutlevel0=array();
1180 for ($i = 0 ; $i < $numlines ; $i++)
1182 if ($lines[$i]->fk_task_parent) $lineswithoutlevel0[]=$lines[$i];
1188 if (empty($oldprojectforbreak))
1190 $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:-1);
1193 for ($i = 0 ; $i < $numlines ; $i++)
1195 if ($parent == 0) $level = 0;
1197 if ($lines[$i]->fk_task_parent == $parent)
1200 if (empty($mine) || ! empty($tasksrole[$lines[$i]->
id]))
1204 if ($restricteditformytask == 2 && empty($tasksrole[$lines[$i]->
id]))
1210 if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
1212 $lastprojectid=$lines[$i]->fk_project;
1213 $projectstatic->id = $lines[$i]->fk_project;
1218 if (empty($workloadforid[$projectstatic->id]))
1220 $projectstatic->loadTimeSpent($firstdaytoshow, 0, $fuser->id);
1221 $workloadforid[$projectstatic->id]=1;
1226 $projectstatic->id=$lines[$i]->fk_project;
1227 $projectstatic->ref=$lines[$i]->projectref;
1228 $projectstatic->title=$lines[$i]->projectlabel;
1229 $projectstatic->public=$lines[$i]->public;
1230 $projectstatic->thirdparty_name=$lines[$i]->thirdparty_name;
1232 $taskstatic->id=$lines[$i]->id;
1233 $taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id);
1234 $taskstatic->label=$lines[$i]->label;
1235 $taskstatic->date_start=$lines[$i]->date_start;
1236 $taskstatic->date_end=$lines[$i]->date_end;
1238 $thirdpartystatic->id=$lines[$i]->thirdparty_id;
1239 $thirdpartystatic->name=$lines[$i]->thirdparty_name;
1240 $thirdpartystatic->email=$lines[$i]->thirdparty_email;
1242 if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
1244 print '<tr class="oddeven trforbreak">'.
"\n";
1245 print '<td colspan="13">';
1246 print $projectstatic->getNomUrl(1,
'',0,
'<strong>'.$langs->transnoentitiesnoconv(
"YourRole").
':</strong> '.$projectsrole[$lines[$i]->fk_project]);
1247 if ($thirdpartystatic->id > 0)
print ' - '.$thirdpartystatic->getNomUrl(1);
1248 if ($projectstatic->title)
1251 print $projectstatic->title;
1257 if ($oldprojectforbreak != -1) $oldprojectforbreak = $projectstatic->id;
1259 print '<tr class="oddeven">'.
"\n";
1279 print '<td class="nowrap">';
1280 print '<!-- Task id = '.$lines[$i]->id.
' -->';
1281 for ($k = 0 ; $k < $level ; $k++)
print " ";
1282 print $taskstatic->getNomUrl(1,
'withproject',
'time');
1285 for ($k = 0 ; $k < $level ; $k++)
print " ";
1287 print $taskstatic->label;
1294 print '<td align="right" class="leftborder plannedworkload">';
1300 print '<td align="right">';
1301 print $formother->select_percent($lines[$i]->progress, $lines[$i]->
id .
'progress');
1305 print '<td align="right">';
1307 if ($lines[$i]->duration)
1309 print '<a href="'.DOL_URL_ROOT.
'/projet/tasks/time.php?id='.$lines[$i]->id.
'">';
1317 print '<td align="right">';
1318 $tmptimespent=$taskstatic->getSummaryOfTimeSpent($fuser->id);
1323 $disabledproject=1;$disabledtask=1;
1328 if ($lines[$i]->
public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
1334 if ($restricteditformytask && empty($tasksrole[$lines[$i]->
id]))
1342 $tableCell=
''; $modeinput=
'hours';
1343 for ($idw = 0; $idw < 7; $idw++)
1348 if (! $isavailable[$tmpday][
'morning'] && ! $isavailable[$tmpday][
'afternoon']) $cssonholiday.=
'onholidayallday ';
1349 elseif (! $isavailable[$tmpday][
'morning']) $cssonholiday.=
'onholidaymorning ';
1350 elseif (! $isavailable[$tmpday][
'afternoon']) $cssonholiday.=
'onholidayafternoon ';
1353 $dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id];
1354 $totalforeachday[$tmpday]+=$dayWorkLoad;
1358 $alttitle=$langs->trans(
"AddHereTimeSpentForDay",$tmparray[
'day'],$tmparray[
'mon']);
1360 global $numstartworkingday, $numendworkingday;
1362 if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday)
1364 $cssweekend=
'weekend';
1367 $tableCell =
'<td align="center" class="hide'.$idw.($cssonholiday?
' '.$cssonholiday:
'').($cssweekend?
' '.$cssweekend:
'').
'">';
1371 $tableCell.=
'<span class="timesheetalreadyrecorded" title="texttoreplace"><input type="text" class="center smallpadd" size="2" disabled id="timespent['.$inc.
']['.$idw.
']" name="task['.$lines[$i]->id.
']['.$idw.
']" value="'.$alreadyspent.
'"></span>';
1375 $tableCell.=
'<input type="text" alt="'.($disabledtask?
'':$alttitle).
'" title="'.($disabledtask?
'':$alttitle).
'" '.($disabledtask?
'disabled':$placeholder).
' class="center smallpadd" size="2" id="timeadded['.$inc.
']['.$idw.
']" name="task['.$lines[$i]->id.
']['.$idw.
']" value="" cols="2" maxlength="5"';
1376 $tableCell.=
' onkeypress="return regexEvent(this,event,\'timeChar\')"';
1377 $tableCell.=
' onkeyup="updateTotal('.$idw.
',\''.$modeinput.
'\')
"'; 1378 $tableCell.=' onblur="regexEvent(
this,event,\
''.$modeinput.
'\'); updateTotal(
'.$idw.',\
''.$modeinput.
'\')
" />'; 1379 $tableCell.='</td>'; 1384 print '<td align="right
">'; 1385 if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject
")); 1386 else if ($disabledtask) 1388 $titleassigntask = $langs->trans("AssignTaskToMe
"); 1389 if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser
", '...'); 1391 print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser
", $titleassigntask)); 1398 // Call to show task with a lower level (task under the current task) 1401 if ($lines[$i]->id > 0) 1403 //var_dump('totalforeachday after taskid='.$lines[$i]->id.' and previous one on level '.$level); 1404 //var_dump($totalforeachday); 1405 $ret = projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, ($parent == 0 ? $lineswithoutlevel0 : $lines), $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $isavailable, $oldprojectforbreak); 1406 //var_dump('ret with parent='.$lines[$i]->id.' level='.$level); 1408 foreach($ret as $key => $val) 1410 $totalforeachday[$key]+=$val; 1412 //var_dump('totalforeachday after taskid='.$lines[$i]->id.' and previous one on level '.$level.' + subtasks'); 1413 //var_dump($totalforeachday); 1423 return $totalforeachday; 1436 function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) 1438 //print 'Search in line with parent id = '.$parent.'<br>'; 1439 $numlines=count($lines); 1440 for ($i = 0 ; $i < $numlines ; $i++) 1442 // Process line $lines[$i] 1443 if ($lines[$i]->fk_parent == $parent && $lines[$i]->id != $lines[$i]->fk_parent) 1445 // If task is legitimate to show, no more need to search deeper 1446 if (isset($taskrole[$lines[$i]->id])) 1448 //print 'Found a legitimate task id='.$lines[$i]->id.'<br>'; 1453 searchTaskInChild($inc, $lines[$i]->id, $lines, $taskrole); 1454 //print 'Found inc='.$inc.'<br>'; 1456 if ($inc > 0) return $inc; 1476 function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=0, $statut=-1, $listofoppstatus=array(),$hiddenfields=array()) 1478 global $langs,$conf,$user,$bc; 1480 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; 1482 $projectstatic=new Project($db); 1483 $thirdpartystatic=new Societe($db); 1487 $project_year_filter=0; 1490 if (strcmp($statut, '') && $statut >= 0) $title=$langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$statut]); 1492 $arrayidtypeofcontact=array(); 1494 print '<div class="div-table-responsive-no-min
">'; 1495 print '<table class="noborder
" width="100%
">'; 1497 $sql= " FROM
".MAIN_DB_PREFIX."projet as p
"; 1500 $sql.= ",
".MAIN_DB_PREFIX."projet_task as t
"; 1501 $sql.= ",
".MAIN_DB_PREFIX."element_contact as ec
"; 1502 $sql.= ",
".MAIN_DB_PREFIX."c_type_contact as ctc
"; 1506 $sql.= " LEFT JOIN
".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet
"; 1508 $sql.= " WHERE p.entity IN (
".getEntity('project').")
"; 1509 $sql.= " AND p.rowid IN (
".$projectsListId.")
"; 1510 if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc =
".$socid.")
"; 1513 $sql.= " AND p.rowid = t.fk_projet
"; 1514 $sql.= " AND ec.element_id = t.rowid
"; 1515 $sql.= " AND ec.fk_socpeople =
".$user->id; 1516 $sql.= " AND ec.fk_c_type_contact = ctc.rowid
"; // Replace the 2 lines with ec.fk_c_type_contact in $arrayidtypeofcontact 1517 $sql.= " AND ctc.element =
'project_task'"; 1521 $sql.= " AND p.fk_statut =
".$statut; 1523 if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) 1525 $project_year_filter = GETPOST("project_year_filter
"); 1526 //Check if empty or invalid year. Wildcard ignores the sql check 1527 if ($project_year_filter != "*
") 1529 if (empty($project_year_filter) || !ctype_digit($project_year_filter)) 1531 $project_year_filter = date("Y
"); 1533 $sql.= " AND (p.dateo IS NULL OR p.dateo <=
".$db->idate(dol_get_last_day($project_year_filter,12,false)).")
"; 1534 $sql.= " AND (p.datee IS NULL OR p.datee >=
".$db->idate(dol_get_first_day($project_year_filter,1,false)).")
"; 1538 // Get id of project we must show tasks 1539 $arrayidofprojects=array(); 1540 $sql1 = "SELECT p.rowid as projectid
"; 1542 $resql = $db->query($sql1); 1546 $num = $db->num_rows($resql); 1549 $objp = $db->fetch_object($resql); 1550 $arrayidofprojects[$objp->projectid]=$objp->projectid; 1554 else dol_print_error($db); 1555 if (empty($arrayidofprojects)) $arrayidofprojects[0]=-1; 1557 // Get list of project with calculation on tasks 1558 $sql2 = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_soc, s.nom as socname, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount,
"; 1559 $sql2.= " p.dateo, p.datee,
"; 1560 $sql2.= " COUNT(t.rowid) as nb, SUM(t.planned_workload) as planned_workload, SUM(t.planned_workload * t.progress / 100) as declared_progess_workload";
1561 $sql2.= " FROM ".MAIN_DB_PREFIX."projet as p";
1562 $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
1563 $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
1564 $sql2.= " WHERE p.rowid IN (".join(',',$arrayidofprojects).")";
1565 $sql2.= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, s.
nom, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount, p.dateo, p.datee";
1566 $sql2.= " ORDER BY p.title, p.ref";
1568 $resql = $db->query($sql2);
1572 $total_opp_amount = 0;
1573 $ponderated_opp_amount = 0;
1575 $num = $db->num_rows($resql);
1578 print '<tr class="liste_titre">';
1579 print_liste_field_titre($title.
' <span class="badge">'.$num.
'</span>',$_SERVER[
"PHP_SELF"],
"",
"",
"",
"",$sortfield,$sortorder);
1581 if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
1586 if (empty($conf->global->PROJECT_HIDE_TASKS))
1589 if (! in_array(
'plannedworkload', $hiddenfields))
print_liste_field_titre(
"PlannedWorkload",
"",
"",
"",
"",
'align="right"',$sortfield,$sortorder);
1590 if (! in_array(
'declaredprogress', $hiddenfields))
print_liste_field_titre(
"ProgressDeclared",
"",
"",
"",
"",
'align="right"',$sortfield,$sortorder);
1595 $total_plannedworkload=0;
1596 $total_declaredprogressworkload=0;
1599 $objp = $db->fetch_object($resql);
1601 $projectstatic->id = $objp->projectid;
1602 $projectstatic->user_author_id = $objp->fk_user_creat;
1603 $projectstatic->public = $objp->public;
1606 $userAccess = $projectstatic->restrictedProjectArea($user);
1607 if ($userAccess >= 0)
1609 $projectstatic->ref=$objp->ref;
1610 $projectstatic->statut = $objp->status;
1611 $projectstatic->title = $objp->title;
1612 $projectstatic->datee = $db->jdate($objp->datee);
1613 $projectstatic->dateo = $db->jdate($objp->dateo);
1616 print '<tr class="oddeven">';
1618 print $projectstatic->getNomUrl(1);
1619 if (! in_array(
'projectlabel', $hiddenfields))
print '<br>'.dol_trunc($objp->title,24);
1622 if ($objp->fk_soc > 0)
1624 $thirdpartystatic->id=$objp->fk_soc;
1625 $thirdpartystatic->ref=$objp->socname;
1626 $thirdpartystatic->name=$objp->socname;
1627 print $thirdpartystatic->getNomUrl(1);
1630 if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
1632 print '<td align="right">';
1633 if ($objp->opp_amount)
print price($objp->opp_amount, 0,
'', 1, -1, -1, $conf->currency);
1635 print '<td align="right">';
1636 $code =
dol_getIdFromCode($db, $objp->opp_status,
'c_lead_status',
'rowid',
'code');
1637 if ($code)
print $langs->trans(
"OppStatus".$code);
1640 if (empty($conf->global->PROJECT_HIDE_TASKS))
1642 print '<td align="right">'.$objp->nb.
'</td>';
1644 $plannedworkload=$objp->planned_workload;
1645 $total_plannedworkload+=$plannedworkload;
1646 if (! in_array(
'plannedworkload', $hiddenfields))
1650 if (! in_array(
'declaredprogress', $hiddenfields))
1652 $declaredprogressworkload=$objp->declared_progess_workload;
1653 $total_declaredprogressworkload+=$declaredprogressworkload;
1654 print '<td align="right">';
1656 print ($plannedworkload?round(100*$declaredprogressworkload/$plannedworkload,0).
'%':
'');
1661 print '<td align="right">'.$projectstatic->getLibStatut(3).
'</td>';
1664 $total_task = $total_task + $objp->nb;
1665 $total_opp_amount = $total_opp_amount + $objp->opp_amount;
1666 $ponderated_opp_amount = $ponderated_opp_amount +
price2num($listofoppstatus[$objp->opp_status] * $objp->opp_amount / 100);
1672 print '<tr class="liste_total">';
1673 print '<td colspan="2">'.$langs->trans(
"Total").
"</td>";
1674 if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
1676 print '<td class="liste_total" align="right">'.price($total_opp_amount, 0,
'', 1, -1, -1, $conf->currency).
'</td>';
1677 print '<td class="liste_total" align="right">'.$form->textwithpicto(
price($ponderated_opp_amount, 0,
'', 1, -1, -1, $conf->currency), $langs->trans(
"OpportunityPonderatedAmountDesc"), 1).
'</td>';
1679 if (empty($conf->global->PROJECT_HIDE_TASKS))
1681 print '<td class="liste_total" align="right">'.$total_task.
'</td>';
1682 if (! in_array(
'plannedworkload', $hiddenfields))
print '<td class="liste_total" align="right">'.($total_plannedworkload?
convertSecondToTime($total_plannedworkload):
'').
'</td>';
1683 if (! in_array(
'declaredprogress', $hiddenfields))
print '<td class="liste_total" align="right">'.($total_plannedworkload?round(100*$total_declaredprogressworkload/$total_plannedworkload,0).
'%':
'').
'</td>';
1685 print '<td class="liste_total"></td>';
1698 if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE))
1701 print '<form method="get" action="'.$_SERVER[
"PHP_SELF"].
'">';
1702 print '<table width="100%">';
1704 print '<td>'.$langs->trans(
"Year").
'</td>';
1705 print '<td style="text-align:right"><input type="text" size="4" class="flat" name="project_year_filter" value="'.$project_year_filter.
'"/>';
1707 print '</table></form>';
convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
img_warning($titlealt='default', $moreatt='')
Show warning logo.
print
Draft customers invoices.
if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) if(! empty($conf->don->enabled) && $user->rights->societe->lire) if(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) if(! empty($conf->facture->enabled) &&! empty($conf->commande->enabled) && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add')
Complete or removed entries into a head array (used to build tabs).
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0, $filterprogresscalc='')
Show task lines with a particular parent.
Class to manage Dolibarr users.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0)
Return an id or code from a code or id.
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak=0)
Output a task line into a perday intput mode.
searchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
Search in task lines with a particular parent if there is a task for a particular user (in taskrole) ...
if(! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'] s nom
projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak=0)
Output a task line into a pertime intput mode.
if(GETPOST('cancel', 'alpha')) if(! GETPOST( 'confirmmassaction', 'alpha') &&$massaction !='presend' &&$massaction !='confirm_presend')
Draft customers invoices.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
static count($db, $objecttype, $objectid)
Return nb of links.
project_prepare_head($object)
Prepare array with list of tabs.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
Show title line of an array.
dol_getdate($timestamp, $fast=false)
Return an array with locale date info.
projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak=0)
Output a task line into a pertime intput mode.
project_admin_prepare_head()
Prepare array with list of tabs.
project_timesheet_prepare_head($mode, $fuser=null)
Prepare array with list of tabs.
dol_time_plus_duree($time, $duration_value, $duration_unit)
Add a delay to a date.
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is '...
task_prepare_head($object)
Prepare array with list of tabs.