35require
'../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/holiday.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
56$action =
GETPOST(
'action',
'aZ09');
57$cancel =
GETPOST(
'cancel',
'alpha');
58$confirm =
GETPOST(
'confirm',
'alpha');
59$backtopage =
GETPOST(
'backtopage',
'alpha');
60$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
64$fuserid = (
GETPOSTINT(
'fuserid') ?
GETPOSTINT(
'fuserid') : ($action ==
'create' ? $user->id : 0));
68$langs->loadLangs(array(
"other",
"holiday",
"mails",
"trips"));
75$childids = $user->getAllChildIds(1);
79 $morefilter =
'AND employee = 1';
87$extrafields->fetch_name_optionals_label(
$object->table_element);
90$hookmanager->initHooks(array(
'holidaycard',
'globalcard'));
92$permissiontoapprove = $user->hasRight(
'holiday',
'approve');
95if (($id > 0) || $ref) {
99 if ($user->hasRight(
'holiday',
'readall')) {
102 if ($user->hasRight(
'holiday',
'read') && in_array(
$object->fk_user, $childids)) {
105 if ($permissiontoapprove &&
$object->fk_validator == $user->id && !
getDolGlobalString(
'HOLIDAY_CAN_APPROVE_ONLY_THE_SUBORDINATES')) {
117$permissiontoaddall = 0;
118if ($user->hasRight(
'holiday',
'write') && in_array($fuserid, $childids)) {
119 $permissiontoadd = 1;
121if ($user->hasRight(
'holiday',
'writeall')) {
122 $permissiontoadd = 1;
123 $permissiontoaddall = 1;
125$permissiontoeditextra = $permissiontoadd;
126if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
128 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
132if ($user->hasRight(
'holiday',
'delete')) {
141 $socid = $user->socid;
150$parameters = array(
'socid' => $socid);
151$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
156if (empty($reshook)) {
157 $backurlforlist = DOL_URL_ROOT.
'/holiday/list.php';
159 if (empty($backtopage) || ($cancel && empty($id))) {
160 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
161 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
162 $backtopage = $backurlforlist;
164 $backtopage = DOL_URL_ROOT.
'/holiday/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
170 if (!empty($backtopageforcancel)) {
171 header(
"Location: ".$backtopageforcancel);
173 } elseif (!empty($backtopage)) {
174 header(
"Location: ".$backtopage);
181 if ($action ==
'add' && $permissiontoadd) {
186 $date_debut =
GETPOSTDATE(
'date_debut_',
'00:00:00');
188 $date_debut_gmt =
GETPOSTDATE(
'date_debut_',
'00:00:00', 1);
189 $date_fin_gmt =
GETPOSTDATE(
'date_fin_',
'00:00:00', 1);
190 $starthalfday =
GETPOST(
'starthalfday');
191 $endhalfday =
GETPOST(
'endhalfday');
194 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
196 } elseif ($starthalfday ==
'afternoon') {
198 } elseif ($endhalfday ==
'morning') {
203 $description = trim(
GETPOST(
'description',
'restricthtml'));
206 if (!$permissiontoaddall) {
208 if (!$user->hasRight(
'holiday',
'write')) {
211 } elseif (!in_array($fuserid, $childids)) {
217 if (!$user->hasRight(
'holiday',
'write') && !$user->hasRight(
'holiday',
'writeall_advance')) {
220 } elseif (!$user->hasRight(
'holiday',
'writeall_advance') && !in_array($fuserid, $childids)) {
230 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
236 if (empty($date_debut)) {
242 if (empty($date_fin)) {
248 if ($date_debut > $date_fin) {
255 $verifCP =
$object->verifDateHolidayCP($fuserid, $date_debut, $date_fin, $halfday);
263 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
264 if ($nbopenedday < 0.5) {
271 if ($approverid < 1) {
272 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidatorCP'),
null,
'errors');
276 $approverslist =
$object->fetch_users_approver_holiday();
277 if (!in_array($approverid, $approverslist)) {
278 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidator'),
null,
'errors');
283 $ret = $extrafields->setOptionalsFromPost(
null,
$object);
292 $object->description = $description;
293 $object->fk_validator = $approverid;
295 $object->date_debut = $date_debut;
300 $result =
$object->create($user);
311 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
319 if ($action ==
'update' && GETPOSTISSET(
'savevalidator') && $permissiontoapprove) {
327 $verif =
$object->update($user);
331 $action =
'editvalidator';
333 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
341 if ($action ==
'update' && !GETPOSTISSET(
'savevalidator')) {
342 $date_debut =
GETPOSTDATE(
'date_debut_',
'00:00:00');
344 $date_debut_gmt =
GETPOSTDATE(
'date_debut_',
'00:00:00', 1);
345 $date_fin_gmt =
GETPOSTDATE(
'date_fin_',
'00:00:00', 1);
346 $starthalfday =
GETPOST(
'starthalfday');
347 $endhalfday =
GETPOST(
'endhalfday');
349 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
351 } elseif ($starthalfday ==
'afternoon') {
353 } elseif ($endhalfday ==
'morning') {
358 if (!$permissiontoaddall) {
359 if ($permissiontoadd) {
360 if (!in_array($fuserid, $childids)) {
362 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?action=create');
367 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?action=create');
377 if ($permissiontoadd) {
381 $description = trim(
GETPOST(
'description',
'restricthtml'));
391 if ($date_debut > $date_fin) {
398 if ($approverid < 1) {
405 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
406 if ($nbopenedday < 0.5) {
415 $object->description = $description;
416 $object->date_debut = $date_debut;
418 $object->fk_validator = $approverid;
422 $verif =
$object->update($user);
434 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
450 if ($action ==
'confirm_delete' &&
GETPOST(
'confirm') ==
'yes' && $candelete) {
459 $result =
$object->delete($user);
468 header(
'Location: list.php?restore_lastsearch_values=1');
476 if ($action ==
'confirm_send') {
485 $verif =
$object->validate($user);
490 $destinataire =
new User($db);
491 $destinataire->fetch(
$object->fk_validator);
492 $emailTo = $destinataire->email;
495 dol_syslog(
"Expected validator has no email, so we redirect directly to finished page without sending email");
496 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
501 $expediteur =
new User($db);
502 $expediteur->fetch(
$object->fk_user);
512 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysToValidate");
515 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
517 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateBody").
"</p>\n";
522 $delayForRequest = 0;
523 if ($delayForRequest) {
526 if (
$object->date_debut < $nowplusdelay) {
527 $message =
"<p>".$langs->transnoentities(
"HolidaysToValidateDelay", $delayForRequest).
"</p>\n";
536 $affectingtypes =
$object->getTypes(1, 1);
537 if (!empty($affectingtypes[
$object->fk_type])) {
541 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateAlertSolde").
"</p>\n";
546 $typeleaves =
$object->getTypes(1, -1);
547 if (empty($typeleaves[
$object->fk_type])) {
548 $labeltoshow = $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type);
550 $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']);
553 $starthalfdaykey =
"Afternoon";
554 $endhalfdaykey =
"Morning";
555 } elseif (
$object->halfday == -1) {
556 $starthalfdaykey =
"Afternoon";
557 $endhalfdaykey =
"Afternoon";
558 } elseif (
$object->halfday == 1) {
559 $starthalfdaykey =
"Morning";
560 $endhalfdaykey =
"Morning";
562 $starthalfdaykey =
"Morning";
563 $endhalfdaykey =
"Afternoon";
565 $starthalfdaykey =
"";
569 $link =
dol_buildpath(
"/holiday/card.php", 3) .
'?id='.$object->id;
572 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Name").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
573 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Type").
" : ".(empty($labeltoshow) ? $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type) : $labeltoshow).
"</li>\n";
574 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Period").
" : ".
dol_print_date(
$object->date_debut,
'day').
" ".$langs->transnoentitiesnoconv($starthalfdaykey).
" ".$langs->transnoentitiesnoconv(
"To").
" ".
dol_print_date(
$object->date_fin,
'day').
" ".$langs->transnoentitiesnoconv($endhalfdaykey).
"</li>\n";
575 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
576 $message .=
"</ul>\n";
578 $trackid =
'leav'.$object->id;
582 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
585 $result = $mail->sendfile();
591 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
601 if ($action ==
'update_extras' && $permissiontoeditextra) {
604 $attribute_name =
GETPOST(
'attribute',
'aZ09');
607 $ret = $extrafields->setOptionalsFromPost(
null,
$object, $attribute_name);
613 $result =
$object->updateExtraField($attribute_name,
'HOLIDAY_MODIFY');
621 $action =
'edit_extras';
626 if ($action ==
'confirm_valid' && $permissiontoapprove) {
634 $object->fk_user_approve = $user->id;
642 $verif =
$object->approve($user);
649 if (!$error && empty($decrease)) {
653 $newSolde = ($soldeActuel - $nbopenedday);
654 $label =
$object->ref.
' - '.$langs->transnoentitiesnoconv(
"HolidayConsumption");
673 $destinataire =
new User($db);
674 $destinataire->fetch(
$object->fk_user);
675 $emailTo = $destinataire->email;
678 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
681 $expediteur =
new User($db);
682 $expediteur->fetch(
$object->fk_validator);
692 $subject =
'['.$societeName.
"] ".$langs->transnoentitiesnoconv(
"HolidaysValidated");
695 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
701 $message .=
"<ul>\n";
702 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ValidatedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
703 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
704 $message .=
"</ul>\n";
706 $trackid =
'leav'.$object->id;
710 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
713 $result = $mail->sendfile();
729 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
734 if ($action ==
'confirm_refuse' &&
GETPOST(
'confirm',
'alpha') ==
'yes' && $permissiontoapprove) {
735 if (
GETPOST(
'detail_refuse')) {
741 $object->fk_user_refuse = $user->id;
748 $verif =
$object->update($user);
757 $destinataire =
new User($db);
758 $destinataire->fetch(
$object->fk_user);
759 $emailTo = $destinataire->email;
762 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
765 $expediteur =
new User($db);
766 $expediteur->fetch(
$object->fk_validator);
776 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysRefused");
779 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
782 $message .=
"<p>".GETPOST(
'detail_refuse',
'alpha').
"</p>";
786 $message .=
"<ul>\n";
787 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
788 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
791 $trackid =
'leav'.$object->id;
795 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
798 $result = $mail->sendfile();
812 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
820 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DetailRefusCP")),
null,
'errors');
827 if ($action ==
'confirm_draft' &&
GETPOST(
'confirm') ==
'yes' && $permissiontoadd) {
836 $result =
$object->update($user);
845 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
853 if ($action ==
'confirm_cancel' &&
GETPOST(
'confirm') ==
'yes') {
860 ($user->id ==
$object->fk_validator || $permissiontoadd || $permissiontoaddall || $permissiontoapprove)) {
865 $object->fk_user_cancel = $user->id;
871 $result =
$object->update($user);
875 $result =
$object->call_trigger(
'HOLIDAY_CANCEL', $user);
880 $startDate =
$object->date_debut_gmt;
881 $endDate =
$object->date_fin_gmt;
883 if (!empty($decrease)) {
885 $date = strtotime(
'-1 month', $lastUpdate);
886 $endOfMonthBeforeLastUpdate =
dol_mktime(0, 0, 0, (
int) date(
'm', $date), (
int) date(
't', $date), (
int) date(
'Y', $date), 1);
887 if (
$object->date_debut_gmt < $endOfMonthBeforeLastUpdate &&
$object->date_fin_gmt > $endOfMonthBeforeLastUpdate) {
888 $endDate = $endOfMonthBeforeLastUpdate;
889 } elseif (
$object->date_debut_gmt > $endOfMonthBeforeLastUpdate) {
890 $endDate = $startDate;
898 $newSolde = ($soldeActuel + $nbopenedday);
901 $result1 =
$object->addLogCP($user->id,
$object->fk_user,
$object->ref.
' - '.$langs->transnoentitiesnoconv(
"HolidayCreditAfterCancellation"), $newSolde,
$object->fk_type);
906 if ($result1 < 0 || $result2 < 0) {
919 if (!$error && $result > 0) {
921 $destinataire =
new User($db);
922 $destinataire->fetch(
$object->fk_user);
923 $emailTo = $destinataire->email;
926 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
931 $expediteur =
new User($db);
932 $expediteur->fetch(
$object->fk_user_cancel);
942 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysCanceled");
945 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
951 $message .=
"<ul>\n";
952 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
953 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
954 $message .=
"</ul>\n";
956 $trackid =
'leav'.$object->id;
960 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
963 $result = $mail->sendfile();
969 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
999$form =
new Form($db);
1003$listhalfday = array(
'morning' => $langs->trans(
"Morning"),
"afternoon" => $langs->trans(
"Afternoon"));
1005$title = $langs->trans(
'Leave');
1006$help_url =
'EN:Module_Holiday';
1008llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-holiday page-card');
1012if ((empty($id) && empty($ref)) || $action ==
'create' || $action ==
'add') {
1014 if ((in_array($fuserid, $childids) && !$user->hasRight(
'holiday',
'write')) || (!in_array($fuserid, $childids) && ((
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && !$user->hasRight(
'holiday',
'writeall_advance') || !$user->hasRight(
'holiday',
'writeall'))))) {
1015 $errors[] = $langs->trans(
'CantCreateCP');
1024 $errors[] = $langs->trans(
'ErrorEndDateCP');
1027 $errors[] = $langs->trans(
'ErrorSQLCreateCP');
1030 $errors[] = $langs->trans(
'CantCreateCP');
1033 $errors[] = $langs->trans(
'InvalidValidatorCP');
1036 $errors[] = $langs->trans(
'NoDateDebut');
1039 $errors[] = $langs->trans(
'NoDateFin');
1041 case 'DureeHoliday':
1042 $errors[] = $langs->trans(
'ErrorDureeCP');
1045 $errors[] = $langs->trans(
'alreadyCPexist');
1053 print
'<script type="text/javascript">
1054 $( document ).ready(function() {
1055 $("input.button-save").click("submit", function(e) {
1056 console.log("Call valider()");
1057 if (document.demandeCP.date_debut_.value != "")
1059 if(document.demandeCP.date_fin_.value != "")
1061 if(document.demandeCP.valideur.value != "-1") {
1065 alert("'.dol_escape_js($langs->transnoentities(
'InvalidValidatorCP')).
'");
1071 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateFin')).
'");
1077 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateDebut')).
'");
1086 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="demandeCP">'.
"\n";
1087 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
1088 print
'<input type="hidden" name="action" value="add" />'.
"\n";
1094 print
'<table class="border centpercent">';
1099 print
'<td class="titlefield fieldrequired tdtop">'.$langs->trans(
"User").
'</td>';
1100 print
'<td><div class="inline-block">';
1101 if ($permissiontoadd && !$permissiontoaddall) {
1102 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->select_dolusers(($fuserid ? $fuserid : $user->id),
'fuserid', 0, null, 0,
'hierarchyme',
'',
'0,'.
$conf->entity, 0, 0, $morefilter, 0,
'',
'minwidth200 maxwidth500 inline-block');
1105 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->select_dolusers($fuserid ? $fuserid : $user->id,
'fuserid', 0, null, 0,
'',
'',
'0,'.
$conf->entity, 0, 0, $morefilter, 0,
'',
'minwidth200 maxwidth500 inline-block');
1110 print
'<div class="leaveuserbalance paddingtop inline-block floatright badge badge-status0 badge-status margintoponsmartphone">';
1114 $typeleaves =
$object->getTypes(1, 1);
1115 foreach ($typeleaves as $key => $val) {
1116 $nb_type =
$object->getCPforUser(($fuserid ? $fuserid : $user->id), $val[
'rowid']);
1117 $nb_holiday += $nb_type;
1119 $out .=
' - '.($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']).
': <strong>'.($nb_type ?
price2num($nb_type) : 0).
'</strong><br>';
1122 print
' ';
1124 $htmltooltip = $langs->trans(
"Detail").
'<br>';
1125 $htmltooltip .= $out;
1127 print $form->textwithtooltip($langs->trans(
'SoldeCPUser', (
string) round($nb_holiday, 5)).
' '.
img_picto(
'',
'help'), $htmltooltip);
1130 if (!empty(
$conf->use_javascript_ajax)) {
1132 print
'$( document ).ready(function() {
1133 jQuery("#fuserid").change(function() {
1134 console.log("We change to user id "+jQuery("#fuserid").val());
1135 if (jQuery("#fuserid").val() == '.((int) $user->id).
') {
1136 jQuery(".leaveuserbalance").show();
1138 jQuery(".leaveuserbalance").hide();
1145 print
'<div class="leaveuserbalance paddingtop">';
1155 print
'<td class="fieldrequired">'.$langs->trans(
"Type").
'</td>';
1157 $typeleaves =
$object->getTypes(1, -1);
1158 $arraytypeleaves = array();
1159 foreach ($typeleaves as $key => $val) {
1160 $labeltoshow = ($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']);
1161 $labeltoshow .= ($val[
'delay'] > 0 ?
' ('.$langs->trans(
"NoticePeriod").
': '.$val[
'delay'].
' '.$langs->trans(
"days").
')' :
'');
1162 $arraytypeleaves[$val[
'rowid']] = $labeltoshow;
1164 if (empty($typeleaves)) {
1165 print $langs->trans(
"PleaseDefineSomeTypeOfHolidayFirst");
1167 print $form->selectarray(
'type', $arraytypeleaves, (
GETPOST(
'type',
'alpha') ?
GETPOST(
'type',
'alpha') :
''), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1169 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1177 print
'<td class="fieldrequired">';
1178 print $form->textwithpicto($langs->trans(
"DateDebCP"), $langs->trans(
"FirstDayOfHoliday"));
1180 print
'<td>'.img_picto(
'',
'action',
'class="pictofixedwidth"');
1181 if (!
GETPOST(
'date_debut_')) {
1182 print $form->selectDate(-1,
'date_debut_', 0, 0, 0,
'', 1, 1);
1184 $tmpdate =
GETPOSTDATE(
'date_debut_',
'00:00:00');
1185 print $form->selectDate($tmpdate,
'date_debut_', 0, 0, 0,
'', 1, 1);
1187 print
' ';
1188 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday',
'alpha') ?
GETPOST(
'starthalfday',
'alpha') :
'morning'));
1194 print
'<td class="fieldrequired">';
1195 print $form->textwithpicto($langs->trans(
"DateFinCP"), $langs->trans(
"LastDayOfHoliday"));
1197 print
'<td>'.img_picto(
'',
'action',
'class="pictofixedwidth"');
1199 print $form->selectDate(-1,
'date_fin_', 0, 0, 0,
'', 1, 1);
1202 print $form->selectDate($tmpdate,
'date_fin_', 0, 0, 0,
'', 1, 1);
1204 print
' ';
1205 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday',
'alpha') ?
GETPOST(
'endhalfday',
'alpha') :
'afternoon'));
1211 print
'<td class="fieldrequired">'.$langs->trans(
"ReviewedByCP").
'</td>';
1215 $include_users =
$object->fetch_users_approver_holiday();
1216 if (empty($include_users)) {
1217 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1221 $defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
1222 if ($fuserid != $user->id) {
1223 $fuser =
new User($db);
1224 $fuser->fetch($fuserid);
1225 $defaultselectuser = (empty($fuser->fk_user_holiday_validator) ? $fuser->fk_user : $fuser->fk_user_holiday_validator);
1234 $s = $form->select_dolusers($defaultselectuser,
"valideur", 1,
null, 0, $include_users,
'',
'0,'.
$conf->entity, 0, 0,
'', 0,
'',
'minwidth200 maxwidth500');
1235 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1244 print
'<td>'.$langs->trans(
"DescCP").
'</td>';
1245 print
'<td class="tdtop">';
1246 $doleditor =
new DolEditor(
'description',
GETPOST(
'description',
'restricthtml'),
'', 80,
'dolibarr_notes',
'In',
false,
false, isModEnabled(
'fckeditor'), ROWS_3,
'90%');
1247 print $doleditor->Create(1);
1251 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1258 print $form->buttonsSaveCancel(
"SendRequestCP");
1260 print
'</from>'.
"\n";
1263 if ($error && $action !=
'edit') {
1264 print
'<div class="tabBar">';
1265 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1269 if (($id > 0) || $ref) {
1270 $result =
$object->fetch($id, $ref);
1272 $approverexpected =
new User($db);
1273 $approverexpected->fetch(
$object->fk_validator);
1275 $userRequest =
new User($db);
1276 $userRequest->fetch(
$object->fk_user);
1284 $errors[] = $langs->transnoentitiesnoconv(
'ErrorEndDateCP');
1287 $errors[] = $langs->transnoentitiesnoconv(
'ErrorSQLCreateCP');
1290 $errors[] = $langs->transnoentitiesnoconv(
'CantCreateCP');
1293 $errors[] = $langs->transnoentitiesnoconv(
'InvalidValidatorCP');
1296 $errors[] = $langs->transnoentitiesnoconv(
'NoDateDebut');
1299 $errors[] = $langs->transnoentitiesnoconv(
'NoDateFin');
1301 case 'DureeHoliday':
1302 $errors[] = $langs->transnoentitiesnoconv(
'ErrorDureeCP');
1304 case 'NoMotifRefuse':
1305 $errors[] = $langs->transnoentitiesnoconv(
'NoMotifRefuseCP');
1308 $errors[] = $langs->transnoentitiesnoconv(
'ErrorMailNotSend');
1324 print
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">'.
"\n";
1325 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
1326 print
'<input type="hidden" name="action" value="update"/>'.
"\n";
1327 print
'<input type="hidden" name="id" value="'.$object->id.
'" />'.
"\n";
1330 print
dol_get_fiche_head($head,
'card', $langs->trans(
"CPTitreMenu"), -1,
'holiday');
1332 $linkback =
'<a href="'.DOL_URL_ROOT.
'/holiday/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1334 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref');
1337 print
'<div class="fichecenter">';
1338 print
'<div class="fichehalfleft">';
1339 print
'<div class="underbanner clearboth"></div>';
1341 print
'<table class="border tableforfield centpercent">';
1346 print
'<td class="titlefield">'.$langs->trans(
"User").
'</td>';
1348 print $userRequest->getNomUrl(-1,
'leave');
1353 print
'<td>'.$langs->trans(
"Type").
'</td>';
1355 $typeleaves =
$object->getTypes(1, -1);
1356 if (empty($typeleaves[
$object->fk_type])) {
1357 $labeltoshow = $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type);
1359 $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']);
1365 $starthalfday = (
$object->halfday == -1 ||
$object->halfday == 2) ?
'afternoon' :
'morning';
1366 $endhalfday = (
$object->halfday == 1 ||
$object->halfday == 2) ?
'morning' :
'afternoon';
1370 print
'<td class="nowrap">';
1371 print $form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1373 print
'<td>'.dol_print_date(
$object->date_debut,
'day');
1374 print
' ';
1375 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).
'</span>';
1380 print
'<td class="nowrap">';
1381 print $form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1384 $tmpdate =
GETPOSTDATE(
'date_debut_',
'00:00:00');
1385 print $form->selectDate($tmpdate ? $tmpdate :
$object->date_debut,
'date_debut_');
1386 print
' ';
1387 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday') ?
GETPOST(
'starthalfday') : $starthalfday));
1394 print
'<td class="nowrap">';
1395 print $form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1397 print
'<td>'.dol_print_date(
$object->date_fin,
'day');
1398 print
' ';
1399 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).
'</span>';
1404 print
'<td class="nowrap">';
1405 print $form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1408 print $form->selectDate(
$object->date_fin,
'date_fin_');
1409 print
' ';
1410 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday') ?
GETPOST(
'endhalfday') : $endhalfday));
1418 $htmlhelp = $langs->trans(
'NbUseDaysCPHelp');
1419 $includesaturday =
getDolGlobalInt(
'MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', 1);
1420 $includesunday =
getDolGlobalInt(
'MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', 1);
1421 if ($includesaturday) {
1422 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Saturday"));
1424 if ($includesunday) {
1425 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Sunday"));
1427 print $form->textwithpicto($langs->trans(
'NbUseDaysCP'), $htmlhelp);
1436 print
'<td>'.$langs->trans(
'DetailRefusCP').
'</td>';
1437 print
'<td>'.$object->detail_refuse.
'</td>';
1444 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1445 print
'<td>'.nl2br(
$object->description).
'</td>';
1449 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1450 print
'<td class="tdtop">';
1451 $doleditor =
new DolEditor(
'description',
$object->description,
'', 80,
'dolibarr_notes',
'In',
false,
false, isModEnabled(
'fckeditor'), ROWS_3,
'90%');
1452 print $doleditor->Create(1);
1457 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1460 print
'</table>'.
"\n";
1463 print
'<div class="fichehalfright">';
1465 print
'<div class="underbanner clearboth"></div>';
1468 print
'<table class="border tableforfield centpercent">'.
"\n";
1471 if (!empty(
$object->fk_user_create)) {
1472 $userCreate =
new User($db);
1473 $userCreate->fetch(
$object->fk_user_create);
1475 print
'<td class="titlefield">'.$langs->trans(
'RequestByCP').
'</td>';
1476 print
'<td>'.$userCreate->getNomUrl(-1).
'</td>';
1481 if (!$edit && $action !=
'editvalidator') {
1483 print
'<td class="titlefield">';
1485 print $langs->trans(
'ApprovedBy');
1487 print $langs->trans(
'ReviewedByCP');
1492 if (
$object->fk_user_approve > 0) {
1493 $approverdone =
new User($db);
1494 $approverdone->fetch(
$object->fk_user_approve);
1495 print $approverdone->getNomUrl(-1);
1498 print $approverexpected->getNomUrl(-1);
1500 $include_users =
$object->fetch_users_approver_holiday();
1502 print
'<a class="editfielda paddingleft" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editvalidator">'.
img_edit($langs->trans(
"Edit")).
'</a>';
1508 print
'<td class="titlefield">'.$langs->trans(
'ReviewedByCP').
'</td>';
1510 $include_users =
$object->fetch_users_approver_holiday();
1511 if (!in_array(
$object->fk_validator, $include_users)) {
1512 $include_users[] =
$object->fk_validator;
1514 if (empty($include_users)) {
1515 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1517 $arrayofvalidatorstoexclude = (($user->admin || ($user->id != $userRequest->id)) ?
'' : array($user->id));
1518 $s = $form->select_dolusers(
$object->fk_validator,
"valideur", (($action ==
'editvalidator') ? 0 : 1), $arrayofvalidatorstoexclude, 0, $include_users);
1519 print $form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1521 if ($action ==
'editvalidator') {
1522 print
'<input type="submit" class="button button-save" name="savevalidator" value="'.$langs->trans(
"Save").
'">';
1523 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1530 print
'<td>'.$langs->trans(
'DateCreation').
'</td>';
1531 print
'<td>'.dol_print_date(
$object->date_create,
'dayhour',
'tzuser').
'</td>';
1535 print
'<td>'.$langs->trans(
'DateValidCP').
'</td>';
1536 print
'<td>'.dol_print_date(
$object->date_approval,
'dayhour',
'tzuser').
'</td>';
1541 print
'<td>'.$langs->trans(
'DateCancelCP').
'</td>';
1542 print
'<td>'.dol_print_date(
$object->date_cancel,
'dayhour',
'tzuser').
'</td>';
1547 print
'<td>'.$langs->trans(
'DateRefusCP').
'</td>';
1548 print
'<td>'.dol_print_date(
$object->date_refuse,
'dayhour',
'tzuser').
'</td>';
1557 print
'<div class="clearboth"></div>';
1563 if ($action ==
'delete') {
1565 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleDeleteCP"), $langs->trans(
"ConfirmDeleteCP"),
"confirm_delete",
'', 0, 1);
1571 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleToValidCP"), $langs->trans(
"ConfirmToValidCP"),
"confirm_send",
'', 1, 1);
1575 if ($action ==
'valid') {
1576 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleValidCP"), $langs->trans(
"ConfirmValidCP"),
"confirm_valid",
'', 1, 1);
1580 if ($action ==
'refuse') {
1581 $array_input = array(array(
'type' =>
"text",
'label' => $langs->trans(
'DetailRefusCP'),
'name' =>
"detail_refuse",
'size' =>
"50",
'value' =>
""));
1582 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id.
"&action=confirm_refuse", $langs->trans(
"TitleRefuseCP"), $langs->trans(
'ConfirmRefuseCP'),
"confirm_refuse", $array_input, 1, 0);
1586 if ($action ==
'cancel') {
1587 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleCancelCP"), $langs->trans(
"ConfirmCancelCP"),
"confirm_cancel",
'', 1, 1);
1591 if ($action ==
'backtodraft') {
1592 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleSetToDraft"), $langs->trans(
"ConfirmSetToDraft"),
"confirm_draft",
'', 1, 1);
1598 print $form->buttonsSaveCancel();
1608 print
'<div class="tabsAction">';
1611 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=edit&token='.
newToken().
'" class="butAction">'.$langs->trans(
"EditCP").
'</a>';
1615 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=sendToValidate&token='.
newToken().
'" class="butAction">'.$langs->trans(
"Validate").
'</a>';
1620 if (($user->id ==
$object->fk_validator || $permissiontoaddall) && $permissiontoapprove) {
1621 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=valid&token='.
newToken().
'" class="butAction">'.$langs->trans(
"Approve").
'</a>';
1622 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=refuse&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1624 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"Approve").
'</a>';
1625 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1628 if ($permissiontoadd || $permissiontoaddall) {
1630 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1632 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
' - '.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1638 if ($user->id ==
$object->fk_validator || $user->id ==
$object->fk_user_approve || $permissiontoadd || $permissiontoaddall || $permissiontoapprove) {
1639 if (((
$object->date_fin >
dol_now()) && $permissiontoapprove) || $user->id ==
$object->fk_user_approve) {
1640 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1643 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1645 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
' - '.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1649 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1654 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=backtodraft" class="butAction">'.$langs->trans(
"SetToDraft").
'</a>';
1657 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'" class="butActionDelete">'.$langs->trans(
"DeleteCP").
'</a>';
1663 print
'<div class="tabBar">';
1664 print $langs->trans(
'ErrorUserViewCP');
1665 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1669 print
'<div class="tabBar">';
1670 print $langs->trans(
'ErrorIDFicheCP');
1671 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1677 if (
GETPOST(
'modelselected')) {
1678 $action =
'presend';
1681 if ($action !=
'presend' && $action !=
'edit') {
1682 print
'<div class="fichecenter"><div class="fichehalfleft">';
1683 print
'<a name="builddoc"></a>';
1702 print
'</div><div class="fichehalfright">';
1708 $morehtmlcenter =
'';
1711 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1713 $somethingshown = $formactions->showactions(
$object,
$object->element, (is_object(
$object->thirdparty) ?
$object->thirdparty->id : 0), 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1715 print
'</div></div>';
1723if (is_object($db)) {
$id
Support class for third parties, contacts, members, users or resources.
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTDATE($prefix, $hourTime='', $gm='auto', $saverestore='')
Helper function that combines values of a dolibarr DatePicker (such as Form\selectDate) for year,...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
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_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_clone($object, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify 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 information.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.