32 require
'../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/holiday.lib.php';
41 require_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
45 $action =
GETPOST(
'action',
'aZ09');
46 $cancel =
GETPOST(
'cancel',
'alpha');
47 $confirm =
GETPOST(
'confirm',
'alpha');
51 $fuserid = (
GETPOST(
'fuserid',
'int') ?
GETPOST(
'fuserid',
'int') : $user->id);
52 $socid =
GETPOST(
'socid',
'int');
55 $langs->loadLangs(array(
"other",
"holiday",
"mails",
"trips"));
61 $childids = $user->getAllChildIds(1);
64 if (!empty($conf->global->HOLIDAY_HIDE_FOR_NON_SALARIES)) {
65 $morefilter =
'AND employee = 1';
73 $extrafields->fetch_name_optionals_label($object->table_element);
75 if (($id > 0) || $ref) {
76 $object->fetch($id, $ref);
80 if (!empty($user->rights->holiday->readall)) {
83 if (!empty($user->rights->holiday->read) && in_array($object->fk_user, $childids)) {
92 $hookmanager->initHooks(array(
'holidaycard',
'globalcard'));
96 if (!empty($user->rights->holiday->write) && in_array($fuserid, $childids)) {
99 if (!empty($user->rights->holiday->writeall)) {
105 if (!empty($user->rights->holiday->delete)) {
108 if ($object->statut ==
Holiday::STATUS_DRAFT && $user->rights->holiday->write && in_array($object->fk_user, $childids)) {
114 $socid = $user->socid;
116 $result =
restrictedArea($user,
'holiday', $object->id,
'holiday',
'',
'',
'rowid', $object->statut);
123 $parameters = array(
'socid' => $socid);
124 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
129 if (empty($reshook)) {
130 $backurlforlist = DOL_URL_ROOT.
'/holiday/list.php';
132 if (empty($backtopage) || ($cancel && empty($id))) {
133 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
134 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
135 $backtopage = $backurlforlist;
137 $backtopage = DOL_URL_ROOT.
'/holiday/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
143 if (!empty($backtopageforcancel)) {
144 header(
"Location: ".$backtopageforcancel);
146 } elseif (!empty($backtopage)) {
147 header(
"Location: ".$backtopage);
154 if ($action ==
'add') {
171 $starthalfday =
GETPOST(
'starthalfday');
172 $endhalfday =
GETPOST(
'endhalfday');
175 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
177 } elseif ($starthalfday ==
'afternoon') {
179 } elseif ($endhalfday ==
'morning') {
183 $approverid =
GETPOST(
'valideur',
'int');
184 $description = trim(
GETPOST(
'description',
'restricthtml'));
187 if (!$cancreateall) {
188 if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
189 if (empty($user->rights->holiday->write)) {
192 } elseif (!in_array($fuserid, $childids)) {
198 if (empty($user->rights->holiday->write) && empty($user->rights->holiday->writeall_advance)) {
201 } elseif (empty($user->rights->holiday->writeall_advance) && !in_array($fuserid, $childids)) {
211 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")), null,
'errors');
217 if (empty($date_debut)) {
223 if (empty($date_fin)) {
229 if ($date_debut > $date_fin) {
236 $verifCP = $object->verifDateHolidayCP($fuserid, $date_debut, $date_fin, $halfday);
244 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
245 if ($nbopenedday < 0.5) {
252 if ($approverid < 1) {
253 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidatorCP'), null,
'errors');
260 $object->fk_user = $fuserid;
261 $object->description = $description;
262 $object->fk_validator = $approverid;
263 $object->fk_type = $type;
264 $object->date_debut = $date_debut;
265 $object->date_fin = $date_fin;
266 $object->halfday = $halfday;
268 $result = $object->create($user);
279 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
288 if ($action ==
'update' &&
GETPOSTISSET(
'savevalidator') && !empty($user->rights->holiday->approve)) {
293 $object->fk_validator =
GETPOST(
'valideur',
'int');
295 if ($object->fk_validator != $object->oldcopy->fk_validator) {
296 $verif = $object->update($user);
300 $action =
'editvalidator';
302 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
310 if ($action ==
'update' && !
GETPOSTISSET(
'savevalidator')) {
315 $starthalfday =
GETPOST(
'starthalfday');
316 $endhalfday =
GETPOST(
'endhalfday');
318 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
320 } elseif ($starthalfday ==
'afternoon') {
322 } elseif ($endhalfday ==
'morning') {
327 if (!$cancreateall) {
329 if (!in_array($fuserid, $childids)) {
331 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?action=create');
336 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?action=create');
347 $approverid =
GETPOST(
'valideur',
'int');
350 $description = trim(
GETPOST(
'description',
'restricthtml'));
354 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.
newToken().
'&error=nodatedebut');
360 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.
newToken().
'&error=nodatefin');
365 if ($date_debut > $date_fin) {
366 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.
newToken().
'&error=datefin');
371 if ($approverid < 1) {
372 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.
newToken().
'&error=Valideur');
377 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
378 if ($nbopenedday < 0.5) {
379 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&error=DureeHoliday');
383 $object->description = $description;
384 $object->date_debut = $date_debut;
385 $object->date_fin = $date_fin;
386 $object->fk_validator = $approverid;
387 $object->halfday = $halfday;
390 $verif = $object->update($user);
396 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
410 if ($action ==
'confirm_delete' &&
GETPOST(
'confirm') ==
'yes' && $candelete) {
419 $result = $object->delete($user);
428 header(
'Location: list.php?restore_lastsearch_values=1');
436 if ($action ==
'confirm_send') {
445 $verif = $object->validate($user);
450 $destinataire =
new User($db);
451 $destinataire->fetch($object->fk_validator);
452 $emailTo = $destinataire->email;
455 dol_syslog(
"Expected validator has no email, so we redirect directly to finished page without sending email");
456 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
461 $expediteur =
new User($db);
462 $expediteur->fetch($object->fk_user);
464 $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
467 $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
468 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
469 $societeName = $conf->global->MAIN_APPLICATION_TITLE;
472 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysToValidate");
475 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
477 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateBody").
"</p>\n";
481 if (empty($conf->global->HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY)) {
482 $delayForRequest = 0;
483 if ($delayForRequest) {
486 if ($object->date_debut < $nowplusdelay) {
487 $message =
"<p>".$langs->transnoentities(
"HolidaysToValidateDelay", $delayForRequest).
"</p>\n";
493 if (empty($conf->global->HOLIDAY_HIDE_APPROVER_ABOUT_NEGATIVE_BALANCE)) {
494 $nbopenedday =
num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
496 if ($nbopenedday > $object->getCPforUser($object->fk_user, $object->fk_type)) {
497 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateAlertSolde").
"</p>\n";
501 $link =
dol_buildpath(
"/holiday/card.php", 3) .
'?id='.$object->id;
504 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Name").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
505 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Period").
" : ".
dol_print_date($object->date_debut,
'day').
" ".$langs->transnoentitiesnoconv(
"To").
" ".
dol_print_date($object->date_fin,
'day').
"</li>\n";
506 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
507 $message .=
"</ul>\n";
509 $trackid =
'leav'.$object->id;
511 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'',
'', 0, 1,
'',
'', $trackid);
514 $result = $mail->sendfile();
520 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
530 if ($action ==
'update_extras') {
534 $ret = $extrafields->setOptionalsFromPost(null, $object,
GETPOST(
'attribute',
'restricthtml'));
541 $result = $object->insertExtraFields(
'HOLIDAY_MODIFY');
549 $action =
'edit_extras';
554 if ($action ==
'confirm_valid') {
561 $object->date_valid =
dol_now();
562 $object->fk_user_valid = $user->id;
567 $verif = $object->approve($user);
576 $nbopenedday =
num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
577 $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type);
578 $newSolde = ($soldeActuel - $nbopenedday);
579 $label = $langs->transnoentitiesnoconv(
"Holidays").
' - '.$object->ref;
582 $result = $object->addLogCP($user->id, $object->fk_user, $label, $newSolde, $object->fk_type);
589 $result = $object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type);
598 $destinataire =
new User($db);
599 $destinataire->fetch($object->fk_user);
600 $emailTo = $destinataire->email;
603 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
606 $expediteur =
new User($db);
607 $expediteur->fetch($object->fk_validator);
609 $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
612 $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
613 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
614 $societeName = $conf->global->MAIN_APPLICATION_TITLE;
617 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysValidated");
620 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
622 $message .=
"<p>".$langs->transnoentities(
"HolidaysValidatedBody",
dol_print_date($object->date_debut,
'day'),
dol_print_date($object->date_fin,
'day')).
"</p>\n";
624 $link =
dol_buildpath(
'/holiday/card.php', 3).
'?id='.$object->id;
626 $message .=
"<ul>\n";
627 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ValidatedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
628 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
629 $message .=
"</ul>\n";
631 $trackid =
'leav'.$object->id;
633 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'',
'', 0, 1,
'',
'', $trackid);
636 $result = $mail->sendfile();
648 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
657 if ($action ==
'confirm_refuse' &&
GETPOST(
'confirm',
'alpha') ==
'yes') {
658 if (
GETPOST(
'detail_refuse')) {
664 $object->fk_user_refuse = $user->id;
666 $object->detail_refuse =
GETPOST(
'detail_refuse',
'alphanohtml');
670 $verif = $object->update($user);
679 $destinataire =
new User($db);
680 $destinataire->fetch($object->fk_user);
681 $emailTo = $destinataire->email;
684 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
687 $expediteur =
new User($db);
688 $expediteur->fetch($object->fk_validator);
690 $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
693 $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
694 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
695 $societeName = $conf->global->MAIN_APPLICATION_TITLE;
698 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysRefused");
701 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
703 $message .=
"<p>".$langs->transnoentities(
"HolidaysRefusedBody",
dol_print_date($object->date_debut,
'day'),
dol_print_date($object->date_fin,
'day')).
"<p>\n";
704 $message .=
"<p>".GETPOST(
'detail_refuse',
'alpha').
"</p>";
706 $link =
dol_buildpath(
'/holiday/card.php', 3).
'?id='.$object->id;
708 $message .=
"<ul>\n";
709 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
710 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
713 $trackid =
'leav'.$object->id;
715 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'',
'', 0, 1,
'',
'', $trackid);
718 $result = $mail->sendfile();
732 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
740 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DetailRefusCP")), null,
'errors');
747 if ($action ==
'confirm_draft' &&
GETPOST(
'confirm') ==
'yes') {
752 $oldstatus = $object->statut;
755 $result = $object->update($user);
758 setEventMessages($langs->trans(
'ErrorBackToDraft').
' '.$object->error, $object->errors,
'errors');
764 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
772 if ($action ==
'confirm_cancel' &&
GETPOST(
'confirm') ==
'yes') {
779 (!empty($user->admin) || $user->id == $object->fk_validator || $cancreate || $cancreateall)) {
782 $oldstatus = $object->statut;
783 $object->date_cancel =
dol_now();
784 $object->fk_user_cancel = $user->id;
787 $result = $object->update($user);
791 $result = $object->call_trigger(
'HOLIDAY_CANCEL', $user);
797 $nbopenedday =
num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
799 $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type);
800 $newSolde = ($soldeActuel + $nbopenedday);
803 $result1 = $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv(
"HolidaysCancelation"), $newSolde, $object->fk_type);
806 $result2 = $object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type);
808 if ($result1 < 0 || $result2 < 0) {
810 setEventMessages($langs->trans(
'ErrorCantDeleteCP').
' '.$object->error, $object->errors,
'errors');
821 if (!$error && $result > 0) {
823 $destinataire =
new User($db);
824 $destinataire->fetch($object->fk_user);
825 $emailTo = $destinataire->email;
828 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
833 $expediteur =
new User($db);
834 $expediteur->fetch($object->fk_user_cancel);
836 $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
839 $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
840 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
841 $societeName = $conf->global->MAIN_APPLICATION_TITLE;
844 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysCanceled");
847 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
849 $message .=
"<p>".$langs->transnoentities(
"HolidaysCanceledBody",
dol_print_date($object->date_debut,
'day'),
dol_print_date($object->date_fin,
'day')).
"</p>\n";
851 $link =
dol_buildpath(
'/holiday/card.php', 3).
'?id='.$object->id;
853 $message .=
"<ul>\n";
854 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
855 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
856 $message .=
"</ul>\n";
858 $trackid =
'leav'.$object->id;
860 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'',
'', 0, 1,
'',
'', $trackid);
863 $result = $mail->sendfile();
869 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
902 $listhalfday = array(
'morning'=>$langs->trans(
"Morning"),
"afternoon"=>$langs->trans(
"Afternoon"));
904 $title = $langs->trans(
'Leave');
911 if ((empty($id) && empty($ref)) || $action ==
'create' || $action ==
'add') {
913 if ((in_array($fuserid, $childids) && empty($user->rights->holiday->write)) || (!in_array($fuserid, $childids) && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance)))) {
914 $errors[] = $langs->trans(
'CantCreateCP');
923 $errors[] = $langs->trans(
'ErrorEndDateCP');
926 $errors[] = $langs->trans(
'ErrorSQLCreateCP');
929 $errors[] = $langs->trans(
'CantCreateCP');
932 $errors[] = $langs->trans(
'InvalidValidatorCP');
935 $errors[] = $langs->trans(
'NoDateDebut');
938 $errors[] = $langs->trans(
'NoDateFin');
941 $errors[] = $langs->trans(
'ErrorDureeCP');
944 $errors[] = $langs->trans(
'alreadyCPexist');
952 print
'<script type="text/javascript">
953 $( document ).ready(function() {
954 $("input.button-save").click("submit", function(e) {
955 console.log("Call valider()");
956 if (document.demandeCP.date_debut_.value != "")
958 if(document.demandeCP.date_fin_.value != "")
960 if(document.demandeCP.valideur.value != "-1") {
964 alert("'.dol_escape_js($langs->transnoentities(
'InvalidValidatorCP')).
'");
970 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateFin')).
'");
976 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateDebut')).
'");
985 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="demandeCP">'.
"\n";
986 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
987 print
'<input type="hidden" name="action" value="add" />'.
"\n";
989 if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) {
994 $typeleaves = $object->getTypes(1, 1);
995 foreach ($typeleaves as $key => $val) {
996 $nb_type = $object->getCPforUser($user->id, $val[
'rowid']);
997 $nb_holiday += $nb_type;
999 $out .=
' - '.($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']).
': <strong>'.($nb_type ?
price2num($nb_type) : 0).
'</strong><br>';
1002 print $langs->trans(
'SoldeCPUser', round($nb_holiday, 5)).
'<br>';
1006 } elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) {
1007 print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).
'<br>';
1014 print
'<table class="border centpercent">';
1019 print
'<td class="titlefield fieldrequired">'.$langs->trans(
"User").
'</td>';
1021 if ($cancreate && !$cancreateall) {
1022 print
img_picto(
'',
'user').$form->select_dolusers(($fuserid ? $fuserid : $user->id),
'fuserid', 0,
'', 0,
'hierarchyme',
'',
'0,'.$conf->entity, 0, 0, $morefilter, 0,
'',
'minwidth200 maxwidth500');
1025 print
img_picto(
'',
'user').$form->select_dolusers($fuserid ? $fuserid : $user->id,
'fuserid', 0,
'', 0,
'',
'',
'0,'.$conf->entity, 0, 0, $morefilter, 0,
'',
'minwidth200 maxwidth500');
1032 print
'<td class="fieldrequired">'.$langs->trans(
"Type").
'</td>';
1034 $typeleaves = $object->getTypes(1, -1);
1035 $arraytypeleaves = array();
1036 foreach ($typeleaves as $key => $val) {
1037 $labeltoshow = ($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']);
1038 $labeltoshow .= ($val[
'delay'] > 0 ?
' ('.$langs->trans(
"NoticePeriod").
': '.$val[
'delay'].
' '.$langs->trans(
"days").
')' :
'');
1039 $arraytypeleaves[$val[
'rowid']] = $labeltoshow;
1041 print
$form->selectarray(
'type', $arraytypeleaves, (
GETPOST(
'type',
'alpha') ?
GETPOST(
'type',
'alpha') :
''), 1, 0, 0,
'', 0, 0, 0,
'',
'',
true);
1043 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1050 print
'<td class="fieldrequired">';
1051 print
$form->textwithpicto($langs->trans(
"DateDebCP"), $langs->trans(
"FirstDayOfHoliday"));
1055 if (!
GETPOST(
'date_debut_')) {
1056 print
$form->selectDate(-1,
'date_debut_', 0, 0, 0,
'', 1, 1);
1059 print
$form->selectDate($tmpdate,
'date_debut_', 0, 0, 0,
'', 1, 1);
1061 print
' ';
1062 print
$form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday',
'alpha') ?
GETPOST(
'starthalfday',
'alpha') :
'morning'));
1068 print
'<td class="fieldrequired">';
1069 print
$form->textwithpicto($langs->trans(
"DateFinCP"), $langs->trans(
"LastDayOfHoliday"));
1073 print
$form->selectDate(-1,
'date_fin_', 0, 0, 0,
'', 1, 1);
1076 print
$form->selectDate($tmpdate,
'date_fin_', 0, 0, 0,
'', 1, 1);
1078 print
' ';
1079 print
$form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday',
'alpha') ?
GETPOST(
'endhalfday',
'alpha') :
'afternoon'));
1085 print
'<td class="fieldrequired">'.$langs->trans(
"ReviewedByCP").
'</td>';
1089 $include_users = $object->fetch_users_approver_holiday();
1090 if (empty($include_users)) {
1091 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1095 $defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
1096 if (!empty($conf->global->HOLIDAY_DEFAULT_VALIDATOR)) {
1097 $defaultselectuser = $conf->global->HOLIDAY_DEFAULT_VALIDATOR;
1099 if (
GETPOST(
'valideur',
'int') > 0) {
1100 $defaultselectuser =
GETPOST(
'valideur',
'int');
1102 $s =
$form->select_dolusers($defaultselectuser,
"valideur", 1,
'', 0, $include_users,
'',
'0,'.$conf->entity, 0, 0,
'', 0,
'',
'minwidth200 maxwidth500');
1103 print
img_picto(
'',
'user').$form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1112 print
'<td>'.$langs->trans(
"DescCP").
'</td>';
1113 print
'<td class="tdtop">';
1114 $doleditor =
new DolEditor(
'description',
GETPOST(
'description',
'restricthtml'),
'', 80,
'dolibarr_notes',
'In', 0,
false, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, ROWS_3,
'90%');
1115 print $doleditor->Create(1);
1119 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1126 print
$form->buttonsSaveCancel(
"SendRequestCP");
1128 print
'</from>'.
"\n";
1132 print
'<div class="tabBar">';
1134 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1138 if (($id > 0) || $ref) {
1139 $result = $object->fetch($id, $ref);
1141 $approverexpected =
new User($db);
1142 $approverexpected->fetch($object->fk_validator);
1144 $userRequest =
new User($db);
1145 $userRequest->fetch($object->fk_user);
1153 $errors[] = $langs->transnoentitiesnoconv(
'ErrorEndDateCP');
1156 $errors[] = $langs->transnoentitiesnoconv(
'ErrorSQLCreateCP');
1159 $errors[] = $langs->transnoentitiesnoconv(
'CantCreateCP');
1162 $errors[] = $langs->transnoentitiesnoconv(
'InvalidValidatorCP');
1165 $errors[] = $langs->transnoentitiesnoconv(
'NoDateDebut');
1168 $errors[] = $langs->transnoentitiesnoconv(
'NoDateFin');
1170 case 'DureeHoliday':
1171 $errors[] = $langs->transnoentitiesnoconv(
'ErrorDureeCP');
1173 case 'NoMotifRefuse':
1174 $errors[] = $langs->transnoentitiesnoconv(
'NoMotifRefuseCP');
1177 $errors[] = $langs->transnoentitiesnoconv(
'ErrorMailNotSend');
1188 if (($action ==
'edit' && $object->statut ==
Holiday::STATUS_DRAFT) || ($action ==
'editvalidator')) {
1193 print
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">'.
"\n";
1194 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
1195 print
'<input type="hidden" name="action" value="update"/>'.
"\n";
1196 print
'<input type="hidden" name="id" value="'.$object->id.
'" />'.
"\n";
1199 print
dol_get_fiche_head($head,
'card', $langs->trans(
"CPTitreMenu"), -1,
'holiday');
1201 $linkback =
'<a href="'.DOL_URL_ROOT.
'/holiday/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1206 print
'<div class="fichecenter">';
1207 print
'<div class="fichehalfleft">';
1208 print
'<div class="underbanner clearboth"></div>';
1210 print
'<table class="border tableforfield centpercent">';
1215 print
'<td class="titlefield">'.$langs->trans(
"User").
'</td>';
1217 print $userRequest->getNomUrl(-1,
'leave');
1222 print
'<td>'.$langs->trans(
"Type").
'</td>';
1224 $typeleaves = $object->getTypes(1, -1);
1225 $labeltoshow = (($typeleaves[$object->fk_type][
'code'] && $langs->trans($typeleaves[$object->fk_type][
'code']) != $typeleaves[$object->fk_type][
'code']) ? $langs->trans($typeleaves[$object->fk_type][
'code']) : $typeleaves[$object->fk_type][
'label']);
1226 print empty($labeltoshow) ? $langs->trans(
"TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow;
1230 $starthalfday = ($object->halfday == -1 || $object->halfday == 2) ?
'afternoon' :
'morning';
1231 $endhalfday = ($object->halfday == 1 || $object->halfday == 2) ?
'morning' :
'afternoon';
1235 print
'<td class="nowrap">';
1236 print
$form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1238 print
'<td>'.dol_print_date($object->date_debut,
'day');
1239 print
' ';
1240 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).
'</span>';
1245 print
'<td class="nowrap">';
1246 print
$form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1249 print
$form->selectDate($object->date_debut,
'date_debut_');
1250 print
' ';
1251 print
$form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday') ?
GETPOST(
'starthalfday') : $starthalfday));
1258 print
'<td class="nowrap">';
1259 print
$form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1261 print
'<td>'.dol_print_date($object->date_fin,
'day');
1262 print
' ';
1263 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).
'</span>';
1268 print
'<td class="nowrap">';
1269 print
$form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1272 print
$form->selectDate($object->date_fin,
'date_fin_');
1273 print
' ';
1274 print
$form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday') ?
GETPOST(
'endhalfday') : $endhalfday));
1282 $htmlhelp = $langs->trans(
'NbUseDaysCPHelp');
1283 $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1);
1284 $includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1);
1285 if ($includesaturday) {
1286 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Saturday"));
1288 if ($includesunday) {
1289 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Sunday"));
1291 print
$form->textwithpicto($langs->trans(
'NbUseDaysCP'), $htmlhelp);
1294 print
num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
1300 print
'<td>'.$langs->trans(
'DetailRefusCP').
'</td>';
1301 print
'<td>'.$object->detail_refuse.
'</td>';
1308 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1309 print
'<td>'.nl2br($object->description).
'</td>';
1313 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1314 print
'<td class="tdtop">';
1315 $doleditor =
new DolEditor(
'description', $object->description,
'', 80,
'dolibarr_notes',
'In', 0,
false, empty($conf->fckeditor->enabled) ?
false : $conf->fckeditor->enabled, ROWS_3,
'90%');
1316 print $doleditor->Create(1);
1321 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1324 print
'</table>'.
"\n";
1327 print
'<div class="fichehalfright">';
1329 print
'<div class="underbanner clearboth"></div>';
1332 print
'<table class="border tableforfield centpercent">'.
"\n";
1335 if (!empty($object->fk_user_create)) {
1336 $userCreate =
new User($db);
1337 $userCreate->fetch($object->fk_user_create);
1339 print
'<td class="titlefield">'.$langs->trans(
'RequestByCP').
'</td>';
1340 print
'<td>'.$userCreate->getNomUrl(-1).
'</td>';
1345 if (!$edit && $action !=
'editvalidator') {
1347 print
'<td class="titlefield">';
1349 print $langs->trans(
'ApprovedBy');
1351 print $langs->trans(
'ReviewedByCP');
1356 $approverdone =
new User($db);
1357 $approverdone->fetch($object->fk_user_valid);
1358 print $approverdone->getNomUrl(-1);
1360 print $approverexpected->getNomUrl(-1);
1362 $include_users = $object->fetch_users_approver_holiday();
1364 print
'<a class="editfielda paddingleft" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=editvalidator&token='.
newToken().
'">'.
img_edit($langs->trans(
"Edit")).
'</a>';
1370 print
'<td class="titlefield">'.$langs->trans(
'ReviewedByCP').
'</td>';
1372 $include_users = $object->fetch_users_approver_holiday();
1373 if (!in_array($object->fk_validator, $include_users)) {
1374 $include_users[] = $object->fk_validator;
1376 if (empty($include_users)) {
1377 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1379 $arrayofvalidatorstoexclude = (($user->admin || ($user->id != $userRequest->id)) ?
'' : array($user->id));
1380 $s =
$form->select_dolusers($object->fk_validator,
"valideur", (($action ==
'editvalidator') ? 0 : 1), $arrayofvalidatorstoexclude, 0, $include_users);
1381 print
$form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1383 if ($action ==
'editvalidator') {
1384 print
'<input type="submit" class="button button-save" name="savevalidator" value="'.$langs->trans(
"Save").
'">';
1385 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1392 print
'<td>'.$langs->trans(
'DateCreation').
'</td>';
1393 print
'<td>'.dol_print_date($object->date_create,
'dayhour',
'tzuser').
'</td>';
1397 print
'<td>'.$langs->trans(
'DateValidCP').
'</td>';
1398 print
'<td>'.dol_print_date($object->date_valid,
'dayhour',
'tzuser').
'</td>';
1403 print
'<td>'.$langs->trans(
'DateCancelCP').
'</td>';
1404 print
'<td>'.dol_print_date($object->date_cancel,
'dayhour',
'tzuser').
'</td>';
1409 print
'<td>'.$langs->trans(
'DateRefusCP').
'</td>';
1410 print
'<td>'.dol_print_date($object->date_refuse,
'dayhour',
'tzuser').
'</td>';
1419 print
'<div class="clearboth"></div>';
1425 if ($action ==
'delete') {
1427 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleDeleteCP"), $langs->trans(
"ConfirmDeleteCP"),
"confirm_delete",
'', 0, 1);
1433 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleToValidCP"), $langs->trans(
"ConfirmToValidCP"),
"confirm_send",
'', 1, 1);
1437 if ($action ==
'valid') {
1438 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleValidCP"), $langs->trans(
"ConfirmValidCP"),
"confirm_valid",
'', 1, 1);
1442 if ($action ==
'refuse') {
1443 $array_input = array(array(
'type'=>
"text",
'label'=> $langs->trans(
'DetailRefusCP'),
'name'=>
"detail_refuse",
'size'=>
"50",
'value'=>
""));
1444 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id.
"&action=confirm_refuse", $langs->trans(
"TitleRefuseCP"), $langs->trans(
'ConfirmRefuseCP'),
"confirm_refuse", $array_input, 1, 0);
1448 if ($action ==
'cancel') {
1449 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleCancelCP"), $langs->trans(
"ConfirmCancelCP"),
"confirm_cancel",
'', 1, 1);
1453 if ($action ==
'backtodraft') {
1454 print
$form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleSetToDraft"), $langs->trans(
"ConfirmSetToDraft"),
"confirm_draft",
'', 1, 1);
1457 if (($action ==
'edit' && $object->statut ==
Holiday::STATUS_DRAFT) || ($action ==
'editvalidator')) {
1460 print
$form->buttonsSaveCancel();
1470 print
'<div class="tabsAction">';
1473 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.
newToken().
'" class="butAction">'.$langs->trans(
"EditCP").
'</a>';
1477 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=sendToValidate&token='.
newToken().
'" class="butAction">'.$langs->trans(
"Validate").
'</a>';
1482 if ($user->id == $object->fk_validator) {
1483 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=valid" class="butAction">'.$langs->trans(
"Approve").
'</a>';
1484 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=refuse" class="butAction">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1486 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"Approve").
'</a>';
1487 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1490 if ($cancreate || $cancreateall) {
1491 if (($object->date_debut >
dol_now()) || !empty($user->admin)) {
1492 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1494 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
'-'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1500 if ($user->id == $object->fk_validator || $cancreate || $cancreateall) {
1501 if (($object->date_debut >
dol_now()) || !empty($user->admin)) {
1502 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1504 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
'-'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1507 if (!empty($user->admin)) {
1508 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1510 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1516 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=backtodraft" class="butAction">'.$langs->trans(
"SetToDraft").
'</a>';
1519 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.
newToken().
'" class="butActionDelete">'.$langs->trans(
"DeleteCP").
'</a>';
1525 print
'<div class="tabBar">';
1526 print $langs->trans(
'ErrorUserViewCP');
1527 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1531 print
'<div class="tabBar">';
1532 print $langs->trans(
'ErrorIDFicheCP');
1533 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1539 if (
GETPOST(
'modelselected')) {
1540 $action =
'presend';
1543 if ($action !=
'presend' && $action !=
'edit') {
1544 print
'<div class="fichecenter"><div class="fichehalfleft">';
1545 print
'<a name="builddoc"></a>';
1547 $includedocgeneration = 0;
1550 if ($includedocgeneration) {
1552 $relativepath = $objref.
'/'.$objref.
'.pdf';
1553 $filedir = $conf->holiday->dir_output.
'/'.$object->element.
'/'.$objref;
1554 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".$object->id;
1555 $genallowed = ($user->rights->holiday->read && $object->fk_user == $user->id) || !empty($user->rights->holiday->readall);
1556 $delallowed = ($user->rights->holiday->write && $object->fk_user == $user->id) || !empty($user->rights->holiday->writeall_advance);
1557 print $formfile->showdocuments(
'holiday:Holiday', $object->element.
'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $langs->defaultlang);
1565 print
'</div><div class="fichehalfright">';
1568 $morehtmlright =
'';
1571 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1573 $somethingshown =
$formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1,
'', $MAXEVENT,
'', $morehtmlright);
1575 print
'</div></div>';
1583 if (is_object($db)) {
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.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action== 'set') elseif($action== 'specimen') elseif($action== 'setmodel') elseif($action== 'del') elseif($action== 'setdoc') $formactions
View.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
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...
holiday_prepare_head($object)
Return array head with list of tabs to view object informations.
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
dol_now($mode= 'auto')
Return date for now.
Class to manage Dolibarr users.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for properties) With native = 0: P...
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save"&&empty($cancel)) $help_url
View.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
const STATUS_DRAFT
Draft status.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form...
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= 'hideonsmartphone', $textfordropdown= '')
Show information for admin users or standard users.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext,$replyto); $mailfile->sendfile();.
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_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code= '')
Function to return number of working days (and text of units) between two dates (working days) ...
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
const STATUS_APPROVED
Approved.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
restrictedArea($user, $features, $objectid=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.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
const STATUS_VALIDATED
Validated status.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage a WYSIWYG editor.
const STATUS_CANCELED
Canceled.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.
const STATUS_REFUSED
Refused.
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.