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') {
65 $week =
GETPOST(
"week",
"int") ?
GETPOST(
"week",
"int") : date(
"W");
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));
92 if (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);
109 $parameters = array(
'id' => $id,
'taskid' => $taskid,
'projectid' => $projectid,
'TWeek' => $TWeek,
'TFirstDays' => $TFirstDays,
'TLastDays' => $TLastDays);
110 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
116 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
119 $search_usertoprocessid = $user->id;
120 $search_task_ref =
'';
121 $search_task_label =
'';
122 $search_project_ref =
'';
123 $search_thirdparty =
'';
124 $search_declared_progress =
'';
126 if (
GETPOST(
"button_search_x",
'alpha') ||
GETPOST(
"button_search.x",
'alpha') ||
GETPOST(
"button_search",
'alpha')) {
130 if (
GETPOST(
'submitdateselect')) {
135 if ($action ==
'addtime' && $user->rights->projet->lire &&
GETPOST(
'assigntask')) {
136 $action =
'assigntask';
139 $result = $object->fetch($taskid, $ref);
144 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Task")),
'',
'errors');
148 setEventMessages($langs->transnoentitiesnoconv(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
'',
'errors');
153 $idfortaskuser = $usertoprocess->id;
154 $result = $object->add_contact($idfortaskuser,
GETPOST(
"type"),
'internal');
156 if ($result >= 0 || $result == -2) {
158 $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';
159 $sql .=
' AND ec.fk_socpeople = '.((int) $idfortaskuser).
" AND ec.element_id = ".((int) $object->fk_project).
" AND tc.element = 'project' AND source = 'internal'";
160 $resql = $db->query($sql);
162 $obj = $db->fetch_object(
$resql);
165 $project->fetch($object->fk_project);
167 $listofprojcontact = $project->liste_type_contact(
'internal');
169 if (count($listofprojcontact)) {
170 $tmparray = array_keys($listofprojcontact);
171 $typeforprojectcontact = reset($tmparray);
172 $result = $project->add_contact($idfortaskuser, $typeforprojectcontact,
'internal');
183 if ($object->error ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
184 $langs->load(
"errors");
185 setEventMessages($langs->trans(
"ErrorTaskAlreadyAssigned"),
null,
'warnings');
199 if ($action ==
'addtime' && $user->rights->projet->lire) {
201 if (empty($timetoadd)) {
204 foreach ($timetoadd as $taskid => $value) {
205 $updateoftaskdone = 0;
206 foreach ($value as $key => $val) {
207 $amountoadd = $timetoadd[$taskid][$key];
208 if (!empty($amountoadd)) {
209 $tmpduration = explode(
':', $amountoadd);
211 if (!empty($tmpduration[0])) {
212 $newduration += ($tmpduration[0] * 3600);
214 if (!empty($tmpduration[1])) {
215 $newduration += ($tmpduration[1] * 60);
217 if (!empty($tmpduration[2])) {
218 $newduration += ($tmpduration[2]);
221 if ($newduration > 0) {
222 $object->fetch($taskid);
223 $object->progress =
GETPOST($taskid.
'progress',
'int');
224 $object->timespent_duration = $newduration;
225 $object->timespent_fk_user = $usertoprocess->id;
227 $object->timespent_datehour = $object->timespent_date;
229 $result = $object->addTimeSpent($user);
241 if (!$updateoftaskdone) {
242 $object->fetch($taskid);
245 if ($object->progress !=
GETPOST($taskid.
'progress',
'int')) {
246 $object->progress =
GETPOST($taskid.
'progress',
'int');
247 $result = $object->update($user);
261 $param .= ($mode ?
'&mode='.$mode :
'');
262 $param .= ($projectid ?
'id='.$projectid :
'');
263 $param .= ($search_usertoprocessid ?
'&search_usertoprocessid='.$search_usertoprocessid :
'');
264 $param .= ($day ?
'&day='.$day :
'').($month ?
'&month='.$month :
'').($year ?
'&year='.$year :
'');
265 $param .= ($search_project_ref ?
'&search_project_ref='.$search_project_ref :
'');
266 $param .= ($search_usertoprocessid > 0 ?
'&search_usertoprocessid='.$search_usertoprocessid :
'');
267 $param .= ($search_thirdparty ?
'&search_thirdparty='.$search_thirdparty :
'');
268 $param .= ($search_declared_progress ?
'&search_declared_progress='.$search_declared_progress :
'');
269 $param .= ($search_task_ref ?
'&search_task_ref='.$search_task_ref :
'');
270 $param .= ($search_task_label ?
'&search_task_label='.$search_task_label :
'');
273 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?'.$param);
289 $projectstatic =
new Project($db);
291 $taskstatic =
new Task($db);
292 $thirdpartystatic =
new Societe($db);
295 $title = $langs->trans(
"TimeSpent");
297 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertoprocess, (empty($usertoprocess->id) ? 2 : 0), 1);
300 $project->fetch($id);
301 $project->fetch_thirdparty();
304 $onlyopenedproject = 1;
305 $morewherefilter =
'';
307 if ($search_project_ref) {
308 $morewherefilter .=
natural_search(array(
"p.ref",
"p.title"), $search_project_ref);
310 if ($search_task_ref) {
313 if ($search_task_label) {
314 $morewherefilter .=
natural_search(array(
"t.ref",
"t.label"), $search_task_label);
316 if ($search_thirdparty) {
319 if ($search_declared_progress) {
320 $morewherefilter .=
natural_search(
"t.progress", $search_declared_progress, 1);
323 $tasksarray = $taskstatic->getTasksArray(0, 0, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0));
324 if ($morewherefilter) {
325 $tasksarraywithoutfilter = $taskstatic->getTasksArray(0, 0, ($project->id ? $project->id : 0), $socid, 0,
'', $onlyopenedproject,
'', ($search_usertoprocessid ? $search_usertoprocessid : 0));
327 $projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, 0, ($project->id ? $project->id : 0), 0, $onlyopenedproject);
328 $tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($project->id ? $project->id : 0), 0, $onlyopenedproject);
334 llxHeader(
"", $title,
"",
'',
'',
'', array(
'/core/js/timesheet.js'));
339 $param .= ($mode ?
'&mode='.urlencode($mode) :
'');
340 $param .= ($search_project_ref ?
'&search_project_ref='.urlencode($search_project_ref) :
'');
341 $param .= ($search_usertoprocessid > 0 ?
'&search_usertoprocessid='.urlencode($search_usertoprocessid) :
'');
342 $param .= ($search_thirdparty ?
'&search_thirdparty='.urlencode($search_thirdparty) :
'');
343 $param .= ($search_task_ref ?
'&search_task_ref='.urlencode($search_task_ref) :
'');
344 $param .= ($search_task_label ?
'&search_task_label='.urlencode($search_task_label) :
'');
347 $nav =
'<a class="inline-block valignmiddle" href="?year='.$prev_year.
"&month=".$prev_month.
"&day=".$prev_day.$param.
'">'.
img_previous($langs->trans(
"Previous")).
"</a>\n";
348 $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";
349 $nav .=
'<a class="inline-block valignmiddle" href="?year='.$next_year.
"&month=".$next_month.
"&day=".$next_day.$param.
'">'.
img_next($langs->trans(
"Next")).
"</a>\n";
350 $nav .=
' '.$form->selectDate(-1,
'', 0, 0, 2,
"addtime", 1, 1).
' ';
351 $nav .=
' <button type="submit" name="button_search_x" value="x" class="bordertransp nobordertransp button_search_x"><span class="fa fa-search"></span></button>';
355 print
'<form name="addtime" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
356 print
'<input type="hidden" name="token" value="'.newToken().
'">';
357 print
'<input type="hidden" name="action" value="addtime">';
358 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
359 print
'<input type="hidden" name="day" value="'.$day.
'">';
360 print
'<input type="hidden" name="month" value="'.$month.
'">';
361 print
'<input type="hidden" name="year" value="'.$year.
'">';
364 print
dol_get_fiche_head($head,
'inputpermonth', $langs->trans(
'TimeSpent'), -1, $picto);
367 print
'<div class="hideonsmartphone opacitymedium">';
368 if ($mine || ($usertoprocess->id == $user->id)) {
369 print $langs->trans(
"MyTasksDesc").
'.'.($onlyopenedproject ?
' '.$langs->trans(
"OnlyOpenedProject") :
'').
'<br>';
371 if (empty($usertoprocess->id) || $usertoprocess->id < 0) {
372 if ($user->rights->projet->all->lire && !$socid) {
373 print $langs->trans(
"ProjectsDesc").
'.'.($onlyopenedproject ?
' '.$langs->trans(
"OnlyOpenedProject") :
'').
'<br>';
375 print $langs->trans(
"ProjectsPublicTaskDesc").
'.'.($onlyopenedproject ?
' '.$langs->trans(
"OnlyOpenedProject") :
'').
'<br>';
379 if ($mine || ($usertoprocess->id == $user->id)) {
380 print $langs->trans(
"OnlyYourTaskAreVisible").
'<br>';
382 print $langs->trans(
"AllTaskVisibleButEditIfYouAreAssigned").
'<br>';
388 print
'<div class="floatright right'.($conf->dol_optimize_smallscreen ?
' centpercent' :
'').
'">'.$nav.
'</div>';
390 print
'<div class="colorbacktimesheet float valignmiddle">';
391 $titleassigntask = $langs->transnoentities(
"AssignTaskToMe");
392 if ($usertoprocess->id != $user->id) {
393 $titleassigntask = $langs->transnoentities(
"AssignTaskToUser", $usertoprocess->getFullName($langs));
395 print
'<div class="taskiddiv inline-block">';
396 print
img_picto(
'',
'projecttask',
'class="pictofixedwidth"');
397 $formproject->selectTasks($socid ? $socid : -1, $taskid,
'taskid', 32, 0,
'-- '.$langs->trans(
"ChooseANotYetAssignedTask").
' --', 1);
400 print $formcompany->selectTypeContact($object,
'',
'type',
'internal',
'position', 0,
'maxwidth150onsmartphone');
401 print
'<input type="submit" class="button valignmiddle smallonsmartphone small" name="assigntask" value="'.dol_escape_htmltag($titleassigntask).
'">';
404 print
'<div class="clearboth" style="padding-bottom: 20px;"></div>';
421 $moreforfilter .=
'<div class="divsearchfield">';
422 $moreforfilter .=
'<div class="inline-block hideonsmartphone"></div>';
423 $includeonly =
'hierarchyme';
424 if (empty($user->rights->user->user->lire)) {
425 $includeonly = array($user->id);
427 $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');
428 $moreforfilter .=
'</div>';
430 if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
431 $moreforfilter .=
'<div class="divsearchfield">';
432 $moreforfilter .=
'<div class="inline-block"></div>';
433 $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).
'">';
434 $moreforfilter .=
'</div>';
436 $moreforfilter .=
'<div class="divsearchfield">';
437 $moreforfilter .=
'<div class="inline-block"></div>';
438 $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).
'">';
439 $moreforfilter .=
'</div>';
442 if (!empty($moreforfilter)) {
443 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
444 print $moreforfilter;
445 $parameters = array();
446 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
447 print $hookmanager->resPrint;
451 print
'<div class="div-table-responsive">';
453 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'" id="tablelines3">'.
"\n";
455 print
'<tr class="liste_titre_filter">';
456 if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
457 print
'<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).
'"></td>';
459 if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
460 print
'<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).
'"></td>';
462 print
'<td class="liste_titre"><input type="text" size="4" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).
'"></td>';
463 print
'<td class="liste_titre"></td>';
464 print
'<td class="liste_titre right"><input type="text" size="4" name="search_declared_progress" value="'.dol_escape_htmltag($search_declared_progress).
'"></td>';
465 print
'<td class="liste_titre"></td>';
466 print
'<td class="liste_titre"></td>';
467 foreach ($TWeek as $week_number) {
468 print
'<td class="liste_titre"></td>';
471 print
'<td class="liste_titre nowrap" align="right">';
472 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
477 print
'<tr class="liste_titre">';
478 if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
479 print
'<td>'.$langs->trans(
"Project").
'</td>';
481 if (!empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) {
482 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 class="right maxwidth100">'.$langs->trans(
"TimeSpent").
'<br>';
491 print
'<span class="nowraponall">';
492 print
'<span class="opacitymedium nopadding userimg"><img alt="Photo" class="photouserphoto userphoto" src="'.DOL_URL_ROOT.
'/theme/common/everybody.png"></span>';
493 print
'<span class="opacitymedium paddingleft">'.$langs->trans(
"Everybody").
'</span>';
496 print
'<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>';
498 foreach ($TWeek as $week_number) {
499 print
'<td width="6%" align="center" class="bold hide">'.$langs->trans(
"Week").
' '.$week_number.
'<br>('.$TFirstDays[$week_number].
'...'.$TLastDays[$week_number].
')</td>';
507 $restrictviewformytask = (empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED) ? 1 : 0);
510 $isavailable = array();
514 if (count($tasksarray) > 0) {
521 $totalforvisibletasks =
projectLinesPerMonth($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable, 0, $TWeek);
527 $listofdistinctprojectid = array();
528 if (!empty($tasksarraywithoutfilter) && is_array($tasksarraywithoutfilter) && count($tasksarraywithoutfilter)) {
529 foreach ($tasksarraywithoutfilter as $tmptask) {
530 $listofdistinctprojectid[$tmptask->fk_project] = $tmptask->fk_project;
534 $totalforeachweek = array();
535 foreach ($listofdistinctprojectid as $tmpprojectid) {
536 $projectstatic->id = $tmpprojectid;
537 $projectstatic->loadTimeSpentMonth($firstdaytoshow, 0, $usertoprocess->id);
538 foreach ($TWeek as $weekNb) {
539 $totalforeachweek[$weekNb] += $projectstatic->monthWorkLoad[$weekNb];
548 if (count($totalforeachweek)) {
549 foreach ($TWeek as $weekNb) {
550 $timeonothertasks = ($totalforeachweek[$weekNb] - $totalforvisibletasks[$weekNb]);
551 if ($timeonothertasks) {
560 print
'<tr class="oddeven othertaskwithtime">';
561 print
'<td colspan="'.$colspan.
'" class="opacitymedium">';
562 print $langs->trans(
"OtherFilteredTasks");
564 foreach ($TWeek as $weekNb) {
565 print
'<td class="center hide">';
567 $timeonothertasks = ($totalforeachweek[$weekNb] - $totalforvisibletasks[$weekNb]);
568 if ($timeonothertasks) {
569 print
'<span class="timesheetalreadyrecorded" title="texttoreplace"><input type="text" class="center smallpadd" size="2" disabled="" id="timespent[-1]['.$weekNb.
']" name="task[-1]['.$weekNb.
']" value="';
575 print
' <td class="liste_total"></td>';
579 if ($conf->use_javascript_ajax) {
580 print
'<tr class="liste_total">
581 <td class="liste_total" colspan="'.$colspan.
'">';
582 print $langs->trans(
"Total");
583 print
'<span class="opacitymediumbycolor"> - '.$langs->trans(
"ExpectedWorkedHours").
': <strong>'.
price($usertoprocess->weeklyhours, 1, $langs, 0, 0).
'</strong></span>';
586 foreach ($TWeek as $weekNb) {
587 print
'<td class="liste_total hide'.$weekNb.
'" align="center"><div class="totalDay'.$weekNb.
'">'.
convertSecondToTime($totalforvisibletasks[$weekNb],
'allhourmin').
'</div></td>';
589 print
'<td class="liste_total center"><div class="totalDayAll"> </div></td>
593 print
'<tr><td colspan="15"><span class="opacitymedium">'.$langs->trans(
"NoAssignedTasks").
'</span></td></tr>';
598 print
'<input type="hidden" id="numberOfLines" name="numberOfLines" value="'.count($tasksarray).
'"/>'.
"\n";
599 print
'<input type="hidden" id="numberOfFirstLine" name="numberOfFirstLine" value="'.(reset($TWeek)).
'"/>'.
"\n";
601 print
$form->buttonsSaveCancel(
"Save",
'');
603 print
'</form>'.
"\n\n";
605 $modeinput =
'hours';
607 if ($conf->use_javascript_ajax) {
608 print
"\n<!-- JS CODE TO ENABLE Tooltips on all object with class classfortooltip -->\n";
609 print
'<script type="text/javascript">'.
"\n";
610 print
"jQuery(document).ready(function () {\n";
611 print
' jQuery(".timesheetalreadyrecorded").tooltip({
612 show: { collision: "flipfit", effect:\'toggle\', delay:50 },
613 hide: { effect:\'toggle\', delay: 50 },
614 tooltipClass: "mytooltip",
615 content: function () {
616 return \''.dol_escape_js($langs->trans(
"TimeAlreadyRecorded", $usertoprocess->getFullName($langs))).
'\';
620 foreach ($TWeek as $week_number) {
621 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.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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='')
Show tabs of a record.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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.