27require
"../../main.inc.php";
28require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
35require_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');
51$projectid = GETPOSTISSET(
"id") ?
GETPOST(
"id",
"int", 1) :
GETPOST(
"projectid",
"int");
68$search_usertoprocessid =
GETPOST(
'search_usertoprocessid',
'int');
69$search_task_ref =
GETPOST(
'search_task_ref',
'alpha');
70$search_task_label =
GETPOST(
'search_task_label',
'alpha');
71$search_project_ref =
GETPOST(
'search_project_ref',
'alpha');
72$search_thirdparty =
GETPOST(
'search_thirdparty',
'alpha');
73$search_declared_progress =
GETPOST(
'search_declared_progress',
'alpha');
77$prev = $startdayarray;
78$prev_year = $prev[
'year'];
79$prev_month = $prev[
'month'];
83$next_year = $next[
'year'];
84$next_month = $next[
'month'];
87$firstdaytoshow =
dol_mktime(0, 0, 0, $month, 1, $year);
89$TFirstDays[reset($TWeek)] =
'01';
91$TLastDays[end($TWeek)] = date(
"t", strtotime($year.
'-'.$month.
'-'.$day));
92if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id) {
93 $usertoprocess = $user;
94 $search_usertoprocessid = $usertoprocess->id;
95} elseif ($search_usertoprocessid > 0) {
96 $usertoprocess =
new User($db);
97 $usertoprocess->fetch($search_usertoprocessid);
98 $search_usertoprocessid = $usertoprocess->id;
100 $usertoprocess =
new User($db);
103$object =
new Task($db);
111$parameters = array(
'id' => $id,
'taskid' => $taskid,
'projectid' => $projectid,
'TWeek' => $TWeek,
'TFirstDays' => $TFirstDays,
'TLastDays' => $TLastDays);
112$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
118if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
121 $search_usertoprocessid = $user->id;
122 $search_task_ref =
'';
123 $search_task_label =
'';
124 $search_project_ref =
'';
125 $search_thirdparty =
'';
126 $search_declared_progress =
'';
128if (
GETPOST(
"button_search_x",
'alpha') ||
GETPOST(
"button_search.x",
'alpha') ||
GETPOST(
"button_search",
'alpha')) {
132if (
GETPOST(
'submitdateselect')) {
137if ($action ==
'addtime' && $user->rights->projet->lire &&
GETPOST(
'assigntask')) {
138 $action =
'assigntask';
141 $result = $object->fetch($taskid, $ref);
146 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Task")),
null,
'errors');
150 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
155 $idfortaskuser = $usertoprocess->id;
156 $result = $object->add_contact($idfortaskuser,
GETPOST(
"type"),
'internal');
158 if ($result >= 0 || $result == -2) {
160 $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';
161 $sql .=
' AND ec.fk_socpeople = '.((int) $idfortaskuser).
" AND ec.element_id = ".((int) $object->fk_project).
" AND tc.element = 'project' AND source = 'internal'";
162 $resql = $db->query($sql);
164 $obj = $db->fetch_object($resql);
167 $project->fetch($object->fk_project);
169 $listofprojcontact = $project->liste_type_contact(
'internal');
171 if (count($listofprojcontact)) {
172 $tmparray = array_keys($listofprojcontact);
173 $typeforprojectcontact = reset($tmparray);
174 $result = $project->add_contact($idfortaskuser, $typeforprojectcontact,
'internal');
185 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
186 $langs->load(
"errors");
187 setEventMessages($langs->trans(
"ErrorTaskAlreadyAssigned"),
null,
'warnings');
201if ($action ==
'addtime' && $user->rights->projet->lire) {
203 if (empty($timetoadd)) {
206 foreach ($timetoadd as $tmptaskid => $tmpvalue) {
207 $updateoftaskdone = 0;
208 foreach ($tmpvalue as $key => $val) {
209 $amountoadd = $timetoadd[$tmptaskid][$key];
210 if (!empty($amountoadd)) {
211 $tmpduration = explode(
':', $amountoadd);
213 if (!empty($tmpduration[0])) {
214 $newduration += ($tmpduration[0] * 3600);
216 if (!empty($tmpduration[1])) {
217 $newduration += ($tmpduration[1] * 60);
219 if (!empty($tmpduration[2])) {
220 $newduration += ($tmpduration[2]);
223 if ($newduration > 0) {
224 $object->fetch($tmptaskid);
225 $object->progress =
GETPOST($tmptaskid.
'progress',
'int');
226 $object->timespent_duration = $newduration;
227 $object->timespent_fk_user = $usertoprocess->id;
229 $object->timespent_datehour = $object->timespent_date;
231 $result = $object->addTimeSpent($user);
243 if (!$updateoftaskdone) {
244 $object->fetch($tmptaskid);
247 if ($object->progress !=
GETPOST($tmptaskid.
'progress',
'int')) {
248 $object->progress =
GETPOST($tmptaskid.
'progress',
'int');
249 $result = $object->update($user);
263 $param .= ($mode ?
'&mode='.$mode :
'');
264 $param .= ($projectid ?
'id='.$projectid :
'');
265 $param .= ($search_usertoprocessid ?
'&search_usertoprocessid='.$search_usertoprocessid :
'');
266 $param .= ($day ?
'&day='.$day :
'').($month ?
'&month='.$month :
'').($year ?
'&year='.$year :
'');
267 $param .= ($search_project_ref ?
'&search_project_ref='.$search_project_ref :
'');
268 $param .= ($search_usertoprocessid > 0 ?
'&search_usertoprocessid='.$search_usertoprocessid :
'');
269 $param .= ($search_thirdparty ?
'&search_thirdparty='.$search_thirdparty :
'');
270 $param .= ($search_declared_progress ?
'&search_declared_progress='.$search_declared_progress :
'');
271 $param .= ($search_task_ref ?
'&search_task_ref='.$search_task_ref :
'');
272 $param .= ($search_task_label ?
'&search_task_label='.$search_task_label :
'');
275 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?'.$param);
287$form =
new Form($db);
291$projectstatic =
new Project($db);
293$taskstatic =
new Task($db);
294$thirdpartystatic =
new Societe($db);
297$title = $langs->trans(
"TimeSpent");
299$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertoprocess, (empty($usertoprocess->id) ? 2 : 0), 1);
302 $project->fetch($id);
303 $project->fetch_thirdparty();
306$onlyopenedproject = 1;
307$morewherefilter =
'';
309if ($search_project_ref) {
310 $morewherefilter .=
natural_search(array(
"p.ref",
"p.title"), $search_project_ref);
312if ($search_task_ref) {
315if ($search_task_label) {
316 $morewherefilter .=
natural_search(array(
"t.ref",
"t.label"), $search_task_label);
318if ($search_thirdparty) {
321if ($search_declared_progress) {
322 $morewherefilter .=
natural_search(
"t.progress", $search_declared_progress, 1);
325$tasksarray = $taskstatic->getTasksArray(0, 0, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0));
326if ($morewherefilter) {
327 $tasksarraywithoutfilter = $taskstatic->getTasksArray(0, 0, ($project->id ? $project->id : 0), $socid, 0,
'', $onlyopenedproject,
'', ($search_usertoprocessid ? $search_usertoprocessid : 0));
329$projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess,
null, ($project->id ? $project->id : 0), 0, $onlyopenedproject);
330$tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(
null, $usertoprocess, ($project->id ? $project->id : 0), 0, $onlyopenedproject);
336llxHeader(
"", $title,
"",
'',
'',
'', array(
'/core/js/timesheet.js'));
341$param .= ($mode ?
'&mode='.urlencode($mode) :
'');
342$param .= ($search_project_ref ?
'&search_project_ref='.urlencode($search_project_ref) :
'');
343$param .= ($search_usertoprocessid > 0 ?
'&search_usertoprocessid='.urlencode($search_usertoprocessid) :
'');
344$param .= ($search_thirdparty ?
'&search_thirdparty='.urlencode($search_thirdparty) :
'');
345$param .= ($search_task_ref ?
'&search_task_ref='.urlencode($search_task_ref) :
'');
346$param .= ($search_task_label ?
'&search_task_label='.urlencode($search_task_label) :
'');
349$nav =
'<a class="inline-block valignmiddle" href="?year='.$prev_year.
"&month=".$prev_month.
"&day=".$prev_day.$param.
'">'.
img_previous($langs->trans(
"Previous")).
"</a>\n";
350$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";
351$nav .=
'<a class="inline-block valignmiddle" href="?year='.$next_year.
"&month=".$next_month.
"&day=".$next_day.$param.
'">'.
img_next($langs->trans(
"Next")).
"</a>\n";
352$nav .=
' '.$form->selectDate(-1,
'', 0, 0, 2,
"addtime", 1, 1).
' ';
353$nav .=
' <button type="submit" name="button_search_x" value="x" class="bordertransp nobordertransp button_search_x"><span class="fa fa-search"></span></button>';
357print
'<form name="addtime" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
358print
'<input type="hidden" name="token" value="'.newToken().
'">';
359print
'<input type="hidden" name="action" value="addtime">';
360print
'<input type="hidden" name="mode" value="'.$mode.
'">';
361print
'<input type="hidden" name="day" value="'.$day.
'">';
362print
'<input type="hidden" name="month" value="'.$month.
'">';
363print
'<input type="hidden" name="year" value="'.$year.
'">';
366print
dol_get_fiche_head($head,
'inputpermonth', $langs->trans(
'TimeSpent'), -1, $picto);
369print
'<div class="hideonsmartphone opacitymedium">';
370if ($mine || ($usertoprocess->id == $user->id)) {
371 print $langs->trans(
"MyTasksDesc").
'.'.($onlyopenedproject ?
' '.$langs->trans(
"OnlyOpenedProject") :
'').
'<br>';
373 if (empty($usertoprocess->id) || $usertoprocess->id < 0) {
374 if ($user->rights->projet->all->lire && !$socid) {
375 print $langs->trans(
"ProjectsDesc").
'.'.($onlyopenedproject ?
' '.$langs->trans(
"OnlyOpenedProject") :
'').
'<br>';
377 print $langs->trans(
"ProjectsPublicTaskDesc").
'.'.($onlyopenedproject ?
' '.$langs->trans(
"OnlyOpenedProject") :
'').
'<br>';
381if ($mine || ($usertoprocess->id == $user->id)) {
382 print $langs->trans(
"OnlyYourTaskAreVisible").
'<br>';
384 print $langs->trans(
"AllTaskVisibleButEditIfYouAreAssigned").
'<br>';
390print
'<div class="floatright right'.($conf->dol_optimize_smallscreen ?
' centpercent' :
'').
'">'.$nav.
'</div>';
392print
'<div class="colorbacktimesheet float valignmiddle">';
393$titleassigntask = $langs->transnoentities(
"AssignTaskToMe");
394if ($usertoprocess->id != $user->id) {
395 $titleassigntask = $langs->transnoentities(
"AssignTaskToUser", $usertoprocess->getFullName($langs));
397print
'<div class="taskiddiv inline-block">';
398print
img_picto(
'',
'projecttask',
'class="pictofixedwidth"');
399$formproject->selectTasks($socid ? $socid : -1, $taskid,
'taskid', 32, 0,
'-- '.$langs->trans(
"ChooseANotYetAssignedTask").
' --', 1);
402print $formcompany->selectTypeContact($object,
'',
'type',
'internal',
'position', 0,
'maxwidth150onsmartphone');
403print
'<input type="submit" class="button valignmiddle smallonsmartphone small" name="assigntask" value="'.dol_escape_htmltag($titleassigntask).
'">';
406print
'<div class="clearboth" style="padding-bottom: 20px;"></div>';
422$moreforfilter .=
'<div class="divsearchfield">';
423$moreforfilter .=
'<div class="inline-block hideonsmartphone"></div>';
424$includeonly =
'hierarchyme';
425if (empty($user->rights->user->user->lire)) {
426 $includeonly = array($user->id);
428$moreforfilter .=
img_picto($langs->trans(
'Filter').
' '.$langs->trans(
'User'),
'user',
'class="paddingright pictofixedwidth"').$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');
429$moreforfilter .=
'</div>';
431if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
432 $moreforfilter .=
'<div class="divsearchfield">';
433 $moreforfilter .=
'<div class="inline-block"></div>';
434 $moreforfilter .=
img_picto($langs->trans(
'Filter').
' '.$langs->trans(
'Project'),
'project',
'class="paddingright pictofixedwidth"').
'<input type="text" name="search_project_ref" class="maxwidth100" value="'.
dol_escape_htmltag($search_project_ref).
'">';
435 $moreforfilter .=
'</div>';
437 $moreforfilter .=
'<div class="divsearchfield">';
438 $moreforfilter .=
'<div class="inline-block"></div>';
439 $moreforfilter .=
img_picto($langs->trans(
'Filter').
' '.$langs->trans(
'ThirdParty'),
'company',
'class="paddingright pictofixedwidth"').
'<input type="text" name="search_thirdparty" class="maxwidth100" value="'.
dol_escape_htmltag($search_thirdparty).
'">';
440 $moreforfilter .=
'</div>';
443if (!empty($moreforfilter)) {
444 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
445 print $moreforfilter;
446 $parameters = array();
447 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
448 print $hookmanager->resPrint;
452print
'<div class="div-table-responsive">';
454print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'" id="tablelines3">'.
"\n";
456print
'<tr class="liste_titre_filter">';
457if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
458 print
'<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).
'"></td>';
460if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
461 print
'<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).
'"></td>';
463print
'<td class="liste_titre"><input type="text" size="4" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).
'"></td>';
464print
'<td class="liste_titre"></td>';
465print
'<td class="liste_titre right"><input type="text" size="4" name="search_declared_progress" value="'.dol_escape_htmltag($search_declared_progress).
'"></td>';
466print
'<td class="liste_titre"></td>';
467print
'<td class="liste_titre"></td>';
468foreach ($TWeek as $week_number) {
469 print
'<td class="liste_titre"></td>';
472print
'<td class="liste_titre nowrap" align="right">';
473$searchpicto = $form->showFilterAndCheckAddButtons(0);
478print
'<tr class="liste_titre">';
479if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
480 print
'<td>'.$langs->trans(
"Project").
'</td>';
482if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
483 print
'<td>'.$langs->trans(
"ThirdParty").
'</td>';
485print
'<td>'.$langs->trans(
"Task").
'</td>';
486print
'<td align="right" class="leftborder plannedworkload maxwidth75">'.$langs->trans(
"PlannedWorkload").
'</td>';
487print
'<td align="right" class="maxwidth75">'.$langs->trans(
"ProgressDeclared").
'</td>';
491print
'<td class="right maxwidth100">'.$langs->trans(
"TimeSpent").
'<br>';
492print
'<span class="nowraponall">';
493print
'<span class="opacitymedium nopadding userimg"><img alt="Photo" class="photouserphoto userphoto" src="'.DOL_URL_ROOT.
'/theme/common/everybody.png"></span>';
494print
'<span class="opacitymedium paddingleft">'.$langs->trans(
"Everybody").
'</span>';
497print
'<td align="right" class="maxwidth75">'.$langs->trans(
"TimeSpent").($usertoprocess->firstname ?
'<br><span class="nowraponall">'.$usertoprocess->getNomUrl(-2).
'<span class="opacitymedium paddingleft">'.
dol_trunc($usertoprocess->firstname, 10).
'</span></span>' :
'').
'</td>';
499foreach ($TWeek as $week_number) {
500 print
'<td width="6%" align="center" class="bold hide">'.$langs->trans(
"Week").
' '.$week_number.
'<br>('.$TFirstDays[$week_number].
'...'.$TLastDays[$week_number].
')</td>';
508$restrictviewformytask = (empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED) ? 1 : 0);
511$isavailable = array();
515if (count($tasksarray) > 0) {
522 $totalforvisibletasks =
projectLinesPerMonth($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable, 0, $TWeek);
528 $listofdistinctprojectid = array();
529 if (!empty($tasksarraywithoutfilter) && is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) {
530 foreach ($tasksarraywithoutfilter as $tmptask) {
531 $listofdistinctprojectid[$tmptask->fk_project] = $tmptask->fk_project;
535 $totalforeachweek = array();
536 foreach ($listofdistinctprojectid as $tmpprojectid) {
537 $projectstatic->id = $tmpprojectid;
538 $projectstatic->loadTimeSpentMonth($firstdaytoshow, 0, $usertoprocess->id);
539 foreach ($TWeek as $weekNb) {
540 $totalforeachweek[$weekNb] += $projectstatic->monthWorkLoad[$weekNb];
549 if (count($totalforeachweek)) {
550 foreach ($TWeek as $weekNb) {
551 $timeonothertasks = ($totalforeachweek[$weekNb] - $totalforvisibletasks[$weekNb]);
552 if ($timeonothertasks) {
561 print
'<tr class="oddeven othertaskwithtime">';
562 print
'<td colspan="'.$colspan.
'" class="opacitymedium">';
563 print $langs->trans(
"OtherFilteredTasks");
565 foreach ($TWeek as $weekNb) {
566 print
'<td class="center hide">';
568 $timeonothertasks = ($totalforeachweek[$weekNb] - $totalforvisibletasks[$weekNb]);
569 if ($timeonothertasks) {
570 print
'<span class="timesheetalreadyrecorded" title="texttoreplace"><input type="text" class="center smallpadd" size="2" disabled="" id="timespent[-1]['.$weekNb.
']" name="task[-1]['.$weekNb.
']" value="';
576 print
' <td class="liste_total"></td>';
580 if ($conf->use_javascript_ajax) {
581 print
'<tr class="liste_total">
582 <td class="liste_total" colspan="'.$colspan.
'">';
583 print $langs->trans(
"Total");
584 print
'<span class="opacitymediumbycolor"> - '.$langs->trans(
"ExpectedWorkedHours").
': <strong>'.
price($usertoprocess->weeklyhours, 1, $langs, 0, 0).
'</strong></span>';
587 foreach ($TWeek as $weekNb) {
588 print
'<td class="liste_total hide'.$weekNb.
'" align="center"><div class="totalDay'.$weekNb.
'">'.
convertSecondToTime($totalforvisibletasks[$weekNb],
'allhourmin').
'</div></td>';
590 print
'<td class="liste_total center"><div class="totalDayAll"> </div></td>
594 print
'<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans(
"NoAssignedTasks").
'</span></td></tr>';
599print
'<input type="hidden" id="numberOfLines" name="numberOfLines" value="'.count($tasksarray).
'"/>'.
"\n";
600print
'<input type="hidden" id="numberOfFirstLine" name="numberOfFirstLine" value="'.(reset($TWeek)).
'"/>'.
"\n";
602print $form->buttonsSaveCancel(
"Save",
'');
604print
'</form>'.
"\n\n";
608if ($conf->use_javascript_ajax) {
609 print
"\n<!-- JS CODE TO ENABLE Tooltips on all object with class classfortooltip -->\n";
610 print
'<script type="text/javascript">'.
"\n";
611 print
"jQuery(document).ready(function () {\n";
612 print
' jQuery(".timesheetalreadyrecorded").tooltip({
613 show: { collision: "flipfit", effect:\'toggle\', delay:50 },
614 hide: { effect:\'toggle\', delay: 50 },
615 tooltipClass: "mytooltip",
616 content: function () {
617 return \''.dol_escape_js($langs->trans(
"TimeAlreadyRecorded", $usertoprocess->getFullName($langs))).
'\';
621 foreach ($TWeek as $week_number) {
622 print ' updateTotal(
'.$week_number.',\
''.$modeinput.
'\');
';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class of the module paid holiday.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dol_get_prev_month($month, $year)
Return previous month.
getLastDayOfEachWeek($TWeek, $year)
Return array of last day of weeks.
getWeekNumbersOfMonth($month, $year)
Return array of week numbers.
getFirstDayOfEachWeek($TWeek, $year)
Return array of first day of weeks.
dol_get_next_month($month, $year)
Return next month.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
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_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_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
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.
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...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_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)
img_previous($titlealt='default', $moreatt='')
Show previous logo.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
img_next($titlealt='default', $moreatt='')
Show next logo.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.
project_timesheet_prepare_head($mode, $fuser=null)
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.