26 require
"../main.inc.php";
27 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
39 $langsLoad=array(
'projects',
'users',
'companies');
41 $langsLoad[]=
'eventorganization';
44 $langs->loadLangs($langsLoad);
46 $action =
GETPOST(
'action',
'aZ09');
47 $massaction =
GETPOST(
'massaction',
'alpha');
48 $show_files =
GETPOST(
'show_files',
'int');
49 $confirm =
GETPOST(
'confirm',
'alpha');
50 $toselect =
GETPOST(
'toselect',
'array');
54 $taskref =
GETPOST(
'taskref',
'alpha');
57 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
58 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
59 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
61 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
64 $offset = $limit * $page;
65 $pageprev = $page - 1;
66 $pagenext = $page + 1;
68 $backtopage =
GETPOST(
'backtopage',
'alpha');
69 $cancel =
GETPOST(
'cancel',
'alpha');
71 $search_user_id =
GETPOST(
'search_user_id',
'int');
72 $search_taskref =
GETPOST(
'search_taskref');
73 $search_tasklabel =
GETPOST(
'search_tasklabel');
74 $search_taskdescription =
GETPOST(
'search_taskdescription');
75 $search_dtstartday =
GETPOST(
'search_dtstartday');
76 $search_dtstartmonth =
GETPOST(
'search_dtstartmonth');
77 $search_dtstartyear =
GETPOST(
'search_dtstartyear');
78 $search_dtendday =
GETPOST(
'search_dtendday');
79 $search_dtendmonth =
GETPOST(
'search_dtendmonth');
80 $search_dtendyear =
GETPOST(
'search_dtendyear');
81 $search_planedworkload =
GETPOST(
'search_planedworkload');
82 $search_timespend =
GETPOST(
'search_timespend');
83 $search_progresscalc =
GETPOST(
'search_progresscalc');
84 $search_progressdeclare =
GETPOST(
'search_progressdeclare');
85 $search_task_budget_amount =
GETPOST(
'search_task_budget_amount');
87 $search_date_start_startmonth =
GETPOST(
'search_date_start_startmonth',
'int');
88 $search_date_start_startyear =
GETPOST(
'search_date_start_startyear',
'int');
89 $search_date_start_startday =
GETPOST(
'search_date_start_startday',
'int');
90 $search_date_start_start =
dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear);
91 $search_date_start_endmonth =
GETPOST(
'search_date_start_endmonth',
'int');
92 $search_date_start_endyear =
GETPOST(
'search_date_start_endyear',
'int');
93 $search_date_start_endday =
GETPOST(
'search_date_start_endday',
'int');
94 $search_date_start_end =
dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);
96 $search_date_end_startmonth =
GETPOST(
'search_date_end_startmonth',
'int');
97 $search_date_end_startyear =
GETPOST(
'search_date_end_startyear',
'int');
98 $search_date_end_startday =
GETPOST(
'search_date_end_startday',
'int');
99 $search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
100 $search_date_end_endmonth =
GETPOST(
'search_date_end_endmonth',
'int');
101 $search_date_end_endyear =
GETPOST(
'search_date_end_endyear',
'int');
102 $search_date_end_endday =
GETPOST(
'search_date_end_endday',
'int');
103 $search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
105 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'projecttasklist';
106 $optioncss =
GETPOST(
'optioncss',
'aZ');
110 $taskstatic =
new Task($db);
113 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
114 if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object,
'fetchComments') && empty($object->comments)) {
115 $object->fetchComments();
118 if ($id > 0 || !empty($ref)) {
120 $extrafields->fetch_name_optionals_label($object->table_element);
122 $extrafields->fetch_name_optionals_label($taskstatic->table_element);
123 $search_array_options = $extrafields->getOptionalsFromPost($taskstatic->table_element,
'',
'search_');
140 $diroutputmassaction = $conf->project->dir_output.
'/tasks/temp/massgeneration/'.$user->id;
143 $hookmanager->initHooks(array(
'projecttaskscard',
'globalcard'));
145 $progress =
GETPOST(
'progress',
'int');
146 $budget_amount =
GETPOST(
'budget_amount',
'int');
147 $label =
GETPOST(
'label',
'alpha');
148 $description =
GETPOST(
'description',
'restricthtml');
149 $planned_workloadhour = (
GETPOST(
'planned_workloadhour',
'int') ?
GETPOST(
'planned_workloadhour',
'int') : 0);
150 $planned_workloadmin = (
GETPOST(
'planned_workloadmin',
'int') ?
GETPOST(
'planned_workloadmin',
'int') : 0);
151 $planned_workload = $planned_workloadhour * 3600 + $planned_workloadmin * 60;
154 $arrayfields = array(
155 't.ref'=>array(
'label'=>
"RefTask",
'checked'=>1,
'position'=>1),
156 't.label'=>array(
'label'=>
"LabelTask",
'checked'=>1,
'position'=>2),
157 't.description'=>array(
'label'=>
"Description",
'checked'=>0,
'position'=>3),
158 't.dateo'=>array(
'label'=>
"DateStart",
'checked'=>1,
'position'=>4),
159 't.datee'=>array(
'label'=>
"Deadline",
'checked'=>1,
'position'=>5),
160 't.planned_workload'=>array(
'label'=>
"PlannedWorkload",
'checked'=>1,
'position'=>6),
161 't.duration_effective'=>array(
'label'=>
"TimeSpent",
'checked'=>1,
'position'=>7),
162 't.progress_calculated'=>array(
'label'=>
"ProgressCalculated",
'checked'=>1,
'position'=>8),
163 't.progress'=>array(
'label'=>
"ProgressDeclared",
'checked'=>1,
'position'=>9),
164 't.progress_summary'=>array(
'label'=>
"TaskProgressSummary",
'checked'=>1,
'position'=>10),
165 't.budget_amount'=>array(
'label'=>
"Budget",
'checked'=>0,
'position'=>11),
166 'c.assigned'=>array(
'label'=>
"TaskRessourceLinks",
'checked'=>1,
'position'=>12),
168 if ($object->usage_bill_time) {
169 $arrayfields[
't.tobill'] = array(
'label'=>$langs->trans(
"TimeToBill"),
'checked'=>0,
'position'=>11);
170 $arrayfields[
't.billed'] = array(
'label'=>$langs->trans(
"TimeBilled"),
'checked'=>0,
'position'=>12);
174 $extrafieldsobjectkey = $taskstatic->table_element;
175 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
179 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
186 $parameters = array(
'id'=>$id);
187 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
192 if (empty($reshook)) {
194 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
197 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
198 $search_user_id =
"";
199 $search_taskref =
'';
200 $search_tasklabel =
'';
201 $search_dtstartday =
'';
202 $search_dtstartmonth =
'';
203 $search_dtstartyear =
'';
204 $search_dtendday =
'';
205 $search_dtendmonth =
'';
206 $search_dtendyear =
'';
207 $search_planedworkload =
'';
208 $search_timespend =
'';
209 $search_progresscalc =
'';
210 $search_progressdeclare =
'';
211 $search_task_budget_amount =
'';
213 $search_array_options = array();
214 $search_date_start_startmonth =
"";
215 $search_date_start_startyear =
"";
216 $search_date_start_startday =
"";
217 $search_date_start_start =
"";
218 $search_date_start_endmonth =
"";
219 $search_date_start_endyear =
"";
220 $search_date_start_endday =
"";
221 $search_date_start_end =
"";
222 $search_date_end_startmonth =
"";
223 $search_date_end_startyear =
"";
224 $search_date_end_startday =
"";
225 $search_date_end_start =
"";
226 $search_date_end_endmonth =
"";
227 $search_date_end_endyear =
"";
228 $search_date_end_endday =
"";
229 $search_date_end_end =
"";
233 $objectclass =
'Task';
234 $objectlabel =
'Tasks';
235 $permissiontoread = $user->rights->projet->lire;
236 $permissiontodelete = $user->rights->projet->supprimer;
237 $uploaddir = $conf->project->dir_output.
'/tasks';
238 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
241 $morewherefilterarray = array();
243 if (!empty($search_taskref)) {
244 $morewherefilterarray[] =
natural_search(
't.ref', $search_taskref, 0, 1);
247 if (!empty($search_tasklabel)) {
248 $morewherefilterarray[] =
natural_search(
't.label', $search_tasklabel, 0, 1);
251 $moresql =
dolSqlDateFilter(
't.dateo', $search_dtstartday, $search_dtstartmonth, $search_dtstartyear, 1);
253 $morewherefilterarray[] = $moresql;
256 $moresql =
dolSqlDateFilter(
't.datee', $search_dtendday, $search_dtendmonth, $search_dtendyear, 1);
258 $morewherefilterarray[] = $moresql;
261 if ($search_date_start_start) {
262 $morewherefilterarray[] =
" t.dateo >= '".$db->idate($search_date_start_start).
"'";
264 if ($search_date_start_end) {
265 $morewherefilterarray[] =
" t.dateo <= '".$db->idate($search_date_start_end).
"'";
268 if ($search_date_end_start) {
269 $morewherefilterarray[] =
" t.datee >= '".$db->idate($search_date_end_start).
"'";
271 if ($search_date_end_end) {
272 $morewherefilterarray[] =
" t.datee <= '".$db->idate($search_date_end_end).
"'";
275 if (!empty($search_planedworkload)) {
276 $morewherefilterarray[] =
natural_search(
't.planned_workload', $search_planedworkload, 1, 1);
279 if (!empty($search_timespend)) {
280 $morewherefilterarray[] =
natural_search(
't.duration_effective', $search_timespend, 1, 1);
283 if (!empty($search_progresscalc)) {
284 $filterprogresscalc =
'if '.natural_search(
'round(100 * $line->duration / $line->planned_workload,2)', $search_progresscalc, 1, 1).
'{return 1;} else {return 0;}';
286 $filterprogresscalc =
'';
289 if (!empty($search_progressdeclare)) {
290 $morewherefilterarray[] =
natural_search(
't.progress', $search_progressdeclare, 1, 1);
293 if ($search_task_budget_amount) {
294 $morewherefilterarray[]=
natural_search(
't.budget_amount', $search_task_budget_amount, 1, 1);
297 $morewherefilter =
'';
298 if (count($morewherefilterarray) > 0) {
299 $morewherefilter =
' AND '.implode(
' AND ', $morewherefilterarray);
302 if ($action ==
'createtask' && $user->rights->projet->creer) {
306 $date_start =
dol_mktime(
GETPOST(
'dateohour',
'int'),
GETPOST(
'dateomin',
'int'), 0,
GETPOST(
'dateomonth',
'int'),
GETPOST(
'dateoday',
'int'),
GETPOST(
'dateoyear',
'int'));
307 $date_end =
dol_mktime(
GETPOST(
'dateehour',
'int'),
GETPOST(
'dateemin',
'int'), 0,
GETPOST(
'dateemonth',
'int'),
GETPOST(
'dateeday',
'int'),
GETPOST(
'dateeyear',
'int'));
310 if (empty($taskref)) {
311 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
316 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
319 } elseif (!
GETPOST(
'task_parent')) {
320 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ChildOfProjectTask")),
null,
'errors');
326 $tmparray = explode(
'_',
GETPOST(
'task_parent'));
327 $projectid = $tmparray[0];
328 if (empty($projectid)) {
331 $task_parent = $tmparray[1];
332 if (empty($task_parent)) {
336 $task =
new Task($db);
338 $task->fk_project = $projectid;
339 $task->entity = $object->entity;
340 $task->ref = $taskref;
341 $task->label = $label;
342 $task->description = $description;
343 $task->planned_workload = $planned_workload;
344 $task->fk_task_parent = $task_parent;
346 $task->date_start = $date_start;
347 $task->date_end = $date_end;
348 $task->progress = $progress;
349 $task->budget_amount = $budget_amount;
352 $ret = $extrafields->setOptionalsFromPost(
null, $task);
354 $taskid = $task->create($user);
357 $result = $task->add_contact(
GETPOST(
"userid",
'int'),
'TASKEXECUTIVE',
'internal');
359 if ($db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
360 $langs->load(
"projects");
362 $duplicate_code_error =
true;
372 if (!empty($backtopage)) {
373 header(
"Location: ".$backtopage);
375 } elseif (empty($projectid)) {
376 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks/list.php'.(empty($mode) ?
'' :
'?mode='.$mode));
382 if (!empty($backtopage)) {
383 header(
"Location: ".$backtopage);
385 } elseif (empty($id)) {
387 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks/list.php'.(empty($mode) ?
'' :
'?mode='.$mode));
402 $projectstatic =
new Project($db);
403 $taskstatic =
new Task($db);
404 $userstatic =
new User($db);
406 $title = $langs->trans(
"Tasks").
' - '.$object->ref.
' '.$object->name;
407 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
408 $title = $object->ref.
' '.$object->name.
' - '.$langs->trans(
"Tasks");
410 if ($action ==
'create') {
411 $title = $langs->trans(
"NewTask");
413 $help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
418 if ($id > 0 || !empty($ref)) {
419 $result = $object->fetch($id, $ref);
423 $result = $object->fetch_thirdparty();
427 $result = $object->fetch_optionals();
435 $userWrite = $object->restrictedProjectArea($user,
'write');
443 print
dol_get_fiche_head($head, $tab, $langs->trans(
"Project"), -1, ($object->public ?
'projectpub' :
'project'));
445 $param =
'&id='.$object->id;
446 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
447 $param .=
'&contextpage='.urlencode($contextpage);
449 if ($search_user_id) {
450 $param .=
'&search_user_id='.urlencode($search_user_id);
452 if ($search_taskref) {
453 $param .=
'&search_taskref='.urlencode($search_taskref);
455 if ($search_tasklabel) {
456 $param .=
'&search_tasklabel='.urlencode($search_tasklabel);
458 if ($search_taskdescription) {
459 $param .=
'&search_taskdescription='.urlencode($search_taskdescription);
461 if ($search_dtstartday) {
462 $param .=
'&search_dtstartday='.urlencode($search_dtstartday);
464 if ($search_dtstartmonth) {
465 $param .=
'&search_dtstartmonth='.urlencode($search_dtstartmonth);
467 if ($search_dtstartyear) {
468 $param .=
'&search_dtstartyear='.urlencode($search_dtstartyear);
470 if ($search_dtendday) {
471 $param .=
'&search_dtendday='.urlencode($search_dtendday);
473 if ($search_dtendmonth) {
474 $param .=
'&search_dtendmonth='.urlencode($search_dtendmonth);
476 if ($search_dtendyear) {
477 $param .=
'&search_dtendyear='.urlencode($search_dtendyear);
479 if ($search_date_start_startmonth) {
480 $param .=
'&search_date_start_startmonth='.urlencode($search_date_start_startmonth);
482 if ($search_date_start_startyear) {
483 $param .=
'&search_date_start_startyear='.urlencode($search_date_start_startyear);
485 if ($search_date_start_startday) {
486 $param .=
'&search_date_start_startday='.urlencode($search_date_start_startday);
488 if ($search_date_start_start) {
489 $param .=
'&search_date_start_start='.urlencode($search_date_start_start);
491 if ($search_date_start_endmonth) {
492 $param .=
'&search_date_start_endmonth='.urlencode($search_date_start_endmonth);
494 if ($search_date_start_endyear) {
495 $param .=
'&search_date_start_endyear='.urlencode($search_date_start_endyear);
497 if ($search_date_start_endday) {
498 $param .=
'&search_date_start_endday='.urlencode($search_date_start_endday);
500 if ($search_date_start_end) {
501 $param .=
'&search_date_start_end='.urlencode($search_date_start_end);
503 if ($search_date_end_startmonth) {
504 $param .=
'&search_date_end_startmonth='.urlencode($search_date_end_startmonth);
506 if ($search_date_end_startyear) {
507 $param .=
'&search_date_end_startyear='.urlencode($search_date_end_startyear);
509 if ($search_date_end_startday) {
510 $param .=
'&search_date_end_startday='.urlencode($search_date_end_startday);
512 if ($search_date_end_start) {
513 $param .=
'&search_date_end_start='.urlencode($search_date_end_start);
515 if ($search_date_end_endmonth) {
516 $param .=
'&search_date_end_endmonth='.urlencode($search_date_end_endmonth);
518 if ($search_date_end_endyear) {
519 $param .=
'&search_date_end_endyear='.urlencode($search_date_end_endyear);
521 if ($search_date_end_endday) {
522 $param .=
'&search_date_end_endday='.urlencode($search_date_end_endday);
524 if ($search_date_end_end) {
525 $param .=
'&search_date_end_end=' . urlencode($search_date_end_end);
527 if ($search_planedworkload) {
528 $param .=
'&search_planedworkload='.urlencode($search_planedworkload);
530 if ($search_timespend) {
531 $param .=
'&search_timespend='.urlencode($search_timespend);
533 if ($search_progresscalc) {
534 $param .=
'&search_progresscalc='.urlencode($search_progresscalc);
536 if ($search_progressdeclare) {
537 $param .=
'&search_progressdeclare='.urlencode($search_progressdeclare);
539 if ($search_task_budget_amount) {
540 $param .=
'&search_task_budget_amount='.urlencode($search_task_budget_amount);
542 if ($optioncss !=
'') {
543 $param .=
'&optioncss='.urlencode($optioncss);
546 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
550 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
552 $morehtmlref =
'<div class="refidno">';
554 $morehtmlref .= $object->title;
556 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
557 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
559 $morehtmlref .=
'</div>';
562 if (empty($user->rights->projet->all->lire)) {
563 $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
564 $object->next_prev_filter =
" rowid IN (".$db->sanitize(count($objectsListId) ?join(
',', array_keys($objectsListId)) :
'0').
")";
567 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
569 print
'<div class="fichecenter">';
570 print
'<div class="fichehalfleft">';
571 print
'<div class="underbanner clearboth"></div>';
573 print
'<table class="border tableforfield centpercent">';
576 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) ||
isModEnabled(
'eventorganization')) {
577 print
'<tr><td class="tdtop">';
578 print $langs->trans(
"Usage");
581 if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
582 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
583 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
584 print
$form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
587 if (empty($conf->global->PROJECT_HIDE_TASKS)) {
588 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : ($object->usage_task ?
' checked="checked"' :
'')).
'"> ';
589 $htmltext = $langs->trans(
"ProjectFollowTasks");
590 print
$form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
593 if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
594 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"' :
'')).
'"> ';
595 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
596 print
$form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
600 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"' :
'')).
'"> ';
601 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
602 print
$form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
608 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
609 if ($object->public) {
610 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
611 print $langs->trans(
'SharedProject');
613 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
614 print $langs->trans(
'PrivateProject');
619 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
620 if (!is_null($object->budget_amount) && strcmp($object->budget_amount,
'')) {
621 print
'<span class="amount">'.price($object->budget_amount,
'', $langs, 1, 0, 0, $conf->currency).
'</span>';
626 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
628 print ($start ? $start :
'?');
631 print ($end ? $end :
'?');
632 if ($object->hasDelay()) {
639 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
644 print
'<div class="fichehalfright">';
645 print
'<div class="underbanner clearboth"></div>';
647 print
'<table class="border tableforfield centpercent">';
650 print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
656 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
657 print
$form->showCategories($object->id, Categorie::TYPE_PROJECT, 1);
666 print
'<div class="clearboth"></div>';
673 if ($action ==
'create' && $user->rights->projet->creer && (empty($object->thirdparty->id) || $userWrite > 0)) {
674 if ($id > 0 || !empty($ref)) {
680 $projectoktoentertime = 1;
682 $projectoktoentertime = 0;
683 print
'<div class="warning">';
684 $langs->load(
"errors");
685 print $langs->trans(
"WarningProjectClosed");
690 $projectoktoentertime = 0;
691 print
'<div class="warning">';
692 $langs->load(
"errors");
693 print $langs->trans(
"WarningProjectDraft");
697 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
698 print
'<input type="hidden" name="token" value="'.newToken().
'">';
699 print
'<input type="hidden" name="action" value="createtask">';
700 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
701 if (!empty($object->id)) {
702 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
707 print
'<table class="border centpercent">';
710 $obj = empty($conf->global->PROJECT_TASK_ADDON) ?
'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
711 if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT.
"/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.
".php")) {
712 require_once DOL_DOCUMENT_ROOT.
"/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.
'.php';
714 $defaultref = $modTask->getNextValue($object->thirdparty,
null);
717 if (is_numeric($defaultref) && $defaultref <= 0) {
722 print
'<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans(
"Ref").
'</span></td><td>';
723 if (empty($duplicate_code_error)) {
728 print
'<input type="hidden" name="taskref" value="'.(GETPOSTISSET(
"ref") ?
GETPOST(
"ref",
'alpha') : $defaultref).
'">';
732 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td><td>';
733 print
'<input type="text" name="label" autofocus class="minwidth500 maxwidthonsmartphone" value="'.$label.
'">';
737 print
'<tr><td class="fieldrequired">'.$langs->trans(
"ChildOfProjectTask").
'</td><td>';
739 if ($projectoktoentertime) {
740 $formother->selectProjectTasks(
GETPOST(
'task_parent'), empty($projectid) ? $object->id : $projectid,
'task_parent', 0, 0, 1, 1, 0,
'0,1',
'maxwidth500 widthcentpercentminusxx');
742 $formother->selectProjectTasks(
GETPOST(
'task_parent'), empty($projectid) ? $object->id : $projectid,
'task_parent', 0, 0, 1, 1, 0,
'',
'maxwidth500 widthcentpercentminusxx');
746 $contactsofproject = (empty($object->id) ?
'' : $object->getListContactId(
'internal'));
749 print
'<tr><td>'.$langs->trans(
"AffectedTo").
'</td><td>';
750 if (is_array($contactsofproject) && count($contactsofproject)) {
751 print
$form->select_dolusers($user->id,
'userid', 0,
'', 0,
'', $contactsofproject, 0, 0, 0,
'', 0,
'',
'maxwidth300');
753 if ($projectid > 0 || $object->id > 0) {
754 print
'<span class="opacitymedium">'.$langs->trans(
"NoUserAssignedToTheProject").
'</span>';
756 print
$form->select_dolusers($user->id,
'userid', 0,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth300');
762 print
'<tr><td>'.$langs->trans(
"DateStart").
'</td><td>';
763 print
$form->selectDate((!empty($date_start) ? $date_start :
''),
'dateo', 1, 1, 0,
'', 1, 1);
767 print
'<tr><td>'.$langs->trans(
"DateEnd").
'</td><td>';
768 print
$form->selectDate((!empty($date_end) ? $date_end : -1),
'datee', -1, 1, 0,
'', 1, 1);
772 print
'<tr><td>'.$langs->trans(
"PlannedWorkload").
'</td><td>';
773 print
$form->select_duration(
'planned_workload', !empty($planned_workload) ? $planned_workload : 0, 0,
'text');
777 print
'<tr><td>'.$langs->trans(
"ProgressDeclared").
'</td><td colspan="3">';
778 print $formother->select_percent($progress,
'progress', 0, 5, 0, 100, 1);
782 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
786 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
787 $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_SOCIETE) ? $conf->global->FCKEDITOR_ENABLE_SOCIETE : 0);
788 if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) {
789 $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT;
791 $doleditor =
new DolEditor(
'description', $object->description,
'', 80,
'dolibarr_details',
'',
false,
true, $cked_enabled, $nbrows);
792 print $doleditor->Create();
796 print
'<tr><td>'.$langs->trans(
"Budget").
'</td>';
797 print
'<td><input size="5" type="text" name="budget_amount" value="'.dol_escape_htmltag(
GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
'').
'"></td>';
801 $parameters = array(
'arrayfields' => &$arrayfields);
802 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $taskstatic, $action);
803 print $hookmanager->resPrint;
805 if (empty($reshook) && !empty($extrafields->attributes[$taskstatic->table_element][
'label'])) {
806 print $taskstatic->showOptionals($extrafields,
'edit');
813 print
$form->buttonsSaveCancel(
"Add");
816 } elseif ($id > 0 || !empty($ref)) {
817 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
826 $linktocreatetaskParam = array();
827 $linktocreatetaskUserRight =
false;
828 if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
829 if ($object->public || $userWrite > 0) {
830 $linktocreatetaskUserRight =
true;
832 $linktocreatetaskParam[
'attr'][
'title'] = $langs->trans(
"NotOwnerOfProject");
836 $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),
'', $linktocreatetaskUserRight, $linktocreatetaskParam);
838 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'">';
839 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
840 print
'<input type="hidden" name="token" value="'.newToken().
'">';
841 print
'<input type="hidden" name="action" value="list">';
842 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
843 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
844 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
845 print
'<input type="hidden" name="page" value="'.$page.
'">';
846 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
848 $title = $langs->trans(
"ListOfTasks");
849 $linktotasks =
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/projet/tasks.php?id='.$object->id,
'', 1, array(
'morecss'=>
'reposition btnTitleSelected'));
850 $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'));
853 print
load_fiche_titre($title, $linktotasks.
' '.$linktocreatetask,
'projecttask');
857 $filteronthirdpartyid = $socid;
858 $tasksarray = $taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0,
'', -1, $morewherefilter, 0, 0, $extrafields, 1, $search_array_options, 0, 1, $sortfield, $sortorder);
861 $tmpuser =
new User($db);
862 if ($search_user_id > 0) {
863 $tmpuser->fetch($search_user_id);
866 $tasksrole = ($tmpuser->id > 0 ? $taskstatic->getUserRolesForProjectsOrTasks(0, $tmpuser, $object->id, 0) :
'');
870 if (!empty($conf->use_javascript_ajax)) {
871 include DOL_DOCUMENT_ROOT.
'/core/tpl/ajaxrow.tpl.php';
876 if (count($tasksarray) > 0) {
877 $moreforfilter .=
'<div class="divsearchfield">';
878 $moreforfilter .=
img_picto(
'',
'user',
'class="pictofixedwidth"');
879 $moreforfilter .=
$form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id :
'',
'search_user_id', $langs->trans(
"TasksAssignedTo"),
null, 0,
'',
'');
880 $moreforfilter .=
'</div>';
882 if ($moreforfilter) {
883 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
884 print $moreforfilter;
888 print
'<div class="div-table-responsive">';
889 print
'<table id="tablelines" class="tagtable nobottom liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">';
892 print
'<tr class="liste_titre_filter">';
894 if (!empty($arrayfields[
't.ref'][
'checked'])) {
895 print
'<td class="liste_titre">';
896 print
'<input class="flat searchstring maxwidth50" type="text" name="search_taskref" value="'.dol_escape_htmltag($search_taskref).
'">';
900 if (!empty($arrayfields[
't.label'][
'checked'])) {
901 print
'<td class="liste_titre">';
902 print
'<input class="flat searchstring maxwidth100" type="text" name="search_tasklabel" value="'.dol_escape_htmltag($search_tasklabel).
'">';
906 if (!empty($arrayfields[
't.description'][
'checked'])) {
907 print
'<td class="liste_titre">';
908 print
'<input class="flat searchstring maxwidth100" type="text" name="search_taskdescription" value="'.dol_escape_htmltag($search_taskdescription).
'">';
912 if (!empty($arrayfields[
't.dateo'][
'checked'])) {
913 print
'<td class="liste_titre center">';
917 print
'<div class="nowrap">';
918 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'));
920 print
'<div class="nowrap">';
921 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'));
926 if (!empty($arrayfields[
't.datee'][
'checked'])) {
927 print
'<td class="liste_titre center">';
931 print
'<div class="nowrap">';
932 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'));
934 print
'<div class="nowrap">';
935 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'));
940 if (!empty($arrayfields[
't.planned_workload'][
'checked'])) {
941 print
'<td class="liste_titre right">';
942 print
'<input class="flat" type="text" size="4" name="search_planedworkload" value="'.$search_planedworkload.
'">';
946 if (!empty($arrayfields[
't.duration_effective'][
'checked'])) {
947 print
'<td class="liste_titre right">';
948 print
'<input class="flat" type="text" size="4" name="search_timespend" value="'.$search_timespend.
'">';
952 if (!empty($arrayfields[
't.progress_calculated'][
'checked'])) {
953 print
'<td class="liste_titre right">';
954 print
'<input class="flat" type="text" size="4" name="search_progresscalc" value="'.$search_progresscalc.
'">';
958 if (!empty($arrayfields[
't.progress'][
'checked'])) {
959 print
'<td class="liste_titre right">';
960 print
'<input class="flat" type="text" size="4" name="search_progressdeclare" value="'.$search_progressdeclare.
'">';
965 if (!empty($arrayfields[
't.progress_summary'][
'checked'])) {
966 print
'<td class="liste_titre right"></td>';
969 if ($object->usage_bill_time) {
970 if (!empty($arrayfields[
't.tobill'][
'checked'])) {
971 print
'<td class="liste_titre right">';
975 if (!empty($arrayfields[
't.billed'][
'checked'])) {
976 print
'<td class="liste_titre right">';
987 if (!empty($arrayfields[
't.budget_amount'][
'checked'])) {
988 print
'<td class="liste_titre center">';
989 print
'<input type="text" class="flat" name="search_task_budget_amount" value="'.$search_task_budget_amount.
'" size="4">';
993 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
994 print
'<td class="liste_titre right">';
998 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1001 print
'<td class="liste_titre maxwidthsearch">';
1002 $searchpicto =
$form->showFilterButtons();
1007 print
'<tr class="liste_titre nodrag nodrop">';
1009 if (!empty($arrayfields[
't.ref'][
'checked'])) {
1010 print_liste_field_titre($arrayfields[
't.ref'][
'label'], $_SERVER[
"PHP_SELF"],
't.ref',
'', $param,
'', $sortfield, $sortorder,
'');
1012 if (!empty($arrayfields[
't.label'][
'checked'])) {
1013 print_liste_field_titre($arrayfields[
't.label'][
'label'], $_SERVER[
"PHP_SELF"],
"t.label",
'', $param,
'', $sortfield, $sortorder,
'');
1015 if (!empty($arrayfields[
't.description'][
'checked'])) {
1016 print_liste_field_titre($arrayfields[
't.description'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'');
1018 if (!empty($arrayfields[
't.dateo'][
'checked'])) {
1019 print_liste_field_titre($arrayfields[
't.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"t.dateo",
'', $param,
'', $sortfield, $sortorder,
'center ');
1021 if (!empty($arrayfields[
't.datee'][
'checked'])) {
1022 print_liste_field_titre($arrayfields[
't.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"t.datee",
'', $param,
'', $sortfield, $sortorder,
'center ');
1024 if (!empty($arrayfields[
't.planned_workload'][
'checked'])) {
1025 print_liste_field_titre($arrayfields[
't.planned_workload'][
'label'], $_SERVER[
"PHP_SELF"],
"t.planned_workload",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1027 if (!empty($arrayfields[
't.duration_effective'][
'checked'])) {
1028 print_liste_field_titre($arrayfields[
't.duration_effective'][
'label'], $_SERVER[
"PHP_SELF"],
"t.duration_effective",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1030 if (!empty($arrayfields[
't.progress_calculated'][
'checked'])) {
1031 print_liste_field_titre($arrayfields[
't.progress_calculated'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1033 if (!empty($arrayfields[
't.progress'][
'checked'])) {
1034 print_liste_field_titre($arrayfields[
't.progress'][
'label'], $_SERVER[
"PHP_SELF"],
"t.progress",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1036 if (!empty($arrayfields[
't.progress_summary'][
'checked'])) {
1037 print_liste_field_titre($arrayfields[
't.progress_summary'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'', 1);
1039 if ($object->usage_bill_time) {
1040 if (!empty($arrayfields[
't.tobill'][
'checked'])) {
1041 print_liste_field_titre($arrayfields[
't.tobill'][
'label'], $_SERVER[
"PHP_SELF"],
"t.tobill",
'', $param,
'', $sortfield, $sortorder,
'right ');
1043 if (!empty($arrayfields[
't.billed'][
'checked'])) {
1044 print_liste_field_titre($arrayfields[
't.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"t.billed",
'', $param,
'', $sortfield, $sortorder,
'right ');
1054 if (!empty($arrayfields[
't.budget_amount'][
'checked'])) {
1055 print_liste_field_titre($arrayfields[
't.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
"t.budget_amount",
"", $param,
'', $sortfield, $sortorder,
'center ');
1058 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1059 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1062 $disablesortlink = 1;
1063 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1065 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
1066 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1067 print $hookmanager->resPrint;
1068 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1072 if (count($tasksarray) > 0) {
1075 $nboftaskshown =
projectLinesa($j, 0, $tasksarray, $level,
true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields);
1077 $colspan = count($arrayfields);
1078 if ($object->usage_bill_time) {
1081 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoTasks").
'</span></td></tr>';
1092 if (!empty($user->rights->projet->all->lire)) {
1093 if ($search_user_id == $user->id) {
1094 if ($nboftaskshown < count($tasksrole)) {
1095 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1099 if ($nboftaskshown < count($tasksarray) && !
GETPOST(
'search_user_id',
'int')) {
1100 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
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...)
Class to manage Dolibarr users.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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).
cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent)
Clean corrupted tree (orphelins linked to a not existing parent), record linked to themself and child...
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
isModEnabled($module)
Is Dolibarr module enabled.
projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0, $filterprogresscalc='', $showbilltime=0, $arrayfields=array())
Show task lines with a particular parent.
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.