33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/holiday.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
46$action =
GETPOST(
'action',
'aZ09');
47$cancel =
GETPOST(
'cancel',
'alpha');
48$confirm =
GETPOST(
'confirm',
'alpha');
49$backtopage =
GETPOST(
'backtopage',
'alpha');
50$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
54$fuserid = (
GETPOST(
'fuserid',
'int') ?
GETPOST(
'fuserid',
'int') : $user->id);
55$socid =
GETPOST(
'socid',
'int');
58$langs->loadLangs(array(
"other",
"holiday",
"mails",
"trips"));
64$childids = $user->getAllChildIds(1);
67if (!empty($conf->global->HOLIDAY_HIDE_FOR_NON_SALARIES)) {
68 $morefilter =
'AND employee = 1';
76$extrafields->fetch_name_optionals_label($object->table_element);
78if (($id > 0) || $ref) {
79 $object->fetch($id, $ref);
83 if (!empty($user->rights->holiday->readall)) {
86 if (!empty($user->rights->holiday->read) && in_array($object->fk_user, $childids)) {
95$hookmanager->initHooks(array(
'holidaycard',
'globalcard'));
99if (!empty($user->rights->holiday->write) && in_array($fuserid, $childids)) {
102if (!empty($user->rights->holiday->writeall)) {
108if (!empty($user->rights->holiday->delete)) {
111if ($object->statut ==
Holiday::STATUS_DRAFT && $user->rights->holiday->write && in_array($object->fk_user, $childids)) {
117 $socid = $user->socid;
119$result =
restrictedArea($user,
'holiday', $object->id,
'holiday',
'',
'',
'rowid', $object->statut);
126$parameters = array(
'socid' => $socid);
127$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
132if (empty($reshook)) {
133 $backurlforlist = DOL_URL_ROOT.
'/holiday/list.php';
135 if (empty($backtopage) || ($cancel && empty($id))) {
136 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
137 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
138 $backtopage = $backurlforlist;
140 $backtopage = DOL_URL_ROOT.
'/holiday/card.php?id='.((!empty($id) && $id > 0) ? $id :
'__ID__');
146 if (!empty($backtopageforcancel)) {
147 header(
"Location: ".$backtopageforcancel);
149 } elseif (!empty($backtopage)) {
150 header(
"Location: ".$backtopage);
157 if ($action ==
'add') {
174 $starthalfday =
GETPOST(
'starthalfday');
175 $endhalfday =
GETPOST(
'endhalfday');
178 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
180 } elseif ($starthalfday ==
'afternoon') {
182 } elseif ($endhalfday ==
'morning') {
186 $approverid =
GETPOST(
'valideur',
'int');
187 $description = trim(
GETPOST(
'description',
'restricthtml'));
190 if (!$cancreateall) {
191 if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
192 if (empty($user->rights->holiday->write)) {
195 } elseif (!in_array($fuserid, $childids)) {
201 if (empty($user->rights->holiday->write) && empty($user->rights->holiday->writeall_advance)) {
204 } elseif (empty($user->rights->holiday->writeall_advance) && !in_array($fuserid, $childids)) {
214 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
220 if (empty($date_debut)) {
226 if (empty($date_fin)) {
232 if ($date_debut > $date_fin) {
239 $verifCP = $object->verifDateHolidayCP($fuserid, $date_debut, $date_fin, $halfday);
247 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
248 if ($nbopenedday < 0.5) {
255 if ($approverid < 1) {
256 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidatorCP'),
null,
'errors');
260 $approverslist = $object->fetch_users_approver_holiday();
261 if (!in_array($approverid, $approverslist)) {
262 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidator'),
null,
'errors');
267 $ret = $extrafields->setOptionalsFromPost(
null, $object);
275 $object->fk_user = $fuserid;
276 $object->description = $description;
277 $object->fk_validator = $approverid;
278 $object->fk_type = $type;
279 $object->date_debut = $date_debut;
280 $object->date_fin = $date_fin;
281 $object->halfday = $halfday;
282 $object->entity = $conf->entity;
284 $result = $object->create($user);
295 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
304 if ($action ==
'update' && GETPOSTISSET(
'savevalidator') && !empty($user->rights->holiday->approve)) {
309 $object->fk_validator =
GETPOST(
'valideur',
'int');
311 if ($object->fk_validator != $object->oldcopy->fk_validator) {
312 $verif = $object->update($user);
316 $action =
'editvalidator';
318 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
326 if ($action ==
'update' && !GETPOSTISSET(
'savevalidator')) {
331 $starthalfday =
GETPOST(
'starthalfday');
332 $endhalfday =
GETPOST(
'endhalfday');
334 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
336 } elseif ($starthalfday ==
'afternoon') {
338 } elseif ($endhalfday ==
'morning') {
343 if (!$cancreateall) {
345 if (!in_array($fuserid, $childids)) {
347 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?action=create');
352 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?action=create');
363 $approverid =
GETPOST(
'valideur',
'int');
366 $description = trim(
GETPOST(
'description',
'restricthtml'));
376 if ($date_debut > $date_fin) {
383 if ($approverid < 1) {
390 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
391 if ($nbopenedday < 0.5) {
400 $object->description = $description;
401 $object->date_debut = $date_debut;
402 $object->date_fin = $date_fin;
403 $object->fk_validator = $approverid;
404 $object->halfday = $halfday;
407 $verif = $object->update($user);
419 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
435 if ($action ==
'confirm_delete' &&
GETPOST(
'confirm') ==
'yes' && $candelete) {
444 $result = $object->delete($user);
453 header(
'Location: list.php?restore_lastsearch_values=1');
461 if ($action ==
'confirm_send') {
470 $verif = $object->validate($user);
475 $destinataire =
new User($db);
476 $destinataire->fetch($object->fk_validator);
477 $emailTo = $destinataire->email;
480 dol_syslog(
"Expected validator has no email, so we redirect directly to finished page without sending email");
481 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
486 $expediteur =
new User($db);
487 $expediteur->fetch($object->fk_user);
489 $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
492 $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
493 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
494 $societeName = $conf->global->MAIN_APPLICATION_TITLE;
497 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysToValidate");
500 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
502 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateBody").
"</p>\n";
506 if (empty($conf->global->HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY)) {
507 $delayForRequest = 0;
508 if ($delayForRequest) {
511 if ($object->date_debut < $nowplusdelay) {
512 $message =
"<p>".$langs->transnoentities(
"HolidaysToValidateDelay", $delayForRequest).
"</p>\n";
518 if (empty($conf->global->HOLIDAY_HIDE_APPROVER_ABOUT_NEGATIVE_BALANCE)) {
519 $nbopenedday =
num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
521 if ($nbopenedday > $object->getCPforUser($object->fk_user, $object->fk_type)) {
522 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateAlertSolde").
"</p>\n";
526 $link =
dol_buildpath(
"/holiday/card.php", 3) .
'?id='.$object->id;
529 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Name").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
530 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Period").
" : ".
dol_print_date($object->date_debut,
'day').
" ".$langs->transnoentitiesnoconv(
"To").
" ".
dol_print_date($object->date_fin,
'day').
"</li>\n";
531 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
532 $message .=
"</ul>\n";
534 $trackid =
'leav'.$object->id;
536 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'',
'', 0, 1,
'',
'', $trackid);
539 $result = $mail->sendfile();
545 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
555 if ($action ==
'update_extras') {
559 $ret = $extrafields->setOptionalsFromPost(
null, $object,
GETPOST(
'attribute',
'restricthtml'));
566 $result = $object->insertExtraFields(
'HOLIDAY_MODIFY');
574 $action =
'edit_extras';
579 if ($action ==
'confirm_valid') {
586 $object->date_approval =
dol_now();
587 $object->fk_user_approve = $user->id;
593 $verif = $object->approve($user);
602 $nbopenedday =
num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
603 $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type);
604 $newSolde = ($soldeActuel - $nbopenedday);
605 $label = $langs->transnoentitiesnoconv(
"Holidays").
' - '.$object->ref;
608 $result = $object->addLogCP($user->id, $object->fk_user, $label, $newSolde, $object->fk_type);
615 $result = $object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type);
624 $destinataire =
new User($db);
625 $destinataire->fetch($object->fk_user);
626 $emailTo = $destinataire->email;
629 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
632 $expediteur =
new User($db);
633 $expediteur->fetch($object->fk_validator);
635 $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
638 $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
639 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
640 $societeName = $conf->global->MAIN_APPLICATION_TITLE;
643 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysValidated");
646 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
648 $message .=
"<p>".$langs->transnoentities(
"HolidaysValidatedBody",
dol_print_date($object->date_debut,
'day'),
dol_print_date($object->date_fin,
'day')).
"</p>\n";
650 $link =
dol_buildpath(
'/holiday/card.php', 3).
'?id='.$object->id;
652 $message .=
"<ul>\n";
653 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ValidatedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
654 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
655 $message .=
"</ul>\n";
657 $trackid =
'leav'.$object->id;
659 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'',
'', 0, 1,
'',
'', $trackid);
662 $result = $mail->sendfile();
674 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
683 if ($action ==
'confirm_refuse' &&
GETPOST(
'confirm',
'alpha') ==
'yes') {
684 if (
GETPOST(
'detail_refuse')) {
689 $object->date_refuse =
dol_now();
690 $object->fk_user_refuse = $user->id;
693 $object->detail_refuse =
GETPOST(
'detail_refuse',
'alphanohtml');
697 $verif = $object->update($user);
706 $destinataire =
new User($db);
707 $destinataire->fetch($object->fk_user);
708 $emailTo = $destinataire->email;
711 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
714 $expediteur =
new User($db);
715 $expediteur->fetch($object->fk_validator);
717 $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
720 $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
721 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
722 $societeName = $conf->global->MAIN_APPLICATION_TITLE;
725 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysRefused");
728 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
730 $message .=
"<p>".$langs->transnoentities(
"HolidaysRefusedBody",
dol_print_date($object->date_debut,
'day'),
dol_print_date($object->date_fin,
'day')).
"<p>\n";
731 $message .=
"<p>".GETPOST(
'detail_refuse',
'alpha').
"</p>";
733 $link =
dol_buildpath(
'/holiday/card.php', 3).
'?id='.$object->id;
735 $message .=
"<ul>\n";
736 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
737 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
740 $trackid =
'leav'.$object->id;
742 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'',
'', 0, 1,
'',
'', $trackid);
745 $result = $mail->sendfile();
759 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
767 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DetailRefusCP")),
null,
'errors');
774 if ($action ==
'confirm_draft' &&
GETPOST(
'confirm') ==
'yes') {
779 $oldstatus = $object->statut;
783 $result = $object->update($user);
786 setEventMessages($langs->trans(
'ErrorBackToDraft').
' '.$object->error, $object->errors,
'errors');
792 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
800 if ($action ==
'confirm_cancel' &&
GETPOST(
'confirm') ==
'yes') {
807 (!empty($user->admin) || $user->id == $object->fk_validator || $cancreate || $cancreateall)) {
810 $oldstatus = $object->statut;
811 $object->date_cancel =
dol_now();
812 $object->fk_user_cancel = $user->id;
816 $result = $object->update($user);
820 $result = $object->call_trigger(
'HOLIDAY_CANCEL', $user);
826 $nbopenedday =
num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
828 $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type);
829 $newSolde = ($soldeActuel + $nbopenedday);
832 $result1 = $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv(
"HolidaysCancelation"), $newSolde, $object->fk_type);
835 $result2 = $object->updateSoldeCP($object->fk_user, $newSolde, $object->fk_type);
837 if ($result1 < 0 || $result2 < 0) {
839 setEventMessages($langs->trans(
'ErrorCantDeleteCP').
' '.$object->error, $object->errors,
'errors');
850 if (!$error && $result > 0) {
852 $destinataire =
new User($db);
853 $destinataire->fetch($object->fk_user);
854 $emailTo = $destinataire->email;
857 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
862 $expediteur =
new User($db);
863 $expediteur->fetch($object->fk_user_cancel);
865 $emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
868 $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
869 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
870 $societeName = $conf->global->MAIN_APPLICATION_TITLE;
873 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysCanceled");
876 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
878 $message .=
"<p>".$langs->transnoentities(
"HolidaysCanceledBody",
dol_print_date($object->date_debut,
'day'),
dol_print_date($object->date_fin,
'day')).
"</p>\n";
880 $link =
dol_buildpath(
'/holiday/card.php', 3).
'?id='.$object->id;
882 $message .=
"<ul>\n";
883 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
884 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
885 $message .=
"</ul>\n";
887 $trackid =
'leav'.$object->id;
889 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'',
'', 0, 1,
'',
'', $trackid);
892 $result = $mail->sendfile();
898 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.$object->id);
928$form =
new Form($db);
931$listhalfday = array(
'morning'=>$langs->trans(
"Morning"),
"afternoon"=>$langs->trans(
"Afternoon"));
933$title = $langs->trans(
'Leave');
934$help_url =
'EN:Module_Holiday';
940if ((empty($id) && empty($ref)) || $action ==
'create' || $action ==
'add') {
942 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) || empty($user->rights->holiday->writeall))))) {
943 $errors[] = $langs->trans(
'CantCreateCP');
952 $errors[] = $langs->trans(
'ErrorEndDateCP');
955 $errors[] = $langs->trans(
'ErrorSQLCreateCP');
958 $errors[] = $langs->trans(
'CantCreateCP');
961 $errors[] = $langs->trans(
'InvalidValidatorCP');
964 $errors[] = $langs->trans(
'NoDateDebut');
967 $errors[] = $langs->trans(
'NoDateFin');
970 $errors[] = $langs->trans(
'ErrorDureeCP');
973 $errors[] = $langs->trans(
'alreadyCPexist');
981 print
'<script type="text/javascript">
982 $( document ).ready(function() {
983 $("input.button-save").click("submit", function(e) {
984 console.log("Call valider()");
985 if (document.demandeCP.date_debut_.value != "")
987 if(document.demandeCP.date_fin_.value != "")
989 if(document.demandeCP.valideur.value != "-1") {
993 alert("'.dol_escape_js($langs->transnoentities(
'InvalidValidatorCP')).
'");
999 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateFin')).
'");
1005 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateDebut')).
'");
1014 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="demandeCP">'.
"\n";
1015 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
1016 print
'<input type="hidden" name="action" value="add" />'.
"\n";
1022 print
'<table class="border centpercent">';
1027 print
'<td class="titlefield fieldrequired tdtop">'.$langs->trans(
"User").
'</td>';
1028 print
'<td><div class="inline-block">';
1029 if ($cancreate && !$cancreateall) {
1030 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->select_dolusers(($fuserid ? $fuserid : $user->id),
'fuserid', 0,
'', 0,
'hierarchyme',
'',
'0,'.$conf->entity, 0, 0, $morefilter, 0,
'',
'minwidth200 maxwidth500 inline-block');
1033 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->select_dolusers($fuserid ? $fuserid : $user->id,
'fuserid', 0,
'', 0,
'',
'',
'0,'.$conf->entity, 0, 0, $morefilter, 0,
'',
'minwidth200 maxwidth500 inline-block');
1037 if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) {
1038 print
'<div class="leaveuserbalance paddingtop inline-block floatright badge badge-status0 badge-status margintoponsmartphone">';
1042 $typeleaves = $object->getTypes(1, 1);
1043 foreach ($typeleaves as $key => $val) {
1044 $nb_type = $object->getCPforUser(($fuserid ? $fuserid : $user->id), $val[
'rowid']);
1045 $nb_holiday += $nb_type;
1047 $out .=
' - '.($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']).
': <strong>'.($nb_type ?
price2num($nb_type) : 0).
'</strong><br>';
1050 print
' ';
1052 $htmltooltip = $langs->trans(
"Detail").
'<br>';
1053 $htmltooltip .= $out;
1055 print $form->textwithtooltip($langs->trans(
'SoldeCPUser', round($nb_holiday, 5)).
' '.
img_picto(
'',
'help'), $htmltooltip);
1058 if (!empty($conf->use_javascript_ajax)) {
1060 print
'$( document ).ready(function() {
1061 jQuery("#fuserid").change(function() {
1062 console.log("We change to user id "+jQuery("#fuserid").val());
1063 if (jQuery("#fuserid").val() == '.((int) $user->id).
') {
1064 jQuery(".leaveuserbalance").show();
1066 jQuery(".leaveuserbalance").hide();
1072 } elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) {
1073 print
'<div class="leaveuserbalance paddingtop">';
1074 print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE);
1083 print
'<td class="fieldrequired">'.$langs->trans(
"Type").
'</td>';
1085 $typeleaves = $object->getTypes(1, -1);
1086 $arraytypeleaves = array();
1087 foreach ($typeleaves as $key => $val) {
1088 $labeltoshow = ($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']);
1089 $labeltoshow .= ($val[
'delay'] > 0 ?
' ('.$langs->trans(
"NoticePeriod").
': '.$val[
'delay'].
' '.$langs->trans(
"days").
')' :
'');
1090 $arraytypeleaves[$val[
'rowid']] = $labeltoshow;
1092 print $form->selectarray(
'type', $arraytypeleaves, (
GETPOST(
'type',
'alpha') ?
GETPOST(
'type',
'alpha') :
''), 1, 0, 0,
'', 0, 0, 0,
'',
'', true);
1094 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1101 print
'<td class="fieldrequired">';
1102 print $form->textwithpicto($langs->trans(
"DateDebCP"), $langs->trans(
"FirstDayOfHoliday"));
1104 print
'<td>'.img_picto(
'',
'action',
'class="pictofixedwidth"');
1105 if (!
GETPOST(
'date_debut_')) {
1106 print $form->selectDate(-1,
'date_debut_', 0, 0, 0,
'', 1, 1);
1109 print $form->selectDate($tmpdate,
'date_debut_', 0, 0, 0,
'', 1, 1);
1111 print
' ';
1112 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday',
'alpha') ?
GETPOST(
'starthalfday',
'alpha') :
'morning'));
1118 print
'<td class="fieldrequired">';
1119 print $form->textwithpicto($langs->trans(
"DateFinCP"), $langs->trans(
"LastDayOfHoliday"));
1121 print
'<td>'.img_picto(
'',
'action',
'class="pictofixedwidth"');
1123 print $form->selectDate(-1,
'date_fin_', 0, 0, 0,
'', 1, 1);
1126 print $form->selectDate($tmpdate,
'date_fin_', 0, 0, 0,
'', 1, 1);
1128 print
' ';
1129 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday',
'alpha') ?
GETPOST(
'endhalfday',
'alpha') :
'afternoon'));
1135 print
'<td class="fieldrequired">'.$langs->trans(
"ReviewedByCP").
'</td>';
1139 $include_users = $object->fetch_users_approver_holiday();
1140 if (empty($include_users)) {
1141 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1145 $defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
1146 if (!empty($conf->global->HOLIDAY_DEFAULT_VALIDATOR)) {
1147 $defaultselectuser = $conf->global->HOLIDAY_DEFAULT_VALIDATOR;
1149 if (
GETPOST(
'valideur',
'int') > 0) {
1150 $defaultselectuser =
GETPOST(
'valideur',
'int');
1152 $s = $form->select_dolusers($defaultselectuser,
"valideur", 1,
'', 0, $include_users,
'',
'0,'.$conf->entity, 0, 0,
'', 0,
'',
'minwidth200 maxwidth500');
1153 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1162 print
'<td>'.$langs->trans(
"DescCP").
'</td>';
1163 print
'<td class="tdtop">';
1164 $doleditor =
new DolEditor(
'description',
GETPOST(
'description',
'restricthtml'),
'', 80,
'dolibarr_notes',
'In', 0,
false, isModEnabled(
'fckeditor'), ROWS_3,
'90%');
1165 print $doleditor->Create(1);
1169 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1176 print $form->buttonsSaveCancel(
"SendRequestCP");
1178 print
'</from>'.
"\n";
1181 if ($error && $action !=
'edit') {
1182 print
'<div class="tabBar">';
1184 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1188 if (($id > 0) || $ref) {
1189 $result = $object->fetch($id, $ref);
1191 $approverexpected =
new User($db);
1192 $approverexpected->fetch($object->fk_validator);
1194 $userRequest =
new User($db);
1195 $userRequest->fetch($object->fk_user);
1203 $errors[] = $langs->transnoentitiesnoconv(
'ErrorEndDateCP');
1206 $errors[] = $langs->transnoentitiesnoconv(
'ErrorSQLCreateCP');
1209 $errors[] = $langs->transnoentitiesnoconv(
'CantCreateCP');
1212 $errors[] = $langs->transnoentitiesnoconv(
'InvalidValidatorCP');
1215 $errors[] = $langs->transnoentitiesnoconv(
'NoDateDebut');
1218 $errors[] = $langs->transnoentitiesnoconv(
'NoDateFin');
1220 case 'DureeHoliday':
1221 $errors[] = $langs->transnoentitiesnoconv(
'ErrorDureeCP');
1223 case 'NoMotifRefuse':
1224 $errors[] = $langs->transnoentitiesnoconv(
'NoMotifRefuseCP');
1227 $errors[] = $langs->transnoentitiesnoconv(
'ErrorMailNotSend');
1238 if (($action ==
'edit' && $object->statut ==
Holiday::STATUS_DRAFT) || ($action ==
'editvalidator')) {
1243 print
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">'.
"\n";
1244 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
1245 print
'<input type="hidden" name="action" value="update"/>'.
"\n";
1246 print
'<input type="hidden" name="id" value="'.$object->id.
'" />'.
"\n";
1249 print
dol_get_fiche_head($head,
'card', $langs->trans(
"CPTitreMenu"), -1,
'holiday');
1251 $linkback =
'<a href="'.DOL_URL_ROOT.
'/holiday/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1256 print
'<div class="fichecenter">';
1257 print
'<div class="fichehalfleft">';
1258 print
'<div class="underbanner clearboth"></div>';
1260 print
'<table class="border tableforfield centpercent">';
1265 print
'<td class="titlefield">'.$langs->trans(
"User").
'</td>';
1267 print $userRequest->getNomUrl(-1,
'leave');
1272 print
'<td>'.$langs->trans(
"Type").
'</td>';
1274 $typeleaves = $object->getTypes(1, -1);
1275 $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']);
1276 print empty($labeltoshow) ? $langs->trans(
"TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow;
1280 $starthalfday = ($object->halfday == -1 || $object->halfday == 2) ?
'afternoon' :
'morning';
1281 $endhalfday = ($object->halfday == 1 || $object->halfday == 2) ?
'morning' :
'afternoon';
1285 print
'<td class="nowrap">';
1286 print $form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1288 print
'<td>'.dol_print_date($object->date_debut,
'day');
1289 print
' ';
1290 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).
'</span>';
1295 print
'<td class="nowrap">';
1296 print $form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1300 print $form->selectDate($tmpdate ? $tmpdate : $object->date_debut,
'date_debut_');
1301 print
' ';
1302 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday') ?
GETPOST(
'starthalfday') : $starthalfday));
1309 print
'<td class="nowrap">';
1310 print $form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1312 print
'<td>'.dol_print_date($object->date_fin,
'day');
1313 print
' ';
1314 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).
'</span>';
1319 print
'<td class="nowrap">';
1320 print $form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1323 print $form->selectDate($object->date_fin,
'date_fin_');
1324 print
' ';
1325 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday') ?
GETPOST(
'endhalfday') : $endhalfday));
1333 $htmlhelp = $langs->trans(
'NbUseDaysCPHelp');
1334 $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1);
1335 $includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1);
1336 if ($includesaturday) {
1337 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Saturday"));
1339 if ($includesunday) {
1340 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Sunday"));
1342 print $form->textwithpicto($langs->trans(
'NbUseDaysCP'), $htmlhelp);
1345 print
num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
1351 print
'<td>'.$langs->trans(
'DetailRefusCP').
'</td>';
1352 print
'<td>'.$object->detail_refuse.
'</td>';
1359 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1360 print
'<td>'.nl2br($object->description).
'</td>';
1364 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1365 print
'<td class="tdtop">';
1366 $doleditor =
new DolEditor(
'description', $object->description,
'', 80,
'dolibarr_notes',
'In', 0,
false, isModEnabled(
'fckeditor'), ROWS_3,
'90%');
1367 print $doleditor->Create(1);
1372 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1375 print
'</table>'.
"\n";
1378 print
'<div class="fichehalfright">';
1380 print
'<div class="underbanner clearboth"></div>';
1383 print
'<table class="border tableforfield centpercent">'.
"\n";
1386 if (!empty($object->fk_user_create)) {
1387 $userCreate =
new User($db);
1388 $userCreate->fetch($object->fk_user_create);
1390 print
'<td class="titlefield">'.$langs->trans(
'RequestByCP').
'</td>';
1391 print
'<td>'.$userCreate->getNomUrl(-1).
'</td>';
1396 if (!$edit && $action !=
'editvalidator') {
1398 print
'<td class="titlefield">';
1400 print $langs->trans(
'ApprovedBy');
1402 print $langs->trans(
'ReviewedByCP');
1407 if ($object->fk_user_approve > 0) {
1408 $approverdone =
new User($db);
1409 $approverdone->fetch($object->fk_user_approve);
1410 print $approverdone->getNomUrl(-1);
1413 print $approverexpected->getNomUrl(-1);
1415 $include_users = $object->fetch_users_approver_holiday();
1417 print
'<a class="editfielda paddingleft" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=editvalidator">'.
img_edit($langs->trans(
"Edit")).
'</a>';
1423 print
'<td class="titlefield">'.$langs->trans(
'ReviewedByCP').
'</td>';
1425 $include_users = $object->fetch_users_approver_holiday();
1426 if (!in_array($object->fk_validator, $include_users)) {
1427 $include_users[] = $object->fk_validator;
1429 if (empty($include_users)) {
1430 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1432 $arrayofvalidatorstoexclude = (($user->admin || ($user->id != $userRequest->id)) ?
'' : array($user->id));
1433 $s = $form->select_dolusers($object->fk_validator,
"valideur", (($action ==
'editvalidator') ? 0 : 1), $arrayofvalidatorstoexclude, 0, $include_users);
1434 print $form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1436 if ($action ==
'editvalidator') {
1437 print
'<input type="submit" class="button button-save" name="savevalidator" value="'.$langs->trans(
"Save").
'">';
1438 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1445 print
'<td>'.$langs->trans(
'DateCreation').
'</td>';
1446 print
'<td>'.dol_print_date($object->date_create,
'dayhour',
'tzuser').
'</td>';
1450 print
'<td>'.$langs->trans(
'DateValidCP').
'</td>';
1451 print
'<td>'.dol_print_date($object->date_approval,
'dayhour',
'tzuser').
'</td>';
1456 print
'<td>'.$langs->trans(
'DateCancelCP').
'</td>';
1457 print
'<td>'.dol_print_date($object->date_cancel,
'dayhour',
'tzuser').
'</td>';
1462 print
'<td>'.$langs->trans(
'DateRefusCP').
'</td>';
1463 print
'<td>'.dol_print_date($object->date_refuse,
'dayhour',
'tzuser').
'</td>';
1472 print
'<div class="clearboth"></div>';
1478 if ($action ==
'delete') {
1480 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleDeleteCP"), $langs->trans(
"ConfirmDeleteCP"),
"confirm_delete",
'', 0, 1);
1486 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleToValidCP"), $langs->trans(
"ConfirmToValidCP"),
"confirm_send",
'', 1, 1);
1490 if ($action ==
'valid') {
1491 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleValidCP"), $langs->trans(
"ConfirmValidCP"),
"confirm_valid",
'', 1, 1);
1495 if ($action ==
'refuse') {
1496 $array_input = array(array(
'type'=>
"text",
'label'=> $langs->trans(
'DetailRefusCP'),
'name'=>
"detail_refuse",
'size'=>
"50",
'value'=>
""));
1497 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id.
"&action=confirm_refuse", $langs->trans(
"TitleRefuseCP"), $langs->trans(
'ConfirmRefuseCP'),
"confirm_refuse", $array_input, 1, 0);
1501 if ($action ==
'cancel') {
1502 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleCancelCP"), $langs->trans(
"ConfirmCancelCP"),
"confirm_cancel",
'', 1, 1);
1506 if ($action ==
'backtodraft') {
1507 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".$object->id, $langs->trans(
"TitleSetToDraft"), $langs->trans(
"ConfirmSetToDraft"),
"confirm_draft",
'', 1, 1);
1510 if (($action ==
'edit' && $object->statut ==
Holiday::STATUS_DRAFT) || ($action ==
'editvalidator')) {
1513 print $form->buttonsSaveCancel();
1523 print
'<div class="tabsAction">';
1526 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.newToken().
'" class="butAction">'.$langs->trans(
"EditCP").
'</a>';
1530 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=sendToValidate&token='.newToken().
'" class="butAction">'.$langs->trans(
"Validate").
'</a>';
1535 if ($user->id == $object->fk_validator) {
1536 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=valid&token='.newToken().
'" class="butAction">'.$langs->trans(
"Approve").
'</a>';
1537 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=refuse&token='.newToken().
'" class="butAction">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1539 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"Approve").
'</a>';
1540 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1543 if ($cancreate || $cancreateall) {
1544 if (($object->date_fin >
dol_now()) || !empty($user->admin)) {
1545 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=cancel&token='.newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1547 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
'-'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1553 if ($user->id == $object->fk_validator || $user->id == $object->fk_user_approve || $cancreate || $cancreateall) {
1554 if (($object->date_fin >
dol_now()) || !empty($user->admin) || $user->id == $object->fk_user_approve) {
1555 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=cancel&token='.newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1557 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
'-'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1560 if (!empty($user->admin)) {
1561 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=cancel&token='.newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1563 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1569 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=backtodraft" class="butAction">'.$langs->trans(
"SetToDraft").
'</a>';
1572 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.newToken().
'" class="butActionDelete">'.$langs->trans(
"DeleteCP").
'</a>';
1578 print
'<div class="tabBar">';
1579 print $langs->trans(
'ErrorUserViewCP');
1580 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1584 print
'<div class="tabBar">';
1585 print $langs->trans(
'ErrorIDFicheCP');
1586 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1592 if (
GETPOST(
'modelselected')) {
1593 $action =
'presend';
1596 if ($action !=
'presend' && $action !=
'edit') {
1597 print
'<div class="fichecenter"><div class="fichehalfleft">';
1598 print
'<a name="builddoc"></a>';
1600 $includedocgeneration = 0;
1603 if ($includedocgeneration) {
1605 $relativepath = $objref.
'/'.$objref.
'.pdf';
1606 $filedir = $conf->holiday->dir_output.
'/'.$object->element.
'/'.$objref;
1607 $urlsource = $_SERVER[
"PHP_SELF"].
"?id=".$object->id;
1608 $genallowed = ($user->rights->holiday->read && $object->fk_user == $user->id) || !empty($user->rights->holiday->readall);
1609 $delallowed = ($user->rights->holiday->write && $object->fk_user == $user->id) || !empty($user->rights->holiday->writeall_advance);
1610 print $formfile->showdocuments(
'holiday:Holiday', $object->element.
'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0,
'',
'',
'', $langs->defaultlang);
1618 print
'</div><div class="fichehalfright">';
1621 $morehtmlright =
'';
1624 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1626 $somethingshown =
$formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1,
'', $MAXEVENT,
'', $morehtmlright);
1628 print
'</div></div>';
1636if (is_object($db)) {
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(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,...
Class to manage a WYSIWYG editor.
Class of the module paid holiday.
const STATUS_VALIDATED
Validated status.
const STATUS_DRAFT
Draft status.
const STATUS_REFUSED
Refused.
const STATUS_CANCELED
Canceled.
const STATUS_APPROVED
Approved.
Class to manage Dolibarr users.
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)
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
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.
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...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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)
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
holiday_prepare_head($object)
Return array head with list of tabs to view object informations.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.