27 require
"../../main.inc.php";
28 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
38 $langs->loadLangs(array(
'projects',
'users',
'companies'));
39 $hookmanager->initHooks(array(
'timesheetpermonthcard'));
41 $action =
GETPOST(
'action',
'aZ09');
42 $mode =
GETPOST(
"mode",
'alpha');
44 $taskid =
GETPOST(
'taskid',
'int');
47 if ($mode ==
'mine') $mine = 1;
49 $projectid = isset($_GET[
"id"]) ?
GETPOST(
"id",
"int", 1) :
GETPOST(
"projectid",
"int");
59 $nowday = $nowtmp[
'mday'];
60 $nowmonth = $nowtmp[
'mon'];
61 $nowyear = $nowtmp[
'year'];
67 $week =
GETPOST(
"week",
"int") ?
GETPOST(
"week",
"int") : date(
"W");
69 $search_categ =
GETPOST(
"search_categ",
'alpha');
70 $search_usertoprocessid =
GETPOST(
'search_usertoprocessid',
'int');
71 $search_task_ref =
GETPOST(
'search_task_ref',
'alpha');
72 $search_task_label =
GETPOST(
'search_task_label',
'alpha');
73 $search_project_ref =
GETPOST(
'search_project_ref',
'alpha');
74 $search_thirdparty =
GETPOST(
'search_thirdparty',
'alpha');
75 $search_declared_progress =
GETPOST(
'search_declared_progress',
'alpha');
79 $prev = $startdayarray;
80 $prev_year = $prev[
'year'];
81 $prev_month = $prev[
'month'];
85 $next_year = $next[
'year'];
86 $next_month = $next[
'month'];
89 $firstdaytoshow =
dol_mktime(0, 0, 0, $month, 1, $year);
91 $TFirstDays[reset($TWeek)] =
'01';
93 $TLastDays[end($TWeek)] = date(
"t", strtotime($year.
'-'.$month.
'-'.$day));
94 if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id)
96 $usertoprocess = $user;
97 $search_usertoprocessid = $usertoprocess->id;
98 } elseif ($search_usertoprocessid > 0)
100 $usertoprocess =
new User($db);
101 $usertoprocess->fetch($search_usertoprocessid);
102 $search_usertoprocessid = $usertoprocess->id;
104 $usertoprocess =
new User($db);
107 $object =
new Task($db);
113 $parameters = array(
'id' => $id,
'taskid' => $taskid,
'projectid' => $projectid,
'TWeek' => $TWeek,
'TFirstDays' => $TFirstDays,
'TLastDays' => $TLastDays);
114 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
115 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
118 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
122 $search_usertoprocessid = $user->id;
123 $search_task_ref =
'';
124 $search_task_label =
'';
125 $search_project_ref =
'';
126 $search_thirdparty =
'';
127 $search_declared_progress =
'';
129 if (
GETPOST(
"button_search_x",
'alpha') ||
GETPOST(
"button_search.x",
'alpha') ||
GETPOST(
"button_search",
'alpha'))
134 if (
GETPOST(
'submitdateselect'))
140 if ($action ==
'addtime' && $user->rights->projet->lire &&
GETPOST(
'assigntask'))
142 $action =
'assigntask';
146 $result = $object->fetch($taskid, $ref);
147 if ($result < 0) $error++;
149 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Task")),
'',
'errors');
154 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
'',
'errors');
160 $idfortaskuser = $usertoprocess->id;
161 $result = $object->add_contact($idfortaskuser,
GETPOST(
"type"),
'internal');
163 if ($result >= 0 || $result == -2)
166 $sql =
'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.
'element_contact as ec, '.MAIN_DB_PREFIX.
'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact';
167 $sql .=
' AND ec.fk_socpeople = '.$idfortaskuser.
" AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'";
168 $resql = $db->query($sql);
171 $obj = $db->fetch_object(
$resql);
175 $project->fetch($object->fk_project);
177 $listofprojcontact = $project->liste_type_contact(
'internal');
179 if (count($listofprojcontact))
181 $typeforprojectcontact = reset(array_keys($listofprojcontact));
182 $result = $project->add_contact($idfortaskuser, $typeforprojectcontact,
'internal');
194 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS')
196 $langs->load(
"errors");
197 setEventMessages($langs->trans(
"ErrorTaskAlreadyAssigned"), null,
'warnings');
212 if ($action ==
'addtime' && $user->rights->projet->lire)
214 $timetoadd = $_POST[
'task'];
215 if (empty($timetoadd))
219 foreach ($timetoadd as $taskid => $value)
221 $updateoftaskdone = 0;
222 foreach ($value as $key => $val)
224 $amountoadd = $timetoadd[$taskid][$key];
225 if (!empty($amountoadd))
227 $tmpduration = explode(
':', $amountoadd);
229 if (!empty($tmpduration[0])) $newduration += ($tmpduration[0] * 3600);
230 if (!empty($tmpduration[1])) $newduration += ($tmpduration[1] * 60);
231 if (!empty($tmpduration[2])) $newduration += ($tmpduration[2]);
233 if ($newduration > 0)
235 $object->fetch($taskid);
236 $object->progress =
GETPOST($taskid.
'progress',
'int');
237 $object->timespent_duration = $newduration;
238 $object->timespent_fk_user = $usertoprocess->id;
240 $object->timespent_datehour = $object->timespent_date;
242 $result = $object->addTimeSpent($user);
255 if (!$updateoftaskdone)
257 $object->fetch($taskid);
259 if ($object->progress !=
GETPOST($taskid.
'progress',
'int'))
261 $object->progress =
GETPOST($taskid.
'progress',
'int');
262 $result = $object->update($user);
278 $param .= ($mode ?
'&mode='.$mode :
'');
279 $param .= ($projectid ?
'id='.$projectid :
'');
280 $param .= ($search_usertoprocessid ?
'&search_usertoprocessid='.$search_usertoprocessid :
'');
281 $param .= ($day ?
'&day='.$day :
'').($month ?
'&month='.$month :
'').($year ?
'&year='.$year :
'');
282 $param .= ($search_project_ref ?
'&search_project_ref='.$search_project_ref :
'');
283 $param .= ($search_usertoprocessid > 0 ?
'&search_usertoprocessid='.$search_usertoprocessid :
'');
284 $param .= ($search_thirdparty ?
'&search_thirdparty='.$search_thirdparty :
'');
285 $param .= ($search_declared_progress ?
'&search_declared_progress='.$search_declared_progress :
'');
286 $param .= ($search_task_ref ?
'&search_task_ref='.$search_task_ref :
'');
287 $param .= ($search_task_label ?
'&search_task_label='.$search_task_label :
'');
290 header(
'Location: '.
$_SERVER[
"PHP_SELF"].
'?'.$param);
302 $form =
new Form($db);
306 $projectstatic =
new Project($db);
308 $taskstatic =
new Task($db);
309 $thirdpartystatic =
new Societe($db);
312 $title = $langs->trans(
"TimeSpent");
314 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertoprocess, (empty($usertoprocess->id) ? 2 : 0), 1);
318 $project->fetch($id);
319 $project->fetch_thirdparty();
322 $onlyopenedproject = 1;
323 $morewherefilter =
'';
325 if ($search_project_ref) $morewherefilter .=
natural_search(array(
"p.ref",
"p.title"), $search_project_ref);
326 if ($search_task_ref) $morewherefilter .=
natural_search(
"t.ref", $search_task_ref);
327 if ($search_task_label) $morewherefilter .=
natural_search(array(
"t.ref",
"t.label"), $search_task_label);
328 if ($search_thirdparty) $morewherefilter .=
natural_search(
"s.nom", $search_thirdparty);
329 if ($search_declared_progress) $morewherefilter .=
natural_search(
"t.progress", $search_declared_progress, 1);
331 $tasksarray = $taskstatic->getTasksArray(0, 0, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0));
332 if ($morewherefilter)
334 $tasksarraywithoutfilter = $taskstatic->getTasksArray(0, 0, ($project->id ? $project->id : 0), $socid, 0,
'', $onlyopenedproject,
'', ($search_usertoprocessid ? $search_usertoprocessid : 0));
336 $projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, 0, ($project->id ? $project->id : 0), 0, $onlyopenedproject);
337 $tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($project->id ? $project->id : 0), 0, $onlyopenedproject);
343 llxHeader(
"", $title,
"",
'',
'',
'', array(
'/core/js/timesheet.js'));
348 $param .= ($mode ?
'&mode='.$mode :
'');
349 $param .= ($search_project_ref ?
'&search_project_ref='.$search_project_ref :
'');
350 $param .= ($search_usertoprocessid > 0 ?
'&search_usertoprocessid='.$search_usertoprocessid :
'');
351 $param .= ($search_thirdparty ?
'&search_thirdparty='.$search_thirdparty :
'');
352 $param .= ($search_task_ref ?
'&search_task_ref='.$search_task_ref :
'');
353 $param .= ($search_task_label ?
'&search_task_label='.$search_task_label :
'');
356 $nav =
'<a class="inline-block valignmiddle" href="?year='.$prev_year.
"&month=".$prev_month.
"&day=".$prev_day.$param.
'">'.
img_previous($langs->trans(
"Previous")).
"</a>\n";
357 $nav .=
" <span id=\"month_name\">".dol_print_date(
dol_mktime(0, 0, 0, $month, 1, $year),
"%Y").
", ".$langs->trans(date(
'F', mktime(0, 0, 0, $month, 10))).
" </span>\n";
358 $nav .=
'<a class="inline-block valignmiddle" href="?year='.$next_year.
"&month=".$next_month.
"&day=".$next_day.$param.
'">'.
img_next($langs->trans(
"Next")).
"</a>\n";
360 $nav .=
' '.$form->selectDate(-1,
'', 0, 0, 2,
"addtime", 1, 1).
' ';
362 $nav .=
' <button type="submit" name="button_search_x" value="x" class="bordertransp"><span class="fa fa-search"></span></button>';
366 print '<form name="addtime" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
367 print '<input type="hidden" name="token" value="'.newToken().
'">';
368 print '<input type="hidden" name="action" value="addtime">';
369 print '<input type="hidden" name="mode" value="'.$mode.
'">';
370 print '<input type="hidden" name="day" value="'.$day.
'">';
371 print '<input type="hidden" name="month" value="'.$month.
'">';
372 print '<input type="hidden" name="year" value="'.$year.
'">';
378 print '<div class="hideonsmartphone opacitymedium">';
379 if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans(
"MyTasksDesc").
'.'.($onlyopenedproject ?
' '.$langs->trans(
"OnlyOpenedProject") :
'').
'<br>';
381 if (empty($usertoprocess->id) || $usertoprocess->id < 0)
383 if ($user->rights->projet->all->lire && !$socid) print $langs->trans(
"ProjectsDesc").
'.'.($onlyopenedproject ?
' '.$langs->trans(
"OnlyOpenedProject") :
'').
'<br>';
384 else print $langs->trans(
"ProjectsPublicTaskDesc").
'.'.($onlyopenedproject ?
' '.$langs->trans(
"OnlyOpenedProject") :
'').
'<br>';
387 if ($mine || ($usertoprocess->id == $user->id))
389 print $langs->trans(
"OnlyYourTaskAreVisible").
'<br>';
391 print $langs->trans(
"AllTaskVisibleButEditIfYouAreAssigned").
'<br>';
397 print
'<div class="floatright right'.($conf->dol_optimize_smallscreen ?
' centpercent' :
'').
'">'.$nav.
'</div>';
399 print
'<div class="colorbacktimesheet float valignmiddle">';
400 $titleassigntask = $langs->transnoentities(
"AssignTaskToMe");
401 if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities(
"AssignTaskToUser", $usertoprocess->getFullName($langs));
402 print
'<div class="taskiddiv inline-block">';
404 $formproject->selectTasks($socid ? $socid : -1, $taskid,
'taskid', 32, 0,
'-- '.$langs->trans(
"ChooseANotYetAssignedTask").
' --', 1);
407 print $formcompany->selectTypeContact($object,
'',
'type',
'internal',
'rowid', 0,
'maxwidth150onsmartphone');
408 print
'<input type="submit" class="button valignmiddle" name="assigntask" value="'.dol_escape_htmltag($titleassigntask).
'">';
411 print
'<div class="clearboth" style="padding-bottom: 20px;"></div>';
428 $moreforfilter .=
'<div class="divsearchfield">';
429 $moreforfilter .=
'<div class="inline-block hideonsmartphone"></div>';
430 $includeonly =
'hierachyme';
431 if (empty($user->rights->user->user->lire)) $includeonly = array($user->id);
432 $moreforfilter .=
img_picto($langs->trans(
'User'),
'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id,
'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0,
'', 0,
'',
'maxwidth200');
433 $moreforfilter .=
'</div>';
435 if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT))
437 $moreforfilter .=
'<div class="divsearchfield">';
438 $moreforfilter .=
'<div class="inline-block"></div>';
439 $moreforfilter .=
img_picto($langs->trans(
'Project'),
'project').
'<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.
dol_escape_htmltag($search_project_ref).
'">';
440 $moreforfilter .=
'</div>';
442 $moreforfilter .=
'<div class="divsearchfield">';
443 $moreforfilter .=
'<div class="inline-block"></div>';
444 $moreforfilter .=
img_picto($langs->trans(
'ThirdParty'),
'company').
'<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.
dol_escape_htmltag($search_thirdparty).
'">';
445 $moreforfilter .=
'</div>';
448 if (!empty($moreforfilter))
450 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
451 print $moreforfilter;
452 $parameters = array();
453 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
454 print $hookmanager->resPrint;
458 print
'<div class="div-table-responsive">';
460 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'" id="tablelines3">'.
"\n";
462 print
'<tr class="liste_titre_filter">';
463 if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print
'<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.
dol_escape_htmltag($search_project_ref).
'"></td>';
464 if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print
'<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.
dol_escape_htmltag($search_thirdparty).
'"></td>';
465 print
'<td class="liste_titre"><input type="text" size="4" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).
'"></td>';
466 print
'<td class="liste_titre"></td>';
467 print
'<td class="liste_titre right"><input type="text" size="4" name="search_declared_progress" value="'.dol_escape_htmltag($search_declared_progress).
'"></td>';
468 print
'<td class="liste_titre"></td>';
469 print
'<td class="liste_titre"></td>';
470 foreach ($TWeek as $week_number)
472 print
'<td class="liste_titre"></td>';
475 print
'<td class="liste_titre nowrap" align="right">';
476 $searchpicto = $form->showFilterAndCheckAddButtons(0);
481 print
'<tr class="liste_titre">';
482 if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print
'<td>'.$langs->trans(
"Project").
'</td>';
483 if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print
'<td>'.$langs->trans(
"ThirdParty").
'</td>';
484 print
'<td>'.$langs->trans(
"Task").
'</td>';
485 print
'<td align="right" class="leftborder plannedworkload maxwidth75">'.$langs->trans(
"PlannedWorkload").
'</td>';
486 print
'<td align="right" class="maxwidth75">'.$langs->trans(
"ProgressDeclared").
'</td>';
490 print
'<td align="right" class="maxwidth75">'.$langs->trans(
"TimeSpent").
'<br><span class="opacitymedium">'.$langs->trans(
"Everybody").
'</span></td>';
491 print
'<td align="right" class="maxwidth75">'.$langs->trans(
"TimeSpent").($usertoprocess->firstname ?
'<br><span class="opacitymedium">'.dol_trunc($usertoprocess->firstname, 10).
'</span>' :
'').
'</td>';
493 foreach ($TWeek as $week_number)
495 print
'<td width="6%" align="center" class="bold hide">'.$langs->trans(
"Week").
' '.$week_number.
'<br>('.$TFirstDays[$week_number].
'...'.$TLastDays[$week_number].
')</td>';
503 $restrictviewformytask = (empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED) ? 1 : 0);
506 $isavailable = array();
510 if (count($tasksarray) > 0)
518 $totalforvisibletasks =
projectLinesPerMonth($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable, 0, $TWeek);
524 $listofdistinctprojectid = array();
525 if (is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter))
527 foreach ($tasksarraywithoutfilter as $tmptask)
529 $listofdistinctprojectid[$tmptask->fk_project] = $tmptask->fk_project;
533 $totalforeachweek = array();
534 foreach ($listofdistinctprojectid as $tmpprojectid)
536 $projectstatic->id = $tmpprojectid;
537 $projectstatic->loadTimeSpentMonth($firstdaytoshow, 0, $usertoprocess->id);
538 foreach ($TWeek as $weekNb)
540 $totalforeachweek[$weekNb] += $projectstatic->monthWorkLoad[$weekNb];
549 if (count($totalforeachweek))
551 foreach ($TWeek as $weekNb)
553 $timeonothertasks = ($totalforeachweek[$weekNb] - $totalforvisibletasks[$weekNb]);
554 if ($timeonothertasks)
565 print
'<tr class="oddeven othertaskwithtime">';
566 print
'<td colspan="'.$colspan.
'" class="opacitymedium">';
567 print $langs->trans(
"OtherFilteredTasks");
569 foreach ($TWeek as $weekNb)
571 print
'<td class="center hide">';
573 $timeonothertasks = ($totalforeachweek[$weekNb] - $totalforvisibletasks[$weekNb]);
574 if ($timeonothertasks)
576 print
'<span class="timesheetalreadyrecorded" title="texttoreplace"><input type="text" class="center smallpadd" size="2" disabled="" id="timespent[-1]['.$weekNb.
']" name="task[-1]['.$weekNb.
']" value="';
582 print
' <td class="liste_total"></td>';
586 if ($conf->use_javascript_ajax)
588 print
'<tr class="liste_total">
589 <td class="liste_total" colspan="'.$colspan.
'">';
590 print $langs->trans(
"Total");
591 print
'<span class="opacitymediumbycolor"> - '.$langs->trans(
"ExpectedWorkedHours").
': <strong>'.
price($usertoprocess->weeklyhours, 1, $langs, 0, 0).
'</strong></span>';
594 foreach ($TWeek as $weekNb)
596 print
'<td class="liste_total hide'.$weekNb.
'" align="center"><div class="totalDay'.$weekNb.
'">'.
convertSecondToTime($totalforvisibletasks[$weekNb],
'allhourmin').
'</div></td>';
598 print
'<td class="liste_total center"><div class="totalDayAll"> </div></td>
602 print
'<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans(
"NoAssignedTasks").
'</span></td></tr>';
607 print
'<input type="hidden" id="numberOfLines" name="numberOfLines" value="'.count($tasksarray).
'"/>'.
"\n";
608 print
'<input type="hidden" id="numberOfFirstLine" name="numberOfFirstLine" value="'.(reset($TWeek)).
'"/>'.
"\n";
610 print
'<div class="center">';
611 print
'<input type="submit" class="button button-save" name="save" value="'.dol_escape_htmltag($langs->trans(
"Save")).
'">';
614 print
'</form>'.
"\n\n";
616 $modeinput =
'hours';
618 if ($conf->use_javascript_ajax)
620 print
"\n<!-- JS CODE TO ENABLE Tooltips on all object with class classfortooltip -->\n";
621 print
'<script type="text/javascript">'.
"\n";
622 print
"jQuery(document).ready(function () {\n";
623 print
' jQuery(".timesheetalreadyrecorded").tooltip({
624 show: { collision: "flipfit", effect:\'toggle\', delay:50 },
625 hide: { effect:\'toggle\', delay: 50 },
626 tooltipClass: "mytooltip",
627 content: function () {
628 return \''.dol_escape_js($langs->trans(
"TimeAlreadyRecorded", $usertoprocess->getFullName($langs))).
'\';
632 foreach ($TWeek as $week_number)
634 print ' updateTotal(
'.$week_number.',\
''.$modeinput.
'\');
';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class of the module paid holiday.
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...
dol_get_prev_month($month, $year)
Return previous month.
dol_now($mode= 'auto')
Return date for now.
Class to manage Dolibarr users.
getFirstDayOfEachWeek($TWeek, $year)
Return array of first day of weeks.
getWeekNumbersOfMonth($month, $year)
Return array of week numbers.
getLastDayOfEachWeek($TWeek, $year)
Return array of last day of weeks.
price($amount, $form=0, $outlangs= '', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code= '')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage projects.
dol_get_next_month($month, $year)
Return next month.
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_getdate($timestamp, $fast=false, $forcetimezone= '')
Return an array with locale date info.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
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...
print $_SERVER["PHP_SELF"]
Edit parameters.
img_next($titlealt= 'default', $moreatt= '')
Show next logo.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
img_previous($titlealt= 'default', $moreatt= '')
Show previous logo.
projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak=0, $TWeek=array())
Output a task line into a perday intput mode.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
project_timesheet_prepare_head($mode, $fuser=null)
Prepare array with list of tabs.
dol_time_plus_duree($time, $duration_value, $duration_unit)
Add a delay to a date.
convertSecondToTime($iSecond, $format= 'all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...