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';
36if (isModEnabled(
'category')) {
37 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
49$langsLoad = array(
'projects',
'users',
'companies');
50if (isModEnabled(
'eventorganization')) {
51 $langsLoad[] =
'eventorganization';
54$langs->loadLangs($langsLoad);
56$action =
GETPOST(
'action',
'aZ09');
57$massaction =
GETPOST(
'massaction',
'alpha');
59$confirm =
GETPOST(
'confirm',
'alpha');
60$cancel =
GETPOST(
'cancel',
'aZ09');
61$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'projecttasklist';
62$backtopage =
GETPOST(
'backtopage',
'alpha');
65$optioncss =
GETPOST(
'optioncss',
'aZ');
66$backtopage =
GETPOST(
'backtopage',
'alpha');
67$toselect =
GETPOST(
'toselect',
'array');
71$taskref =
GETPOST(
'taskref',
'alpha');
75$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
76$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
78if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
81$offset = $limit * $page;
86$search_taskref =
GETPOST(
'search_taskref');
87$search_tasklabel =
GETPOST(
'search_tasklabel');
88$search_taskdescription =
GETPOST(
'search_taskdescription');
89$search_dtstartday =
GETPOST(
'search_dtstartday');
90$search_dtstartmonth =
GETPOST(
'search_dtstartmonth');
91$search_dtstartyear =
GETPOST(
'search_dtstartyear');
92$search_dtendday =
GETPOST(
'search_dtendday');
93$search_dtendmonth =
GETPOST(
'search_dtendmonth');
94$search_dtendyear =
GETPOST(
'search_dtendyear');
95$search_planedworkload =
GETPOST(
'search_planedworkload');
96$search_timespend =
GETPOST(
'search_timespend');
97$search_progresscalc =
GETPOST(
'search_progresscalc');
98$search_progressdeclare =
GETPOST(
'search_progressdeclare');
99$search_task_budget_amount =
GETPOST(
'search_task_budget_amount');
100$search_task_billable =
GETPOST(
'search_task_billable');
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);
123$taskstatic =
new Task($db);
126include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
127if (
getDolGlobalString(
'PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($object,
'fetchComments') && empty(
$object->comments)) {
131if ($id > 0 || !empty($ref)) {
133 $extrafields->fetch_name_optionals_label(
$object->table_element);
135$extrafields->fetch_name_optionals_label($taskstatic->table_element);
136$search_array_options = $extrafields->getOptionalsFromPost($taskstatic->table_element,
'',
'search_');
152$hookmanager->initHooks(array(
'projecttaskscard',
'globalcard'));
157$diroutputmassaction =
$conf->project->dir_output.
'/tasks/temp/massgeneration/'.$user->id;
161$billable = (
GETPOST(
'billable',
'aZ') ==
'yes' ? 1 : 0);
162$label =
GETPOST(
'label',
'alpha');
163$description =
GETPOST(
'description',
'restricthtml');
164$planned_workloadhour = (GETPOSTISSET(
'planned_workloadhour') ?
GETPOSTINT(
'planned_workloadhour') :
'');
165$planned_workloadmin = (GETPOSTISSET(
'planned_workloadmin') ?
GETPOSTINT(
'planned_workloadmin') :
'');
166if (GETPOSTISSET(
'planned_workloadhour') || GETPOSTISSET(
'planned_workloadmin')) {
167 $planned_workload = (int) $planned_workloadhour * 3600 + (
int) $planned_workloadmin * 60;
169 $planned_workload =
'';
174 't.ref' => array(
'label' =>
"RefTask",
'checked' => 1,
'position' => 1),
175 't.label' => array(
'label' =>
"LabelTask",
'checked' => 1,
'position' => 2),
176 't.description' => array(
'label' =>
"Description",
'checked' => 0,
'position' => 3),
177 't.dateo' => array(
'label' =>
"DateStart",
'checked' => 1,
'position' => 4),
178 't.datee' => array(
'label' =>
"Deadline",
'checked' => 1,
'position' => 5),
179 't.planned_workload' => array(
'label' =>
"PlannedWorkload",
'checked' => 1,
'position' => 6),
180 't.duration_effective' => array(
'label' =>
"TimeSpent",
'checked' => 1,
'position' => 7),
181 't.progress_calculated' => array(
'label' =>
"ProgressCalculated",
'checked' => 1,
'position' => 8),
182 't.progress' => array(
'label' =>
"ProgressDeclared",
'checked' => 1,
'position' => 9),
183 't.progress_summary' => array(
'label' =>
"TaskProgressSummary",
'checked' => 1,
'position' => 10),
184 't.budget_amount' => array(
'label' =>
"Budget",
'checked' => 0,
'position' => 11),
185 'c.assigned' => array(
'label' =>
"TaskRessourceLinks",
'checked' => 1,
'position' => 12),
188 $arrayfields[
't.tobill'] = array(
'label' => $langs->trans(
"TimeToBill"),
'checked' => 0,
'position' => 11);
189 $arrayfields[
't.billed'] = array(
'label' => $langs->trans(
"TimeBilled"),
'checked' => 0,
'position' => 12);
190 $arrayfields[
't.billable'] = array(
'label' => $langs->trans(
"Billable"),
'checked' => 1,
'position' => 13);
194$extrafieldsobjectkey = $taskstatic->table_element;
195$extrafieldsobjectprefix =
'efpt.';
196include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
199'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
201$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
210 if (!empty($backtopageforcancel)) {
211 header(
"Location: ".$backtopageforcancel);
213 } elseif (!empty($backtopage)) {
214 header(
"Location: ".$backtopage);
220if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
224$parameters = array(
'id' => $id);
225$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
230if (empty($reshook)) {
232 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
235 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
236 $search_user_id =
"";
237 $search_taskref =
'';
238 $search_tasklabel =
'';
239 $search_dtstartday =
'';
240 $search_dtstartmonth =
'';
241 $search_dtstartyear =
'';
242 $search_dtendday =
'';
243 $search_dtendmonth =
'';
244 $search_dtendyear =
'';
245 $search_planedworkload =
'';
246 $search_timespend =
'';
247 $search_progresscalc =
'';
248 $search_progressdeclare =
'';
249 $search_task_budget_amount =
'';
250 $search_task_billable =
'';
252 $search_array_options = array();
253 $search_date_start_startmonth =
"";
254 $search_date_start_startyear =
"";
255 $search_date_start_startday =
"";
256 $search_date_start_start =
"";
257 $search_date_start_endmonth =
"";
258 $search_date_start_endyear =
"";
259 $search_date_start_endday =
"";
260 $search_date_start_end =
"";
261 $search_date_end_startmonth =
"";
262 $search_date_end_startyear =
"";
263 $search_date_end_startday =
"";
264 $search_date_end_start =
"";
265 $search_date_end_endmonth =
"";
266 $search_date_end_endyear =
"";
267 $search_date_end_endday =
"";
268 $search_date_end_end =
"";
272 $objectclass =
'Task';
273 $objectlabel =
'Tasks';
274 $permissiontoread = $user->hasRight(
'projet',
'lire');
275 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
276 $uploaddir =
$conf->project->dir_output.
'/tasks';
277 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
280$morewherefilterarray = array();
282if (!empty($search_taskref)) {
283 $morewherefilterarray[] =
natural_search(
't.ref', $search_taskref, 0, 1);
286if (!empty($search_tasklabel)) {
287 $morewherefilterarray[] =
natural_search(
't.label', $search_tasklabel, 0, 1);
290$moresql =
dolSqlDateFilter(
't.dateo', $search_dtstartday, $search_dtstartmonth, $search_dtstartyear, 1);
292 $morewherefilterarray[] = $moresql;
295$moresql =
dolSqlDateFilter(
't.datee', $search_dtendday, $search_dtendmonth, $search_dtendyear, 1);
297 $morewherefilterarray[] = $moresql;
300if ($search_date_start_start) {
301 $morewherefilterarray[] =
" t.dateo >= '".$db->idate($search_date_start_start).
"'";
303if ($search_date_start_end) {
304 $morewherefilterarray[] =
" t.dateo <= '".$db->idate($search_date_start_end).
"'";
307if ($search_date_end_start) {
308 $morewherefilterarray[] =
" t.datee >= '".$db->idate($search_date_end_start).
"'";
310if ($search_date_end_end) {
311 $morewherefilterarray[] =
" t.datee <= '".$db->idate($search_date_end_end).
"'";
314if (!empty($search_planedworkload)) {
315 $morewherefilterarray[] =
natural_search(
't.planned_workload', $search_planedworkload, 1, 1);
318if (!empty($search_timespend)) {
319 $morewherefilterarray[] =
natural_search(
't.duration_effective', $search_timespend, 1, 1);
322if (!empty($search_progressdeclare)) {
323 $morewherefilterarray[] =
natural_search(
't.progress', $search_progressdeclare, 1, 1);
325if (!empty($search_progresscalc)) {
326 $morewherefilterarray[] =
'(planned_workload IS NULL OR planned_workload = 0 OR '.natural_search(
'ROUND(100 * duration_effective / planned_workload, 2)', $search_progresscalc, 1, 1).
')';
329if ($search_task_budget_amount) {
330 $morewherefilterarray[] =
natural_search(
't.budget_amount', $search_task_budget_amount, 1, 1);
332if ($search_task_billable) {
333 $morewherefilterarray[] =
" t.billable = ".($search_task_billable ==
"yes" ? 1 : 0);
337$morewherefilter =
'';
338if (count($morewherefilterarray) > 0) {
339 $morewherefilter =
' AND '.implode(
' AND ', $morewherefilterarray);
342if ($action ==
'createtask' && $user->hasRight(
'projet',
'creer')) {
348 if (empty($taskref)) {
349 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")),
null,
'errors');
354 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label")),
null,
'errors');
357 } elseif (!
GETPOST(
'task_parent')) {
358 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ChildOfProjectTask")),
null,
'errors');
364 $tmparray = explode(
'_',
GETPOST(
'task_parent'));
365 $projectid = empty($tmparray[0]) ?
$id : (int) $tmparray[0];
366 $task_parent = empty($tmparray[1]) ? 0 : $tmparray[1];
368 $task =
new Task($db);
370 $task->fk_project = $projectid;
371 $task->entity =
$object->entity;
372 $task->ref = $taskref;
373 $task->label = $label;
374 $task->description = $description;
375 $task->planned_workload = $planned_workload;
376 $task->fk_task_parent = $task_parent;
378 $task->date_start = $date_start;
379 $task->date_end = $date_end;
380 $task->progress = $progress;
381 $task->budget_amount = $budget_amount;
382 $task->billable = $billable;
385 $ret = $extrafields->setOptionalsFromPost(
null, $task);
387 $taskid = $task->create($user);
390 $result = $task->add_contact(
GETPOSTINT(
"userid"),
'TASKEXECUTIVE',
'internal');
392 if ($db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
393 $langs->load(
"projects");
395 $duplicate_code_error =
true;
405 if (!empty($backtopage)) {
406 header(
"Location: ".$backtopage);
408 } elseif (empty($projectid)) {
409 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks/list.php'.(empty($mode) ?
'' :
'?mode='.$mode));
415 if (!empty($backtopage)) {
416 header(
"Location: ".$backtopage);
418 } elseif (empty($id)) {
420 header(
"Location: ".DOL_URL_ROOT.
'/projet/tasks/list.php'.(empty($mode) ?
'' :
'?mode='.$mode));
432$form =
new Form($db);
435$projectstatic =
new Project($db);
436$taskstatic =
new Task($db);
437$userstatic =
new User($db);
439$title = $langs->trans(
"Tasks").
' - '.
$object->ref.
' '.
$object->name;
441 $title =
$object->ref.
' '.
$object->name.
' - '.$langs->trans(
"Tasks");
443if ($action ==
'create') {
444 $title = $langs->trans(
"NewTask");
446$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
448llxHeader(
"", $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-project page-card_tasks');
450$arrayofselected = is_array($toselect) ? $toselect : array();
452if ($id > 0 || !empty($ref)) {
453 $result =
$object->fetch($id, $ref);
457 $result =
$object->fetch_thirdparty();
461 $result =
$object->fetch_optionals();
469 $userWrite =
$object->restrictedProjectArea($user,
'write');
474 $tab = (GETPOSTISSET(
'tab') ?
GETPOST(
'tab') :
'tasks');
479 $param =
'&id='.$object->id;
480 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
481 $param .=
'&contextpage='.urlencode($contextpage);
483 if ($search_user_id) {
484 $param .=
'&search_user_id='.urlencode((
string) ($search_user_id));
486 if ($search_taskref) {
487 $param .=
'&search_taskref='.urlencode($search_taskref);
489 if ($search_tasklabel) {
490 $param .=
'&search_tasklabel='.urlencode($search_tasklabel);
492 if ($search_taskdescription) {
493 $param .=
'&search_taskdescription='.urlencode($search_taskdescription);
495 if ($search_dtstartday) {
496 $param .=
'&search_dtstartday='.urlencode($search_dtstartday);
498 if ($search_dtstartmonth) {
499 $param .=
'&search_dtstartmonth='.urlencode($search_dtstartmonth);
501 if ($search_dtstartyear) {
502 $param .=
'&search_dtstartyear='.urlencode($search_dtstartyear);
504 if ($search_dtendday) {
505 $param .=
'&search_dtendday='.urlencode($search_dtendday);
507 if ($search_dtendmonth) {
508 $param .=
'&search_dtendmonth='.urlencode($search_dtendmonth);
510 if ($search_dtendyear) {
511 $param .=
'&search_dtendyear='.urlencode($search_dtendyear);
513 if ($search_date_start_startmonth) {
514 $param .=
'&search_date_start_startmonth='.urlencode((
string) ($search_date_start_startmonth));
516 if ($search_date_start_startyear) {
517 $param .=
'&search_date_start_startyear='.urlencode((
string) ($search_date_start_startyear));
519 if ($search_date_start_startday) {
520 $param .=
'&search_date_start_startday='.urlencode((
string) ($search_date_start_startday));
522 if ($search_date_start_start) {
523 $param .=
'&search_date_start_start='.urlencode($search_date_start_start);
525 if ($search_date_start_endmonth) {
526 $param .=
'&search_date_start_endmonth='.urlencode((
string) ($search_date_start_endmonth));
528 if ($search_date_start_endyear) {
529 $param .=
'&search_date_start_endyear='.urlencode((
string) ($search_date_start_endyear));
531 if ($search_date_start_endday) {
532 $param .=
'&search_date_start_endday='.urlencode((
string) ($search_date_start_endday));
534 if ($search_date_start_end) {
535 $param .=
'&search_date_start_end='.urlencode($search_date_start_end);
537 if ($search_date_end_startmonth) {
538 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
540 if ($search_date_end_startyear) {
541 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
543 if ($search_date_end_startday) {
544 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
546 if ($search_date_end_start) {
547 $param .=
'&search_date_end_start='.urlencode($search_date_end_start);
549 if ($search_date_end_endmonth) {
550 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
552 if ($search_date_end_endyear) {
553 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
555 if ($search_date_end_endday) {
556 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
558 if ($search_date_end_end) {
559 $param .=
'&search_date_end_end=' . urlencode($search_date_end_end);
561 if ($search_planedworkload) {
562 $param .=
'&search_planedworkload='.urlencode($search_planedworkload);
564 if ($search_timespend) {
565 $param .=
'&search_timespend='.urlencode($search_timespend);
567 if ($search_progresscalc) {
568 $param .=
'&search_progresscalc='.urlencode($search_progresscalc);
570 if ($search_progressdeclare) {
571 $param .=
'&search_progressdeclare='.urlencode($search_progressdeclare);
573 if ($search_task_budget_amount) {
574 $param .=
'&search_task_budget_amount='.urlencode($search_task_budget_amount);
576 if ($search_task_billable) {
577 $param .=
'&search_task_billable='.urlencode($search_task_billable);
579 if ($optioncss !=
'') {
580 $param .=
'&optioncss='.urlencode($optioncss);
583 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
585 $arrayofmassactions = array();
586 if ($user->hasRight(
'projet',
'creer')) {
587 $arrayofmassactions[
'preclonetasks'] =
img_picto(
'',
'clone',
'class="pictofixedwidth"').$langs->trans(
"Clone");
589 if ($permissiontodelete) {
590 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
592 if (in_array($massaction, array(
'presend',
'predelete'))) {
593 $arrayofmassactions = array();
595 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
599 if (!empty($_SESSION[
'pageforbacktolist']) && !empty($_SESSION[
'pageforbacktolist'][
'project'])) {
600 $tmpurl = $_SESSION[
'pageforbacktolist'][
'project'];
601 $tmpurl = preg_replace(
'/__SOCID__/', (
string)
$object->socid, $tmpurl);
602 $linkback =
'<a href="'.$tmpurl.(preg_match(
'/\?/', $tmpurl) ?
'&' :
'?').
'restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
604 $linkback =
'<a href="'.DOL_URL_ROOT.
'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
607 $morehtmlref =
'<div class="refidno">';
609 $morehtmlref .=
$object->title;
611 if (!empty(
$object->thirdparty->id) &&
$object->thirdparty->id > 0) {
612 $morehtmlref .=
'<br>'.$object->thirdparty->getNomUrl(1,
'project');
614 $morehtmlref .=
'</div>';
617 if (!$user->hasRight(
'projet',
'all',
'lire')) {
618 $objectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 0);
619 $object->next_prev_filter =
"rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(
',', array_keys($objectsListId)) :
'0').
")";
622 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
624 print
'<div class="fichecenter">';
625 print
'<div class="fichehalfleft">';
626 print
'<div class="underbanner clearboth"></div>';
628 print
'<table class="border tableforfield centpercent">';
632 print
'<tr><td class="tdtop">';
633 print $langs->trans(
"Usage");
637 print
'<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET(
'usage_opportunity') ? (
GETPOST(
'usage_opportunity',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_opportunity ?
' checked="checked"' :
'')).
'"> ';
638 $htmltext = $langs->trans(
"ProjectFollowOpportunity");
639 print $form->textwithpicto($langs->trans(
"ProjectFollowOpportunity"), $htmltext);
643 print
'<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET(
'usage_task') ? (
GETPOST(
'usage_task',
'alpha') !=
'' ?
' checked="checked"' :
'') : (
$object->usage_task ?
' checked="checked"' :
'')).
'"> ';
644 $htmltext = $langs->trans(
"ProjectFollowTasks");
645 print $form->textwithpicto($langs->trans(
"ProjectFollowTasks"), $htmltext);
649 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"' :
'')).
'"> ';
650 $htmltext = $langs->trans(
"ProjectBillTimeDescription");
651 print $form->textwithpicto($langs->trans(
"BillTime"), $htmltext);
654 if (isModEnabled(
'eventorganization')) {
655 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"' :
'')).
'"> ';
656 $htmltext = $langs->trans(
"EventOrganizationDescriptionLong");
657 print $form->textwithpicto($langs->trans(
"ManageOrganizeEvent"), $htmltext);
663 print
'<tr><td class="titlefield">'.$langs->trans(
"Visibility").
'</td><td>';
665 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
666 print $langs->trans(
'SharedProject');
668 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
669 print $langs->trans(
'PrivateProject');
674 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
675 if (!is_null(
$object->budget_amount) && strcmp(
$object->budget_amount,
'')) {
676 print
'<span class="amount">'.price(
$object->budget_amount, 0, $langs, 1, 0, 0,
$conf->currency).
'</span>';
681 print
'<tr><td>'.$langs->trans(
"Dates").
'</td><td>';
683 print($start ? $start :
'?');
686 print($end ? $end :
'?');
694 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
699 print
'<div class="fichehalfright">';
700 print
'<div class="underbanner clearboth"></div>';
702 print
'<table class="border tableforfield centpercent">';
705 print
'<td class="titlefield tdtop">'.$langs->trans(
"Description").
'</td><td>';
710 if (isModEnabled(
'category')) {
711 print
'<tr><td class="valignmiddle">'.$langs->trans(
"Categories").
'</td><td>';
712 print $form->showCategories(
$object->id, Categorie::TYPE_PROJECT, 1);
721 print
'<div class="clearboth"></div>';
728if ($action ==
'create' && $user->hasRight(
'projet',
'creer') && (empty(
$object->thirdparty->id) || $userWrite > 0)) {
729 if ($id > 0 || !empty($ref)) {
735 $projectoktoentertime = 1;
737 $projectoktoentertime = 0;
738 print
'<div class="warning">';
739 $langs->load(
"errors");
740 print $langs->trans(
"WarningProjectClosed");
745 $projectoktoentertime = 0;
746 print
'<div class="warning">';
747 $langs->load(
"errors");
748 print $langs->trans(
"WarningProjectDraft");
752 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'" method="POST">';
753 print
'<input type="hidden" name="token" value="'.newToken().
'">';
754 print
'<input type="hidden" name="action" value="createtask">';
755 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
757 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
762 print
'<div class="div-table-responsive-no-min">';
763 print
'<table class="border centpercent">';
768 require_once DOL_DOCUMENT_ROOT.
"/core/modules/project/task/" .
getDolGlobalString(
'PROJECT_TASK_ADDON').
'.php';
769 $modTask =
new $classnamemodtask();
770 '@phan-var-force ModeleNumRefTask $modTask';
771 $defaultref = $modTask->getNextValue(
$object->thirdparty, $object);
774 if (is_numeric($defaultref) && $defaultref <= 0) {
779 print
'<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans(
"Ref").
'</span></td><td>';
780 if (empty($duplicate_code_error)) {
781 print(GETPOSTISSET(
"ref") ?
GETPOST(
"ref",
'alpha') : $defaultref);
785 print
'<input type="hidden" name="taskref" value="'.(GETPOSTISSET(
"ref") ?
GETPOST(
"ref",
'alpha') : $defaultref).
'">';
789 print
'<tr><td class="fieldrequired">'.$langs->trans(
"Label").
'</td><td>';
790 print
'<input type="text" name="label" autofocus class="minwidth500" value="'.$label.
'">';
794 print
'<tr><td class="fieldrequired">'.$langs->trans(
"ChildOfProjectTask").
'</td><td>';
795 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
796 if ($projectoktoentertime) {
797 $formother->selectProjectTasks(
GETPOST(
'task_parent'), empty($projectid) ?
$object->id : $projectid,
'task_parent', 0, 0, 1, 1, 0,
'0,1',
'maxwidth500 widthcentpercentminusxx');
799 $formother->selectProjectTasks(
GETPOST(
'task_parent'), empty($projectid) ?
$object->id : $projectid,
'task_parent', 0, 0, 1, 1, 0,
'',
'maxwidth500 widthcentpercentminusxx');
803 $contactsofproject = (empty(
$object->id) ?
'' :
$object->getListContactId(
'internal'));
806 print
'<tr><td>'.$langs->trans(
"AffectedTo").
'</td><td>';
807 print
img_picto(
'',
'user',
'class="pictofixedwidth"');
808 if (is_array($contactsofproject) && count($contactsofproject)) {
809 print $form->select_dolusers($user->id,
'userid', 0,
'', 0,
'', $contactsofproject, 0, 0, 0,
'', 0,
'',
'maxwidth500 widthcentpercentminusx');
811 if ((isset($projectid) && $projectid > 0) ||
$object->id > 0) {
812 print
'<span class="opacitymedium">'.$langs->trans(
"NoUserAssignedToTheProject").
'</span>';
814 print $form->select_dolusers($user->id,
'userid', 0,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth500 widthcentpercentminusx');
820 print
'<tr><td>'.$langs->trans(
"Billable").
'</td><td>';
821 print $form->selectyesno(
'billable');
825 print
'<tr><td>'.$langs->trans(
"DateStart").
'</td><td>';
826 print
img_picto(
'',
'action',
'class="pictofixedwidth"');
827 print $form->selectDate((!empty($date_start) ? $date_start :
''),
'date_start', 1, 1, 0,
'', 1, 1);
831 print
'<tr><td>'.$langs->trans(
"DateEnd").
'</td><td>';
832 print
img_picto(
'',
'action',
'class="pictofixedwidth"');
833 print $form->selectDate((!empty($date_end) ? $date_end : -1),
'date_end', -1, 1, 0,
'', 1, 1);
837 print
'<tr><td>'.$langs->trans(
"PlannedWorkload").
'</td><td>';
838 print
img_picto(
'',
'clock',
'class="pictofixedwidth"');
839 print $form->select_duration(
'planned_workload', $planned_workload, 0,
'text');
843 print
'<tr><td>'.$langs->trans(
"ProgressDeclared").
'</td><td colspan="3">';
844 print
img_picto(
'',
'fa-percent',
'class="pictofixedwidth"');
845 print $formother->select_percent($progress,
'progress', 0, 5, 0, 100, 1);
849 print
'<tr><td class="tdtop">'.$langs->trans(
"Description").
'</td>';
853 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
858 $doleditor =
new DolEditor(
'description',
$object->description,
'', 80,
'dolibarr_details',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), $nbrows,
'90%');
859 print $doleditor->Create();
863 print
'<tr><td>'.$langs->trans(
"Budget").
'</td><td>';
864 print
img_picto(
'',
'currency',
'class="pictofixedwidth"');
865 print
'<input size="8" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOSTISSET(
'budget_amount') ?
GETPOST(
'budget_amount') :
'').
'"></td>';
869 $parameters = array(
'arrayfields' => &$arrayfields);
870 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $taskstatic, $action);
871 print $hookmanager->resPrint;
873 if (empty($reshook) && !empty($extrafields->attributes[$taskstatic->table_element][
'label'])) {
874 print $taskstatic->showOptionals($extrafields,
'edit');
882 print $form->buttonsSaveCancel(
"Add");
885} elseif ($id > 0 || !empty($ref)) {
886 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
893 $linktocreatetaskParam = array();
894 $linktocreatetaskUserRight =
false;
895 if ($user->hasRight(
'projet',
'all',
'creer') || $user->hasRight(
'projet',
'creer')) {
896 if (
$object->public || $userWrite > 0) {
897 $linktocreatetaskUserRight =
true;
899 $linktocreatetaskParam[
'attr'][
'title'] = $langs->trans(
"NotOwnerOfProject");
903 $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);
905 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'">';
906 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
907 print
'<input type="hidden" name="token" value="'.newToken().
'">';
908 print
'<input type="hidden" name="action" value="list">';
909 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
910 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
911 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
912 print
'<input type="hidden" name="page" value="'.$page.
'">';
913 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
915 $title = $langs->trans(
"ListOfTasks");
916 $linktotasks =
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', DOL_URL_ROOT.
'/projet/tasks.php?id='.
$object->id,
'', 1, array(
'morecss' =>
'reposition btnTitleSelected'));
917 $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'));
920 print
load_fiche_titre($title, $linktotasks.
' '.$linktocreatetask,
'projecttask', 0,
'',
'', $massactionbutton);
922 $objecttmp =
new Task($db);
923 $trackid =
'task'.$taskstatic->id;
924 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
928 $filteronthirdpartyid = $socid;
929 $tasksarray = $taskstatic->getTasksArray(0, 0,
$object->id, $filteronthirdpartyid, 0,
'', -1, $morewherefilter, 0, 0, $extrafields, 1, $search_array_options, 1, 1, $sortfield, $sortorder);
932 $tmpuser =
new User($db);
933 if ($search_user_id > 0) {
934 $tmpuser->fetch($search_user_id);
937 $tasksrole = ($tmpuser->id > 0 ? $taskstatic->getUserRolesForProjectsOrTasks(
null, $tmpuser,
$object->id, 0) :
'');
941 if (!empty(
$conf->use_javascript_ajax)) {
942 include DOL_DOCUMENT_ROOT.
'/core/tpl/ajaxrow.tpl.php';
947 $moreforfilter .=
'<div class="divsearchfield">';
948 $moreforfilter .=
img_picto(
'',
'user',
'class="pictofixedwidth"');
949 $moreforfilter .= $form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id :
'',
'search_user_id', $langs->trans(
"TasksAssignedTo"), null, 0,
'',
'');
950 $moreforfilter .=
'</div>';
951 if ($moreforfilter) {
952 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
953 print $moreforfilter;
958 if ($massactionbutton && $contextpage !=
'poslist') {
959 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
962 print
'<div class="div-table-responsive">';
963 print
'<table id="tablelines" class="tagtable nobottom liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">';
966 print
'<tr class="liste_titre_filter">';
970 print
'<td class="liste_titre maxwidthsearch">';
971 $searchpicto = $form->showFilterButtons();
976 if (!empty($arrayfields[
't.ref'][
'checked'])) {
977 print
'<td class="liste_titre">';
978 print
'<input class="flat searchstring maxwidth50" type="text" name="search_taskref" value="'.dol_escape_htmltag($search_taskref).
'">';
982 if (!empty($arrayfields[
't.label'][
'checked'])) {
983 print
'<td class="liste_titre">';
984 print
'<input class="flat searchstring maxwidth100" type="text" name="search_tasklabel" value="'.dol_escape_htmltag($search_tasklabel).
'">';
988 if (!empty($arrayfields[
't.description'][
'checked'])) {
989 print
'<td class="liste_titre">';
990 print
'<input class="flat searchstring maxwidth100" type="text" name="search_taskdescription" value="'.dol_escape_htmltag($search_taskdescription).
'">';
994 if (!empty($arrayfields[
't.dateo'][
'checked'])) {
995 print
'<td class="liste_titre center">';
999 print
'<div class="nowrapfordate">';
1000 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'));
1002 print
'<div class="nowrapfordate">';
1003 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'));
1008 if (!empty($arrayfields[
't.datee'][
'checked'])) {
1009 print
'<td class="liste_titre center">';
1013 print
'<div class="nowrapfordate">';
1014 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'));
1016 print
'<div class="nowrapfordate">';
1017 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'));
1022 if (!empty($arrayfields[
't.planned_workload'][
'checked'])) {
1023 print
'<td class="liste_titre right">';
1024 print
'<input class="flat" type="text" size="4" name="search_planedworkload" value="'.$search_planedworkload.
'">';
1028 if (!empty($arrayfields[
't.duration_effective'][
'checked'])) {
1029 print
'<td class="liste_titre right">';
1030 print
'<input class="flat" type="text" size="4" name="search_timespend" value="'.$search_timespend.
'">';
1034 if (!empty($arrayfields[
't.progress_calculated'][
'checked'])) {
1035 print
'<td class="liste_titre right">';
1036 print
'<input class="flat" type="text" size="4" name="search_progresscalc" value="'.$search_progresscalc.
'">';
1040 if (!empty($arrayfields[
't.progress'][
'checked'])) {
1041 print
'<td class="liste_titre right">';
1042 print
'<input class="flat" type="text" size="4" name="search_progressdeclare" value="'.$search_progressdeclare.
'">';
1047 if (!empty($arrayfields[
't.progress_summary'][
'checked'])) {
1048 print
'<td class="liste_titre right"></td>';
1051 if (
$object->usage_bill_time) {
1052 if (!empty($arrayfields[
't.tobill'][
'checked'])) {
1053 print
'<td class="liste_titre right">';
1057 if (!empty($arrayfields[
't.billed'][
'checked'])) {
1058 print
'<td class="liste_titre right">';
1069 if (!empty($arrayfields[
't.budget_amount'][
'checked'])) {
1070 print
'<td class="liste_titre center">';
1071 print
'<input type="text" class="flat" name="search_task_budget_amount" value="'.$search_task_budget_amount.
'" size="4">';
1075 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1076 print
'<td class="liste_titre right">';
1080 if (!empty($arrayfields[
't.billable'][
'checked'])) {
1081 print
'<td class="liste_titre center">';
1082 print $form->selectyesno(
'search_task_billable', $search_task_billable, 0,
false, 1);
1086 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1089 $parameters = array(
'arrayfields' => $arrayfields);
1090 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1091 print $hookmanager->resPrint;
1093 print
'<td class="liste_titre maxwidthsearch"> </td>';
1097 print
'<td class="liste_titre maxwidthsearch">';
1098 $searchpicto = $form->showFilterButtons();
1105 print
'<tr class="liste_titre nodrag nodrop">';
1108 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1111 if (!empty($arrayfields[
't.ref'][
'checked'])) {
1113 print_liste_field_titre($arrayfields[
't.ref'][
'label'], $_SERVER[
"PHP_SELF"],
't.ref',
'', $param,
'', $sortfield, $sortorder,
'');
1115 if (!empty($arrayfields[
't.label'][
'checked'])) {
1116 print_liste_field_titre($arrayfields[
't.label'][
'label'], $_SERVER[
"PHP_SELF"],
"t.label",
'', $param,
'', $sortfield, $sortorder,
'');
1118 if (!empty($arrayfields[
't.description'][
'checked'])) {
1119 print_liste_field_titre($arrayfields[
't.description'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'');
1121 if (!empty($arrayfields[
't.dateo'][
'checked'])) {
1122 print_liste_field_titre($arrayfields[
't.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"t.dateo",
'', $param,
'', $sortfield, $sortorder,
'center ');
1124 if (!empty($arrayfields[
't.datee'][
'checked'])) {
1125 print_liste_field_titre($arrayfields[
't.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"t.datee",
'', $param,
'', $sortfield, $sortorder,
'center ');
1127 if (!empty($arrayfields[
't.planned_workload'][
'checked'])) {
1128 print_liste_field_titre($arrayfields[
't.planned_workload'][
'label'], $_SERVER[
"PHP_SELF"],
"t.planned_workload",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1130 if (!empty($arrayfields[
't.duration_effective'][
'checked'])) {
1131 print_liste_field_titre($arrayfields[
't.duration_effective'][
'label'], $_SERVER[
"PHP_SELF"],
"t.duration_effective",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1133 if (!empty($arrayfields[
't.progress_calculated'][
'checked'])) {
1134 print_liste_field_titre($arrayfields[
't.progress_calculated'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1136 if (!empty($arrayfields[
't.progress'][
'checked'])) {
1137 print_liste_field_titre($arrayfields[
't.progress'][
'label'], $_SERVER[
"PHP_SELF"],
"t.progress",
'', $param,
'', $sortfield, $sortorder,
'right ',
'', 1);
1139 if (!empty($arrayfields[
't.progress_summary'][
'checked'])) {
1140 print_liste_field_titre($arrayfields[
't.progress_summary'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'', 1);
1142 if (
$object->usage_bill_time) {
1143 if (!empty($arrayfields[
't.tobill'][
'checked'])) {
1144 print_liste_field_titre($arrayfields[
't.tobill'][
'label'], $_SERVER[
"PHP_SELF"],
"t.tobill",
'', $param,
'', $sortfield, $sortorder,
'right ');
1146 if (!empty($arrayfields[
't.billed'][
'checked'])) {
1147 print_liste_field_titre($arrayfields[
't.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"t.billed",
'', $param,
'', $sortfield, $sortorder,
'right ');
1157 if (!empty($arrayfields[
't.budget_amount'][
'checked'])) {
1158 print_liste_field_titre($arrayfields[
't.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
"t.budget_amount",
"", $param,
'', $sortfield, $sortorder,
'center ');
1161 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1162 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1165 if (!empty($arrayfields[
't.billable'][
'checked'])) {
1166 print_liste_field_titre($arrayfields[
't.billable'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1169 $disablesortlink = 1;
1170 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1172 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
1173 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1174 print $hookmanager->resPrint;
1178 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1183 if (count($tasksarray) > 0) {
1187 $nboftaskshown =
projectLinesa($j, 0, $tasksarray, $level,
'', 0, $tasksrole, (
string)
$object->id, 1,
$object->id,
'', (
$object->usage_bill_time ? 1 : 0), $arrayfields, $arrayofselected);
1189 $colspan = count($arrayfields);
1190 if (
$object->usage_bill_time) {
1193 print
'<tr class="oddeven"><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoTasks").
'</span></td></tr>';
1204 if ($user->hasRight(
'projet',
'all',
'lire')) {
1205 if ($search_user_id == $user->id) {
1206 if ($nboftaskshown < count($tasksrole)) {
1207 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1211 if ($nboftaskshown < count($tasksarray) && !
GETPOSTINT(
'search_user_id')) {
1212 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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...)
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).
cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent)
Clean corrupted database tree (orphelins linked to a not existing parent), record linked to themself,...
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...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
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.
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...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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...
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.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
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...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0, $dummy='', $showbilltime=0, $arrayfields=array(), $arrayofselected=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.