28require
"../main.inc.php";
29require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
49$langsLoad = array(
'projects',
'users',
'companies');
51 $langsLoad[] =
'eventorganization';
54$langs->loadLangs($langsLoad);
56$action =
GETPOST(
'action',
'aZ09');
57$massaction =
GETPOST(
'massaction',
'alpha');
59$confirm =
GETPOST(
'confirm',
'alpha');
61$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'projecttasklist';
62$backtopage =
GETPOST(
'backtopage',
'alpha');
64$optioncss =
GETPOST(
'optioncss',
'aZ');
65$backtopage =
GETPOST(
'backtopage',
'alpha');
66$toselect =
GETPOST(
'toselect',
'array:int');
70$taskref =
GETPOST(
'taskref',
'alpha');
74$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
75$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
77if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
80$offset = $limit * $page;
85$search_taskref =
GETPOST(
'search_taskref');
86$search_tasklabel =
GETPOST(
'search_tasklabel');
87$search_taskdescription =
GETPOST(
'search_taskdescription');
88$search_dtstartday =
GETPOST(
'search_dtstartday');
89$search_dtstartmonth =
GETPOST(
'search_dtstartmonth');
90$search_dtstartyear =
GETPOST(
'search_dtstartyear');
91$search_dtendday =
GETPOST(
'search_dtendday');
92$search_dtendmonth =
GETPOST(
'search_dtendmonth');
93$search_dtendyear =
GETPOST(
'search_dtendyear');
94$search_planedworkload =
GETPOST(
'search_planedworkload');
95$search_timespend =
GETPOST(
'search_timespend');
96$search_progresscalc =
GETPOST(
'search_progresscalc');
97$search_progressdeclare =
GETPOST(
'search_progressdeclare');
98$search_task_budget_amount =
GETPOST(
'search_task_budget_amount');
99$search_task_billable =
GETPOST(
'search_task_billable');
100$search_status =
GETPOST(
'search_status');
102$search_date_start_startmonth =
GETPOSTINT(
'search_date_start_startmonth');
103$search_date_start_startyear =
GETPOSTINT(
'search_date_start_startyear');
104$search_date_start_startday =
GETPOSTINT(
'search_date_start_startday');
105$search_date_start_start =
dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear);
106$search_date_start_endmonth =
GETPOSTINT(
'search_date_start_endmonth');
107$search_date_start_endyear =
GETPOSTINT(
'search_date_start_endyear');
108$search_date_start_endday =
GETPOSTINT(
'search_date_start_endday');
109$search_date_start_end =
dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);
111$search_date_end_startmonth =
GETPOSTINT(
'search_date_end_startmonth');
112$search_date_end_startyear =
GETPOSTINT(
'search_date_end_startyear');
113$search_date_end_startday =
GETPOSTINT(
'search_date_end_startday');
114$search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
115$search_date_end_endmonth =
GETPOSTINT(
'search_date_end_endmonth');
116$search_date_end_endyear =
GETPOSTINT(
'search_date_end_endyear');
117$search_date_end_endday =
GETPOSTINT(
'search_date_end_endday');
118$search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
124include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
125if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object,
'fetchComments') && empty(
$object->comments)) {
129if ($id > 0 || !empty($ref)) {
131 $extrafields->fetch_name_optionals_label(
$object->table_element);
134$extrafields->fetch_name_optionals_label($taskstatic->table_element);
135$search_array_options = $extrafields->getOptionalsFromPost($taskstatic->table_element,
'',
'search_');
138$permissiontoread = 0;
139$permissiontodelete = 0;
154$hookmanager->initHooks(array(
'projecttaskscard',
'globalcard'));
159$permissiontoadd = $user->hasRight(
'projet',
'creer');
160$permissiontoeditextra = $permissiontoadd;
161if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
162 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
165$diroutputmassaction =
$conf->project->dir_output.
'/tasks/temp/massgeneration/'.$user->id;
169$billable = (
GETPOST(
'billable',
'aZ') ==
'yes' ? 1 : 0);
170$label =
GETPOST(
'label',
'alpha');
171$description =
GETPOST(
'description',
'restricthtml');
172$planned_workloadhour = (GETPOSTISSET(
'planned_workloadhour') ?
GETPOSTINT(
'planned_workloadhour') :
'');
173$planned_workloadmin = (GETPOSTISSET(
'planned_workloadmin') ?
GETPOSTINT(
'planned_workloadmin') :
'');
174if (GETPOSTISSET(
'planned_workloadhour') || GETPOSTISSET(
'planned_workloadmin')) {
175 $planned_workload = (int) $planned_workloadhour * 3600 + (
int) $planned_workloadmin * 60;
177 $planned_workload =
'';
182 't.ref' => array(
'label' =>
"RefTask",
'checked' =>
'1',
'position' => 1),
183 't.label' => array(
'label' =>
"LabelTask",
'checked' =>
'1',
'position' => 2),
184 't.description' => array(
'label' =>
"Description",
'checked' =>
'0',
'position' => 3),
185 't.dateo' => array(
'label' =>
"DateStart",
'checked' =>
'1',
'position' => 4),
186 't.datee' => array(
'label' =>
"Deadline",
'checked' =>
'1',
'position' => 5),
187 't.planned_workload' => array(
'label' =>
"PlannedWorkload",
'checked' =>
'1',
'position' => 6),
188 't.duration_effective' => array(
'label' =>
"TimeSpent",
'checked' =>
'1',
'position' => 7),
189 't.progress_calculated' => array(
'label' =>
"ProgressCalculated",
'checked' =>
'-1',
'position' => 8),
190 't.progress' => array(
'label' =>
"ProgressDeclared",
'checked' =>
'1',
'position' => 9),
191 't.progress_summary' => array(
'label' =>
"TaskProgressSummary",
'checked' =>
'1',
'position' => 10),
192 't.fk_statut' => array(
'label' =>
"Status",
'checked' =>
'1',
'position' => 11),
193 't.budget_amount' => array(
'label' =>
"Budget",
'checked' =>
'0',
'position' => 12),
194 'c.assigned' => array(
'label' =>
"TaskRessourceLinks",
'checked' =>
'1',
'position' => 13),
198 $arrayfields[
't.tobill'] = array(
'label' => $langs->trans(
"TimeToBill"),
'checked' =>
'0',
'position' => 11);
199 $arrayfields[
't.billed'] = array(
'label' => $langs->trans(
"TimeBilled"),
'checked' =>
'0',
'position' => 12);
200 $arrayfields[
't.billable'] = array(
'label' => $langs->trans(
"Billable"),
'checked' =>
'1',
'position' => 13);
204$extrafieldsobjectkey = $taskstatic->table_element;
205$extrafieldsobjectprefix =
'efpt.';
206include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
210$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
219 if (!empty($backtopageforcancel)) {
220 header(
"Location: ".$backtopageforcancel);
222 } elseif (!empty($backtopage)) {
223 header(
"Location: ".$backtopage);
229if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
233$parameters = array(
'id' => $id);
234$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
239if (empty($reshook)) {
240 if ($action ==
'update_extras' && ($id > 0 || !empty($ref)) && $permissiontoeditextra) {
242 $attribute_name =
GETPOST(
'attribute',
'aZ09');
243 $ret = $extrafields->setOptionalsFromPost(
null, $object, $attribute_name);
248 $result =
$object->updateExtraField($attribute_name,
'PROJECT_MODIFY');
255 $action =
'edit_extras';
260 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
263 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
264 $search_user_id =
"";
265 $search_taskref =
'';
266 $search_tasklabel =
'';
267 $search_dtstartday =
'';
268 $search_dtstartmonth =
'';
269 $search_dtstartyear =
'';
270 $search_dtendday =
'';
271 $search_dtendmonth =
'';
272 $search_dtendyear =
'';
273 $search_planedworkload =
'';
274 $search_timespend =
'';
275 $search_progresscalc =
'';
276 $search_progressdeclare =
'';
277 $search_task_budget_amount =
'';
278 $search_task_billable =
'';
281 $search_array_options = array();
282 $search_date_start_startmonth =
"";
283 $search_date_start_startyear =
"";
284 $search_date_start_startday =
"";
285 $search_date_start_start =
"";
286 $search_date_start_endmonth =
"";
287 $search_date_start_endyear =
"";
288 $search_date_start_endday =
"";
289 $search_date_start_end =
"";
290 $search_date_end_startmonth =
"";
291 $search_date_end_startyear =
"";
292 $search_date_end_startday =
"";
293 $search_date_end_start =
"";
294 $search_date_end_endmonth =
"";
295 $search_date_end_endyear =
"";
296 $search_date_end_endday =
"";
297 $search_date_end_end =
"";
301 $objectclass =
'Task';
302 $objectlabel =
'Tasks';
303 $permissiontoread = $user->hasRight(
'projet',
'lire');
304 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
305 $uploaddir =
$conf->project->dir_output.
'/tasks';
306 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
309$morewherefilterarray = array();
311if (!empty($search_taskref)) {
312 $morewherefilterarray[] =
natural_search(
't.ref', $search_taskref, 0, 1);
315if (!empty($search_tasklabel)) {
316 $morewherefilterarray[] =
natural_search(
't.label', $search_tasklabel, 0, 1);
319$moresql =
dolSqlDateFilter(
't.dateo', $search_dtstartday, $search_dtstartmonth, $search_dtstartyear, 1);
321 $morewherefilterarray[] = $moresql;
324$moresql =
dolSqlDateFilter(
't.datee', $search_dtendday, $search_dtendmonth, $search_dtendyear, 1);
326 $morewherefilterarray[] = $moresql;
329if ($search_date_start_start) {
330 $morewherefilterarray[] =
" t.dateo >= '".$db->idate($search_date_start_start).
"'";
332if ($search_date_start_end) {
333 $morewherefilterarray[] =
" t.dateo <= '".$db->idate($search_date_start_end).
"'";
336if ($search_date_end_start) {
337 $morewherefilterarray[] =
" t.datee >= '".$db->idate($search_date_end_start).
"'";
339if ($search_date_end_end) {
340 $morewherefilterarray[] =
" t.datee <= '".$db->idate($search_date_end_end).
"'";
343if (!empty($search_planedworkload)) {
344 $morewherefilterarray[] =
natural_search(
't.planned_workload', $search_planedworkload, 1, 1);
347if (!empty($search_timespend)) {
348 $morewherefilterarray[] =
natural_search(
't.duration_effective', $search_timespend, 1, 1);
351if (!empty($search_progressdeclare)) {
352 $morewherefilterarray[] =
natural_search(
't.progress', $search_progressdeclare, 1, 1);
354if (!empty($search_progresscalc)) {
355 $morewherefilterarray[] =
'(planned_workload IS NULL OR planned_workload = 0 OR '.natural_search(
'ROUND(100 * duration_effective / planned_workload, 2)', $search_progresscalc, 1, 1).
')';
358if ($search_status > -1 && $search_status !=
'') {
359 $morewherefilterarray[] =
" t.fk_statut = ".((int) $search_status);
361if ($search_task_budget_amount) {
362 $morewherefilterarray[] =
natural_search(
't.budget_amount', $search_task_budget_amount, 1, 1);
364if ($search_task_billable && $search_task_billable !=
'-1') {
365 $morewherefilterarray[] =
" t.billable = ".($search_task_billable ==
"yes" ? 1 : 0);
369$morewherefilter =
'';
370if (count($morewherefilterarray) > 0) {
371 $morewherefilter =
' AND '.implode(
' AND ', $morewherefilterarray);
374if ($action ==
'createtask' && $user->hasRight(
'projet',
'creer')) {
380 if (empty($taskref)) {
381 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
386 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
389 } elseif (!
GETPOST(
'task_parent')) {
390 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ChildOfProjectTask")),
null,
'errors');
396 $tmparray = explode(
'_',
GETPOST(
'task_parent'));
397 $projectid = empty($tmparray[0]) ?
$id : (int) $tmparray[0];
398 $task_parent = empty($tmparray[1]) ? 0 : $tmparray[1];
402 $task->fk_project = $projectid;
403 $task->entity =
$object->entity;
404 $task->ref = $taskref;
405 $task->label = $label;
406 $task->description = $description;
407 $task->planned_workload = $planned_workload;
408 $task->fk_task_parent = $task_parent;
411 $task->date_end = $date_end;
412 $task->progress = $progress;
413 $task->budget_amount = $budget_amount;
414 $task->billable = $billable;
418 $ret = $extrafields->setOptionalsFromPost(
null, $task);
420 $taskid = $task->create($user);
428 $contactlist = array();
429 foreach (array(
'internal',
'external') as $source) {
430 $contactlist = array_merge($contactlist,
$object->liste_contact(-1, $source));
432 foreach ($contactlist as $key => $contact) {
433 $result = $task->add_contact(((
int) $contact[
"id"]), ($contact[
"code"] ==
"PROJECTLEADER" ?
'TASKEXECUTIVE' :
"TASKCONTRIBUTOR"), $contact[
"source"]);
436 $result = $task->add_contact(
GETPOSTINT(
"userid"),
'TASKEXECUTIVE',
'internal');
439 if (
$db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
440 $langs->load(
"projects");
442 $duplicate_code_error =
true;
452 if (!empty($backtopage)) {
453 header(
"Location: ".$backtopage);
455 } elseif (empty($projectid)) {
456 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks/list.php'.(empty($mode) ?
'' :
'?mode='.$mode));
462 if (!empty($backtopage)) {
463 header(
"Location: ".$backtopage);
465 } elseif (empty($id)) {
467 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks/list.php'.(empty($mode) ?
'' :
'?mode='.$mode));
485$title = $langs->trans(
"Tasks").
' - '.
$object->ref.
' '.
$object->name;
487 $title =
$object->ref.
' '.
$object->name.
' - '.$langs->trans(
"Tasks");
489if ($action ==
'create') {
490 $title = $langs->trans(
"NewTask");
492$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
494llxHeader(
"", $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-project page-card_tasks');
496$arrayofselected = is_array($toselect) ? $toselect : array();
499$massactionbutton =
'';
501if ($id > 0 || !empty($ref)) {
502 $result =
$object->fetch($id, $ref);
506 $result =
$object->fetch_thirdparty();
510 $result =
$object->fetch_optionals();
518 $userWrite =
$object->restrictedProjectArea($user,
'write');
523 $tab = (GETPOSTISSET(
'tab') ?
GETPOST(
'tab') :
'tasks');
528 $param =
'&id='.$object->id;
529 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
530 $param .=
'&contextpage='.urlencode($contextpage);
532 if ($search_user_id) {
533 $param .=
'&search_user_id='.urlencode((
string) ($search_user_id));
535 if ($search_taskref) {
536 $param .=
'&search_taskref='.urlencode($search_taskref);
538 if ($search_tasklabel) {
539 $param .=
'&search_tasklabel='.urlencode($search_tasklabel);
541 if ($search_taskdescription) {
542 $param .=
'&search_taskdescription='.urlencode($search_taskdescription);
544 if ($search_dtstartday) {
545 $param .=
'&search_dtstartday='.urlencode($search_dtstartday);
547 if ($search_dtstartmonth) {
548 $param .=
'&search_dtstartmonth='.urlencode($search_dtstartmonth);
550 if ($search_dtstartyear) {
551 $param .=
'&search_dtstartyear='.urlencode($search_dtstartyear);
553 if ($search_dtendday) {
554 $param .=
'&search_dtendday='.urlencode($search_dtendday);
556 if ($search_dtendmonth) {
557 $param .=
'&search_dtendmonth='.urlencode($search_dtendmonth);
559 if ($search_dtendyear) {
560 $param .=
'&search_dtendyear='.urlencode($search_dtendyear);
562 if ($search_date_start_startmonth) {
563 $param .=
'&search_date_start_startmonth='.urlencode((
string) ($search_date_start_startmonth));
565 if ($search_date_start_startyear) {
566 $param .=
'&search_date_start_startyear='.urlencode((
string) ($search_date_start_startyear));
568 if ($search_date_start_startday) {
569 $param .=
'&search_date_start_startday='.urlencode((
string) ($search_date_start_startday));
571 if ($search_date_start_start) {
572 $param .=
'&search_date_start_start='.urlencode((
string) $search_date_start_start);
574 if ($search_date_start_endmonth) {
575 $param .=
'&search_date_start_endmonth='.urlencode((
string) ($search_date_start_endmonth));
577 if ($search_date_start_endyear) {
578 $param .=
'&search_date_start_endyear='.urlencode((
string) ($search_date_start_endyear));
580 if ($search_date_start_endday) {
581 $param .=
'&search_date_start_endday='.urlencode((
string) ($search_date_start_endday));
583 if ($search_date_start_end) {
584 $param .=
'&search_date_start_end='.urlencode((
string) $search_date_start_end);
586 if ($search_date_end_startmonth) {
587 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
589 if ($search_date_end_startyear) {
590 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
592 if ($search_date_end_startday) {
593 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
595 if ($search_date_end_start) {
596 $param .=
'&search_date_end_start='.urlencode((
string) $search_date_end_start);
598 if ($search_date_end_endmonth) {
599 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
601 if ($search_date_end_endyear) {
602 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
604 if ($search_date_end_endday) {
605 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
607 if ($search_date_end_end) {
608 $param .=
'&search_date_end_end=' . urlencode((
string) $search_date_end_end);
610 if ($search_planedworkload) {
611 $param .=
'&search_planedworkload='.urlencode($search_planedworkload);
613 if ($search_timespend) {
614 $param .=
'&search_timespend='.urlencode($search_timespend);
616 if ($search_progresscalc) {
617 $param .=
'&search_progresscalc='.urlencode($search_progresscalc);
619 if ($search_progressdeclare) {
620 $param .=
'&search_progressdeclare='.urlencode($search_progressdeclare);
622 if ($search_status) {
623 $param .=
'&search_status='.urlencode((
string) ($search_status));
625 if ($search_task_budget_amount) {
626 $param .=
'&search_task_budget_amount='.urlencode($search_task_budget_amount);
628 if ($search_task_billable) {
629 $param .=
'&search_task_billable='.urlencode($search_task_billable);
631 if ($optioncss !=
'') {
632 $param .=
'&optioncss='.urlencode($optioncss);
635 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
637 $arrayofmassactions = array();
638 if ($user->hasRight(
'projet',
'creer')) {
639 $arrayofmassactions[
'preclonetasks'] =
img_picto(
'',
'clone',
'class="pictofixedwidth"').$langs->trans(
"Clone");
641 if ($permissiontodelete) {
642 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
644 if (in_array($massaction, array(
'presend',
'predelete'))) {
645 $arrayofmassactions = array();
647 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions) ??
'';
651 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
652 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
653 $tmpurl = preg_replace(
'/__SOCID__/', (
string)
$object->socid, $tmpurl);
654 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
656 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
659 $morehtmlref =
'<div class="refidno">';
661 $morehtmlref .=
$object->title;
663 if (!empty(
$object->thirdparty->id) &&
$object->thirdparty->id > 0) {
664 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
666 $morehtmlref .=
'</div>';
669 if (!$user->hasRight(
'projet',
'all',
'lire')) {
670 $objectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 0);
671 $object->next_prev_filter =
"rowid:IN:".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0');
674 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
676 print
'<div class="fichecenter">';
677 print
'<div class="fichehalfleft">';
678 print
'<div class="underbanner clearboth"></div>';
680 print
'<table class="border tableforfield centpercent">';
684 print
'<tr><td class="tdtop">';
685 print $langs->trans(
"Usage");
689 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
690 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
691 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
695 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_task ?
' checked="checked"' :
'')).
'"> ';
696 $htmltext = $langs->trans(
"ProjectFollowTasks");
697 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
701 print
'<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET(
'usage_bill_time') ? (
GETPOST(
'usage_bill_time',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_bill_time ?
' checked="checked"' :
'')).
'"> ';
702 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
703 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
707 print
'<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET(
'usage_organize_event') ? (
GETPOST(
'usage_organize_event',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_organize_event ?
' checked="checked"' :
'')).
'"> ';
708 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
709 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
715 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
716 if (!is_null(
$object->budget_amount) && strcmp(
$object->budget_amount,
'')) {
717 print
'<span class="amount">'.price(
$object->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency).
'</span>';
722 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
724 print($start ? $start :
'?');
727 print($end ? $end :
'?');
734 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
736 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
737 print $langs->trans(
'SharedProject');
739 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
740 print $langs->trans(
'PrivateProject');
746 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
751 print
'<div class="fichehalfright">';
752 print
'<div class="underbanner clearboth"></div>';
754 print
'<table class="border tableforfield centpercent">';
758 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
759 print $form->showCategories(
$object->id, Categorie::TYPE_PROJECT, 1);
764 print
'<tr><td class="titlefield'.($object->description ?
' noborderbottom' :
'').
'" colspan="2">'.$langs->trans(
"Description").
'</td></tr>';
766 print
'<tr><td class="nottitleforfield" colspan="2">';
767 print
'<div class="longmessagecut">';
778 print
'<div class="clearboth"></div>';
785if ($action ==
'create' && $user->hasRight(
'projet',
'creer') && (empty(
$object->thirdparty->id) || $userWrite > 0)) {
786 if ($id > 0 || !empty($ref)) {
792 $projectoktoentertime = 1;
794 $projectoktoentertime = 0;
795 print
'<div class="warning">';
796 $langs->load(
"errors");
797 print $langs->trans(
"WarningProjectClosed");
802 $projectoktoentertime = 0;
803 print
'<div class="warning">';
804 $langs->load(
"errors");
805 print $langs->trans(
"WarningProjectDraft");
809 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
810 print
'<input type="hidden" name="token" value="'.newToken().
'">';
811 print
'<input type="hidden" name="action" value="createtask">';
812 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
814 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
819 print
'<div class="div-table-responsive-no-min">';
820 print
'<table class="border centpercent">';
825 require_once DOL_DOCUMENT_ROOT.
"/core/modules/project/task/" .
getDolGlobalString(
'PROJECT_TASK_ADDON').
'.php';
826 $modTask =
new $classnamemodtask();
827 '@phan-var-force ModeleNumRefTask $modTask';
828 $defaultref = $modTask->getNextValue(
$object->thirdparty, $object);
831 if (is_numeric($defaultref) && $defaultref <= 0) {
836 print
'<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans(
"Ref").
'</span></td><td>';
837 if (empty($duplicate_code_error)) {
838 print(GETPOSTISSET(
"ref") ?
GETPOST(
"ref",
'alpha') : $defaultref);
842 print
'<input type="hidden" name="taskref" value="'.(GETPOSTISSET(
"ref") ?
GETPOST(
"ref",
'alpha') : $defaultref).
'">';
846 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td><td>';
847 print
'<input type="text" name="label" autofocus class="minwidth500" value="'.$label.
'">';
851 print
'<tr><td class="fieldrequired">'.$langs->trans(
"ChildOfProjectTask").
'</td><td>';
852 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
853 if ($projectoktoentertime) {
854 $formother->selectProjectTasks(
GETPOSTINT(
'task_parent'), empty($projectid) ?
$object->id : $projectid,
'task_parent', 0, 0, 1, 1, 0,
'0,1',
'maxwidth500 widthcentpercentminusxx');
856 $formother->selectProjectTasks(
GETPOSTINT(
'task_parent'), empty($projectid) ?
$object->id : $projectid,
'task_parent', 0, 0, 1, 1, 0,
'',
'maxwidth500 widthcentpercentminusxx');
860 $contactsofproject = (empty(
$object->id) ?
'' :
$object->getListContactId(
'internal'));
863 print
'<tr><td>'.$langs->trans(
"AffectedTo").
'</td><td>';
864 print
img_picto(
'',
'user',
'class="pictofixedwidth"');
865 if (is_array($contactsofproject) && count($contactsofproject)) {
866 print $form->select_dolusers(
'-4',
'userid', 0,
null, 0,
'', $contactsofproject,
'0', 0, 0,
'(statut:=:1)', 4,
'',
'maxwidth500 widthcentpercentminusx');
868 if ((isset($projectid) && $projectid > 0) ||
$object->id > 0) {
869 print
'<span class="opacitymedium">'.$langs->trans(
"NoUserAssignedToTheProject").
'</span>';
871 print $form->select_dolusers(
'-4',
'userid', 0,
null, 0,
'',
'',
'0', 0, 0,
'(statut:=:1)', 4,
'',
'maxwidth500 widthcentpercentminusx');
877 print
'<tr><td>'.$langs->trans(
"Billable").
'</td><td>';
878 print $form->selectyesno(
'billable');
882 print
'<tr><td>'.$langs->trans(
"DateStart").
'</td><td>';
883 print
img_picto(
'',
'action',
'class="pictofixedwidth"');
888 print
'<tr><td>'.$langs->trans(
"DateEnd").
'</td><td>';
889 print
img_picto(
'',
'action',
'class="pictofixedwidth"');
890 print $form->selectDate((!empty($date_end) ? $date_end : -1),
'date_end', -1, 1, 0,
'', 1, 1);
894 print
'<tr><td>'.$langs->trans(
"PlannedWorkload").
'</td><td>';
895 print
img_picto(
'',
'clock',
'class="pictofixedwidth"');
896 print $form->select_duration(
'planned_workload', $planned_workload, 0,
'text');
900 print
'<tr><td>'.$langs->trans(
"ProgressDeclared").
'</td><td colspan="3">';
901 print
img_picto(
'',
'fa-percent',
'class="pictofixedwidth"');
902 print $formother->select_percent($progress,
'progress', 0, 5, 0, 100, 1);
906 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
910 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
915 $doleditor =
new DolEditor(
'description',
$object->description,
'', 80,
'dolibarr_details',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), $nbrows,
'90%');
916 print $doleditor->Create();
920 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
921 print
img_picto(
'',
'currency',
'class="pictofixedwidth"');
922 print
'<input size="8" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
'').
'"></td>';
926 $parameters = array(
'arrayfields' => &$arrayfields);
927 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $taskstatic, $action);
928 print $hookmanager->resPrint;
930 if (empty($reshook) && !empty($extrafields->attributes[$taskstatic->table_element][
'label'])) {
931 print $taskstatic->showOptionals($extrafields,
'edit');
939 print $form->buttonsSaveCancel(
"Add");
942} elseif ($id > 0 || !empty($ref)) {
943 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
950 $linktocreatetaskParam = array();
951 $linktocreatetaskUserRight =
false;
952 if ($user->hasRight(
'projet',
'all',
'creer') || $user->hasRight(
'projet',
'creer')) {
953 if (
$object->public || $userWrite > 0) {
954 $linktocreatetaskUserRight =
true;
956 $linktocreatetaskParam[
'attr'][
'title'] = $langs->trans(
"NotOwnerOfProject");
960 $linktocreatetask =
dolGetButtonTitle($langs->trans(
'AddTask'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/projet/tasks.php?action=create'.$param.
'&backtopage='.urlencode($_SERVER[
'PHP_SELF'].
'?id='.
$object->id),
'', (
int) $linktocreatetaskUserRight, $linktocreatetaskParam);
962 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'">';
963 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
964 print
'<input type="hidden" name="token" value="'.newToken().
'">';
965 print
'<input type="hidden" name="action" value="list">';
966 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
967 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
968 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
969 print
'<input type="hidden" name="page" value="'.$page.
'">';
970 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
972 $title = $langs->trans(
"ListOfTasks");
973 $linktotasks =
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/projet/tasks.php?id='.
$object->id,
'', 1, array(
'morecss' =>
'reposition btnTitleSelected'));
974 $linktotasks .=
dolGetButtonTitle($langs->trans(
'ViewGantt'),
'',
'fa fa-stream imgforviewmode', DOL_URL_ROOT.
'/projet/ganttview.php?id='.
$object->id.
'&withproject=1',
'', 1, array(
'morecss' =>
'reposition marginleftonly'));
977 print
load_fiche_titre($title, $linktotasks.
' '.$linktocreatetask,
'projecttask', 0,
'',
'', $massactionbutton);
980 $trackid =
'task'.$taskstatic->id;
981 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
985 $filteronthirdpartyid = $socid;
986 $tasksarray = $taskstatic->getTasksArray(
null,
null,
$object->id, $filteronthirdpartyid, 0,
'',
'-1', $morewherefilter, 0, 0, $extrafields, 1, $search_array_options, 1, 1, $sortfield, $sortorder);
990 if ($search_user_id > 0) {
991 $tmpuser->fetch($search_user_id);
994 $tasksrole = ($tmpuser->id > 0 ? $taskstatic->getUserRolesForProjectsOrTasks(
null, $tmpuser, (
string)
$object->id, 0) :
'');
998 if (!empty(
$conf->use_javascript_ajax)) {
999 include DOL_DOCUMENT_ROOT.
'/core/tpl/ajaxrow.tpl.php';
1003 $moreforfilter =
'';
1004 $moreforfilter .=
'<div class="divsearchfield">';
1005 $moreforfilter .=
img_picto(
'',
'user',
'class="pictofixedwidth"');
1006 $moreforfilter .= $form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id :
'',
'search_user_id', $langs->trans(
"TasksAssignedTo"), null, 0,
'',
'');
1007 $moreforfilter .=
'</div>';
1008 if ($moreforfilter) {
1009 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1010 print $moreforfilter;
1015 if (!empty($massactionbutton) && $contextpage !=
'poslist') {
1016 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
1019 print
'<div class="div-table-responsive">';
1020 print
'<table id="tablelines" class="tagtable nobottom liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">';
1023 print
'<tr class="liste_titre_filter">';
1026 if (
$conf->main_checkbox_left_column) {
1027 print
'<td class="liste_titre maxwidthsearch">';
1028 $searchpicto = $form->showFilterButtons();
1033 if (!empty($arrayfields[
't.ref'][
'checked'])) {
1034 print
'<td class="liste_titre">';
1035 print
'<input class="flat searchstring maxwidth50" type="text" name="search_taskref" value="'.dol_escape_htmltag($search_taskref).
'">';
1039 if (!empty($arrayfields[
't.label'][
'checked'])) {
1040 print
'<td class="liste_titre">';
1041 print
'<input class="flat searchstring maxwidth100" type="text" name="search_tasklabel" value="'.dol_escape_htmltag($search_tasklabel).
'">';
1045 if (!empty($arrayfields[
't.description'][
'checked'])) {
1046 print
'<td class="liste_titre">';
1047 print
'<input class="flat searchstring maxwidth100" type="text" name="search_taskdescription" value="'.dol_escape_htmltag($search_taskdescription).
'">';
1051 if (!empty($arrayfields[
't.dateo'][
'checked'])) {
1052 print
'<td class="liste_titre center">';
1056 print
'<div class="nowrapfordate">';
1057 print $form->selectDate($search_date_start_start ? $search_date_start_start : -1,
'search_date_start_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1059 print
'<div class="nowrapfordate">';
1060 print $form->selectDate($search_date_start_end ? $search_date_start_end : -1,
'search_date_start_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1065 if (!empty($arrayfields[
't.datee'][
'checked'])) {
1066 print
'<td class="liste_titre center">';
1070 print
'<div class="nowrapfordate">';
1071 print $form->selectDate($search_date_end_start ? $search_date_end_start : -1,
'search_date_end_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1073 print
'<div class="nowrapfordate">';
1074 print $form->selectDate($search_date_end_end ? $search_date_end_end : -1,
'search_date_end_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1079 if (!empty($arrayfields[
't.planned_workload'][
'checked'])) {
1080 print
'<td class="liste_titre right">';
1081 print
'<input class="flat" type="text" size="4" name="search_planedworkload" value="'.$search_planedworkload.
'">';
1085 if (!empty($arrayfields[
't.duration_effective'][
'checked'])) {
1086 print
'<td class="liste_titre right">';
1087 print
'<input class="flat" type="text" size="4" name="search_timespend" value="'.$search_timespend.
'">';
1091 if (!empty($arrayfields[
't.progress_calculated'][
'checked'])) {
1092 print
'<td class="liste_titre right">';
1093 print
'<input class="flat" type="text" size="4" name="search_progresscalc" value="'.$search_progresscalc.
'">';
1097 if (!empty($arrayfields[
't.progress'][
'checked'])) {
1098 print
'<td class="liste_titre right">';
1099 print
'<input class="flat" type="text" size="4" name="search_progressdeclare" value="'.$search_progressdeclare.
'">';
1104 if (!empty($arrayfields[
't.progress_summary'][
'checked'])) {
1105 print
'<td class="liste_titre right"></td>';
1108 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
1109 print
'<td class="liste_titre center">';
1110 $arrayofstatus = array();
1111 foreach ($taskstatic->labelStatusShort as $key => $val) {
1112 $arrayofstatus[$key] = $langs->trans($val);
1114 print $form->selectarray(
'search_status', $arrayofstatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth100');
1118 if (
$object->usage_bill_time) {
1119 if (!empty($arrayfields[
't.tobill'][
'checked'])) {
1120 print
'<td class="liste_titre right">';
1124 if (!empty($arrayfields[
't.billed'][
'checked'])) {
1125 print
'<td class="liste_titre right">';
1130 if (!empty($arrayfields[
't.budget_amount'][
'checked'])) {
1131 print
'<td class="liste_titre center">';
1132 print
'<input type="text" class="flat" name="search_task_budget_amount" value="'.$search_task_budget_amount.
'" size="4">';
1136 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1137 print
'<td class="liste_titre right">';
1141 if (!empty($arrayfields[
't.billable'][
'checked'])) {
1142 print
'<td class="liste_titre center">';
1143 print $form->selectyesno(
'search_task_billable', $search_task_billable, 0,
false, 1);
1147 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1150 $parameters = array(
'arrayfields' => $arrayfields);
1151 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1152 print $hookmanager->resPrint;
1154 print
'<td class="liste_titre maxwidthsearch"> </td>';
1157 if (!
$conf->main_checkbox_left_column) {
1158 print
'<td class="liste_titre maxwidthsearch">';
1159 $searchpicto = $form->showFilterButtons();
1166 print
'<tr class="liste_titre nodrag nodrop">';
1168 if (
$conf->main_checkbox_left_column) {
1169 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1172 if (!empty($arrayfields[
't.ref'][
'checked'])) {
1174 print_liste_field_titre($arrayfields[
't.ref'][
'label'], $_SERVER[
"PHP_SELF"],
't.ref',
'', $param,
'', $sortfield, $sortorder,
'');
1176 if (!empty($arrayfields[
't.label'][
'checked'])) {
1177 print_liste_field_titre($arrayfields[
't.label'][
'label'], $_SERVER[
"PHP_SELF"],
"t.label",
'', $param,
'', $sortfield, $sortorder,
'');
1179 if (!empty($arrayfields[
't.description'][
'checked'])) {
1180 print_liste_field_titre($arrayfields[
't.description'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'');
1182 if (!empty($arrayfields[
't.dateo'][
'checked'])) {
1183 print_liste_field_titre($arrayfields[
't.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"t.dateo",
'', $param,
'', $sortfield, $sortorder,
'center ');
1185 if (!empty($arrayfields[
't.datee'][
'checked'])) {
1186 print_liste_field_titre($arrayfields[
't.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"t.datee",
'', $param,
'', $sortfield, $sortorder,
'center ');
1188 if (!empty($arrayfields[
't.planned_workload'][
'checked'])) {
1189 print_liste_field_titre($arrayfields[
't.planned_workload'][
'label'], $_SERVER[
"PHP_SELF"],
"t.planned_workload",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1191 if (!empty($arrayfields[
't.duration_effective'][
'checked'])) {
1192 print_liste_field_titre($arrayfields[
't.duration_effective'][
'label'], $_SERVER[
"PHP_SELF"],
"t.duration_effective",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1194 if (!empty($arrayfields[
't.progress_calculated'][
'checked'])) {
1195 print_liste_field_titre($arrayfields[
't.progress_calculated'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1197 if (!empty($arrayfields[
't.progress'][
'checked'])) {
1198 print_liste_field_titre($arrayfields[
't.progress'][
'label'], $_SERVER[
"PHP_SELF"],
"t.progress",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1200 if (!empty($arrayfields[
't.progress_summary'][
'checked'])) {
1201 print_liste_field_titre($arrayfields[
't.progress_summary'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'', 1);
1203 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
1204 print_liste_field_titre($arrayfields[
't.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1206 if (
$object->usage_bill_time) {
1207 if (!empty($arrayfields[
't.tobill'][
'checked'])) {
1208 print_liste_field_titre($arrayfields[
't.tobill'][
'label'], $_SERVER[
"PHP_SELF"],
"t.tobill",
'', $param,
'', $sortfield, $sortorder,
'right ');
1210 if (!empty($arrayfields[
't.billed'][
'checked'])) {
1211 print_liste_field_titre($arrayfields[
't.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"t.billed",
'', $param,
'', $sortfield, $sortorder,
'right ');
1215 if (!empty($arrayfields[
't.budget_amount'][
'checked'])) {
1216 print_liste_field_titre($arrayfields[
't.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
"t.budget_amount",
"", $param,
'', $sortfield, $sortorder,
'center ');
1219 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1220 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1223 if (!empty($arrayfields[
't.billable'][
'checked'])) {
1224 print_liste_field_titre($arrayfields[
't.billable'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1228 $disablesortlink = 1;
1229 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1231 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1232 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1233 print $hookmanager->resPrint;
1236 if (!
$conf->main_checkbox_left_column) {
1237 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1242 if (count($tasksarray) > 0) {
1246 $nboftaskshown = projectLinesa($j, 0, $tasksarray, $level,
'', 0, $tasksrole, (
string)
$object->id, 1,
$object->id,
'', (
$object->usage_bill_time ? 1 : 0), $arrayfields, $arrayofselected);
1248 $colspan = count($arrayfields);
1249 if (
$object->usage_bill_time) {
1252 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoTasks").
'</span></td></tr>';
1263 if ($user->hasRight(
'projet',
'all',
'lire')) {
1264 if ($search_user_id == $user->id) {
1265 if ($nboftaskshown < count($tasksrole)) {
1266 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1270 if ($nboftaskshown < count($tasksarray) && !
GETPOSTINT(
'search_user_id')) {
1271 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage a WYSIWYG editor.
Class to manage projects.
const STATUS_CLOSED
Closed status.
const STATUS_DRAFT
Draft status.
Class to manage third parties objects (customers, suppliers, prospects...)
const STATUS_VALIDATED
Validated status (To do).
Class to manage Dolibarr users.
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0, $gm=false)
Generate a SQL string to make a filter into a range (for second of date until last second of date).
$date_start
Variables from include:
cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent)
Clean corrupted database tree (orphelins linked to a not existing parent), record linked to themself,...
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
GETPOSTFLOAT($paramname, $rounding='', $option=2)
Return the value of a $_GET or $_POST supervariable, converted into float.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
project_prepare_head(Project $project, $moreparam='')
Prepare array with list of tabs.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.