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";
535 $affectingtypes =
$object->getTypes(1, 1);
536 if (!empty($affectingtypes[
$object->fk_type])) {
540 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateAlertSolde").
"</p>\n";
545 $typeleaves =
$object->getTypes(1, -1);
546 if (empty($typeleaves[
$object->fk_type])) {
547 $labeltoshow = $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type);
549 $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']);
552 $starthalfdaykey =
"Afternoon";
553 $endhalfdaykey =
"Morning";
554 } elseif (
$object->halfday == -1) {
555 $starthalfdaykey =
"Afternoon";
556 $endhalfdaykey =
"Afternoon";
557 } elseif (
$object->halfday == 1) {
558 $starthalfdaykey =
"Morning";
559 $endhalfdaykey =
"Morning";
561 $starthalfdaykey =
"Morning";
562 $endhalfdaykey =
"Afternoon";
564 $starthalfdaykey =
"";
568 $link =
dol_buildpath(
"/holiday/card.php", 3) .
'?id='.$object->id;
571 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Name").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
572 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Type").
" : ".(empty($labeltoshow) ? $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type) : $labeltoshow).
"</li>\n";
573 $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";
574 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
575 $message .=
"</ul>\n";
577 $trackid =
'leav'.$object->id;
581 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
584 $result = $mail->sendfile();
590 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
600 if ($action ==
'update_extras' && $permissiontoeditextra) {
603 $attribute_name =
GETPOST(
'attribute',
'aZ09');
606 $ret = $extrafields->setOptionalsFromPost(
null,
$object, $attribute_name);
612 $result =
$object->updateExtraField($attribute_name,
'HOLIDAY_MODIFY');
620 $action =
'edit_extras';
625 if ($action ==
'confirm_valid' && $permissiontoapprove) {
633 $object->fk_user_approve = $user->id;
641 $verif =
$object->approve($user);
648 if (!$error && empty($decrease)) {
652 $newSolde = ($soldeActuel - $nbopenedday);
653 $label =
$object->ref.
' - '.$langs->transnoentitiesnoconv(
"HolidayConsumption");
672 $destinataire =
new User($db);
673 $destinataire->fetch(
$object->fk_user);
674 $emailTo = $destinataire->email;
677 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
680 $expediteur =
new User($db);
681 $expediteur->fetch(
$object->fk_validator);
691 $subject =
'['.$societeName.
"] ".$langs->transnoentitiesnoconv(
"HolidaysValidated");
694 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
700 $message .=
"<ul>\n";
701 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ValidatedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
702 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
703 $message .=
"</ul>\n";
705 $trackid =
'leav'.$object->id;
709 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
712 $result = $mail->sendfile();
728 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
733 if ($action ==
'confirm_refuse' &&
GETPOST(
'confirm',
'alpha') ==
'yes' && $permissiontoapprove) {
734 if (
GETPOST(
'detail_refuse')) {
740 $object->fk_user_refuse = $user->id;
747 $verif =
$object->update($user);
756 $destinataire =
new User($db);
757 $destinataire->fetch(
$object->fk_user);
758 $emailTo = $destinataire->email;
761 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
764 $expediteur =
new User($db);
765 $expediteur->fetch(
$object->fk_validator);
775 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysRefused");
778 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
781 $message .=
"<p>".GETPOST(
'detail_refuse',
'alpha').
"</p>";
785 $message .=
"<ul>\n";
786 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
787 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
790 $trackid =
'leav'.$object->id;
794 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
797 $result = $mail->sendfile();
811 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
819 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DetailRefusCP")),
null,
'errors');
826 if ($action ==
'confirm_draft' &&
GETPOST(
'confirm') ==
'yes' && $permissiontoadd) {
835 $result =
$object->update($user);
844 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
852 if ($action ==
'confirm_cancel' &&
GETPOST(
'confirm') ==
'yes') {
859 ($user->id ==
$object->fk_validator || $permissiontoadd || $permissiontoaddall || $permissiontoapprove)) {
864 $object->fk_user_cancel = $user->id;
870 $result =
$object->update($user);
874 $result =
$object->call_trigger(
'HOLIDAY_CANCEL', $user);
879 $startDate =
$object->date_debut_gmt;
880 $endDate =
$object->date_fin_gmt;
882 if (!empty($decrease)) {
884 $date = strtotime(
'-1 month', $lastUpdate);
885 $endOfMonthBeforeLastUpdate =
dol_mktime(0, 0, 0, (
int) date(
'm', $date), (
int) date(
't', $date), (
int) date(
'Y', $date), 1);
886 if (
$object->date_debut_gmt < $endOfMonthBeforeLastUpdate &&
$object->date_fin_gmt > $endOfMonthBeforeLastUpdate) {
887 $endDate = $endOfMonthBeforeLastUpdate;
888 } elseif (
$object->date_debut_gmt > $endOfMonthBeforeLastUpdate) {
889 $endDate = $startDate;
897 $newSolde = ($soldeActuel + $nbopenedday);
900 $result1 =
$object->addLogCP($user->id,
$object->fk_user,
$object->ref.
' - '.$langs->transnoentitiesnoconv(
"HolidayCreditAfterCancellation"), $newSolde,
$object->fk_type);
905 if ($result1 < 0 || $result2 < 0) {
918 if (!$error && $result > 0) {
920 $destinataire =
new User($db);
921 $destinataire->fetch(
$object->fk_user);
922 $emailTo = $destinataire->email;
925 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
930 $expediteur =
new User($db);
931 $expediteur->fetch(
$object->fk_user_cancel);
941 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysCanceled");
944 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
950 $message .=
"<ul>\n";
951 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
952 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
953 $message .=
"</ul>\n";
955 $trackid =
'leav'.$object->id;
959 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
962 $result = $mail->sendfile();
968 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
998$form =
new Form($db);
1002$listhalfday = array(
'morning' => $langs->trans(
"Morning"),
"afternoon" => $langs->trans(
"Afternoon"));
1004$title = $langs->trans(
'Leave');
1005$help_url =
'EN:Module_Holiday';
1007llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-holiday page-card');
1011if ((empty($id) && empty($ref)) || $action ==
'create' || $action ==
'add') {
1013 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'))))) {
1014 $errors[] = $langs->trans(
'CantCreateCP');
1023 $errors[] = $langs->trans(
'ErrorEndDateCP');
1026 $errors[] = $langs->trans(
'ErrorSQLCreateCP');
1029 $errors[] = $langs->trans(
'CantCreateCP');
1032 $errors[] = $langs->trans(
'InvalidValidatorCP');
1035 $errors[] = $langs->trans(
'NoDateDebut');
1038 $errors[] = $langs->trans(
'NoDateFin');
1040 case 'DureeHoliday':
1041 $errors[] = $langs->trans(
'ErrorDureeCP');
1044 $errors[] = $langs->trans(
'alreadyCPexist');
1052 print
'<script type="text/javascript">
1053 $( document ).ready(function() {
1054 $("input.button-save").click("submit", function(e) {
1055 console.log("Call valider()");
1056 if (document.demandeCP.date_debut_.value != "")
1058 if(document.demandeCP.date_fin_.value != "")
1060 if(document.demandeCP.valideur.value != "-1") {
1064 alert("'.dol_escape_js($langs->transnoentities(
'InvalidValidatorCP')).
'");
1070 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateFin')).
'");
1076 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateDebut')).
'");
1085 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="demandeCP">'.
"\n";
1086 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
1087 print
'<input type="hidden" name="action" value="add" />'.
"\n";
1093 print
'<table class="border centpercent">';
1098 print
'<td class="titlefield fieldrequired tdtop">'.$langs->trans(
"User").
'</td>';
1099 print
'<td><div class="inline-block">';
1100 if ($permissiontoadd && !$permissiontoaddall) {
1101 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');
1104 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');
1109 print
'<div class="leaveuserbalance paddingtop inline-block floatright badge badge-status0 badge-status margintoponsmartphone">';
1113 $typeleaves =
$object->getTypes(1, 1);
1114 foreach ($typeleaves as $key => $val) {
1115 $nb_type =
$object->getCPforUser(($fuserid ? $fuserid : $user->id), $val[
'rowid']);
1116 $nb_holiday += $nb_type;
1118 $out .=
' - '.($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']).
': <strong>'.($nb_type ?
price2num($nb_type) : 0).
'</strong><br>';
1121 print
' ';
1123 $htmltooltip = $langs->trans(
"Detail").
'<br>';
1124 $htmltooltip .= $out;
1126 print $form->textwithtooltip($langs->trans(
'SoldeCPUser', (
string) round($nb_holiday, 5)).
' '.
img_picto(
'',
'help'), $htmltooltip);
1129 if (!empty(
$conf->use_javascript_ajax)) {
1131 print
'$( document ).ready(function() {
1132 jQuery("#fuserid").change(function() {
1133 console.log("We change to user id "+jQuery("#fuserid").val());
1134 if (jQuery("#fuserid").val() == '.((int) $user->id).
') {
1135 jQuery(".leaveuserbalance").show();
1137 jQuery(".leaveuserbalance").hide();
1144 print
'<div class="leaveuserbalance paddingtop">';
1154 print
'<td class="fieldrequired">'.$langs->trans(
"Type").
'</td>';
1156 $typeleaves =
$object->getTypes(1, -1);
1157 $arraytypeleaves = array();
1158 foreach ($typeleaves as $key => $val) {
1159 $labeltoshow = ($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']);
1160 $labeltoshow .= ($val[
'delay'] > 0 ?
' ('.$langs->trans(
"NoticePeriod").
': '.$val[
'delay'].
' '.$langs->trans(
"days").
')' :
'');
1161 $arraytypeleaves[$val[
'rowid']] = $labeltoshow;
1163 if (empty($typeleaves)) {
1164 print $langs->trans(
"PleaseDefineSomeTypeOfHolidayFirst");
1166 print $form->selectarray(
'type', $arraytypeleaves, (
GETPOST(
'type',
'alpha') ?
GETPOST(
'type',
'alpha') :
''), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1168 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1176 print
'<td class="fieldrequired">';
1177 print $form->textwithpicto($langs->trans(
"DateDebCP"), $langs->trans(
"FirstDayOfHoliday"));
1179 print
'<td>'.img_picto(
'',
'action',
'class="pictofixedwidth"');
1180 if (!
GETPOST(
'date_debut_')) {
1181 print $form->selectDate(-1,
'date_debut_', 0, 0, 0,
'', 1, 1);
1183 $tmpdate =
GETPOSTDATE(
'date_debut_',
'00:00:00');
1184 print $form->selectDate($tmpdate,
'date_debut_', 0, 0, 0,
'', 1, 1);
1186 print
' ';
1187 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday',
'alpha') ?
GETPOST(
'starthalfday',
'alpha') :
'morning'));
1193 print
'<td class="fieldrequired">';
1194 print $form->textwithpicto($langs->trans(
"DateFinCP"), $langs->trans(
"LastDayOfHoliday"));
1196 print
'<td>'.img_picto(
'',
'action',
'class="pictofixedwidth"');
1198 print $form->selectDate(-1,
'date_fin_', 0, 0, 0,
'', 1, 1);
1201 print $form->selectDate($tmpdate,
'date_fin_', 0, 0, 0,
'', 1, 1);
1203 print
' ';
1204 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday',
'alpha') ?
GETPOST(
'endhalfday',
'alpha') :
'afternoon'));
1210 print
'<td class="fieldrequired">'.$langs->trans(
"ReviewedByCP").
'</td>';
1214 $include_users =
$object->fetch_users_approver_holiday();
1215 if (empty($include_users)) {
1216 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1220 $defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
1221 if ($fuserid != $user->id) {
1222 $fuser =
new User($db);
1223 $fuser->fetch($fuserid);
1224 $defaultselectuser = (empty($fuser->fk_user_holiday_validator) ? $fuser->fk_user : $fuser->fk_user_holiday_validator);
1233 $s = $form->select_dolusers($defaultselectuser,
"valideur", 1,
null, 0, $include_users,
'',
'0,'.
$conf->entity, 0, 0,
'', 0,
'',
'minwidth200 maxwidth500');
1234 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1243 print
'<td>'.$langs->trans(
"DescCP").
'</td>';
1244 print
'<td class="tdtop">';
1245 $doleditor =
new DolEditor(
'description',
GETPOST(
'description',
'restricthtml'),
'', 80,
'dolibarr_notes',
'In',
false,
false, isModEnabled(
'fckeditor'), ROWS_3,
'90%');
1246 print $doleditor->Create(1);
1250 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1257 print $form->buttonsSaveCancel(
"SendRequestCP");
1259 print
'</from>'.
"\n";
1262 if ($error && $action !=
'edit') {
1263 print
'<div class="tabBar">';
1264 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1268 if (($id > 0) || $ref) {
1269 $result =
$object->fetch($id, $ref);
1271 $approverexpected =
new User($db);
1272 $approverexpected->fetch(
$object->fk_validator);
1274 $userRequest =
new User($db);
1275 $userRequest->fetch(
$object->fk_user);
1283 $errors[] = $langs->transnoentitiesnoconv(
'ErrorEndDateCP');
1286 $errors[] = $langs->transnoentitiesnoconv(
'ErrorSQLCreateCP');
1289 $errors[] = $langs->transnoentitiesnoconv(
'CantCreateCP');
1292 $errors[] = $langs->transnoentitiesnoconv(
'InvalidValidatorCP');
1295 $errors[] = $langs->transnoentitiesnoconv(
'NoDateDebut');
1298 $errors[] = $langs->transnoentitiesnoconv(
'NoDateFin');
1300 case 'DureeHoliday':
1301 $errors[] = $langs->transnoentitiesnoconv(
'ErrorDureeCP');
1303 case 'NoMotifRefuse':
1304 $errors[] = $langs->transnoentitiesnoconv(
'NoMotifRefuseCP');
1307 $errors[] = $langs->transnoentitiesnoconv(
'ErrorMailNotSend');
1323 print
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">'.
"\n";
1324 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
1325 print
'<input type="hidden" name="action" value="update"/>'.
"\n";
1326 print
'<input type="hidden" name="id" value="'.$object->id.
'" />'.
"\n";
1329 print
dol_get_fiche_head($head,
'card', $langs->trans(
"CPTitreMenu"), -1,
'holiday');
1331 $linkback =
'<a href="'.DOL_URL_ROOT.
'/holiday/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1333 dol_banner_tab(
$object,
'ref', $linkback, 1,
'ref',
'ref');
1336 print
'<div class="fichecenter">';
1337 print
'<div class="fichehalfleft">';
1338 print
'<div class="underbanner clearboth"></div>';
1340 print
'<table class="border tableforfield centpercent">';
1345 print
'<td class="titlefield">'.$langs->trans(
"User").
'</td>';
1347 print $userRequest->getNomUrl(-1,
'leave');
1352 print
'<td>'.$langs->trans(
"Type").
'</td>';
1354 $typeleaves =
$object->getTypes(1, -1);
1355 if (empty($typeleaves[
$object->fk_type])) {
1356 $labeltoshow = $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type);
1358 $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']);
1364 $starthalfday = (
$object->halfday == -1 ||
$object->halfday == 2) ?
'afternoon' :
'morning';
1365 $endhalfday = (
$object->halfday == 1 ||
$object->halfday == 2) ?
'morning' :
'afternoon';
1369 print
'<td class="nowrap">';
1370 print $form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1372 print
'<td>'.dol_print_date(
$object->date_debut,
'day');
1373 print
' ';
1374 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).
'</span>';
1379 print
'<td class="nowrap">';
1380 print $form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1383 $tmpdate =
GETPOSTDATE(
'date_debut_',
'00:00:00');
1384 print $form->selectDate($tmpdate ? $tmpdate :
$object->date_debut,
'date_debut_');
1385 print
' ';
1386 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday') ?
GETPOST(
'starthalfday') : $starthalfday));
1393 print
'<td class="nowrap">';
1394 print $form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1396 print
'<td>'.dol_print_date(
$object->date_fin,
'day');
1397 print
' ';
1398 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).
'</span>';
1403 print
'<td class="nowrap">';
1404 print $form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1407 print $form->selectDate(
$object->date_fin,
'date_fin_');
1408 print
' ';
1409 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday') ?
GETPOST(
'endhalfday') : $endhalfday));
1417 $htmlhelp = $langs->trans(
'NbUseDaysCPHelp');
1418 $includesaturday =
getDolGlobalInt(
'MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', 1);
1419 $includesunday =
getDolGlobalInt(
'MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', 1);
1420 if ($includesaturday) {
1421 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Saturday"));
1423 if ($includesunday) {
1424 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Sunday"));
1426 print $form->textwithpicto($langs->trans(
'NbUseDaysCP'), $htmlhelp);
1435 print
'<td>'.$langs->trans(
'DetailRefusCP').
'</td>';
1436 print
'<td>'.$object->detail_refuse.
'</td>';
1443 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1444 print
'<td>'.nl2br(
$object->description).
'</td>';
1448 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1449 print
'<td class="tdtop">';
1450 $doleditor =
new DolEditor(
'description',
$object->description,
'', 80,
'dolibarr_notes',
'In',
false,
false, isModEnabled(
'fckeditor'), ROWS_3,
'90%');
1451 print $doleditor->Create(1);
1456 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1459 print
'</table>'.
"\n";
1462 print
'<div class="fichehalfright">';
1464 print
'<div class="underbanner clearboth"></div>';
1467 print
'<table class="border tableforfield centpercent">'.
"\n";
1470 if (!empty(
$object->fk_user_create)) {
1471 $userCreate =
new User($db);
1472 $userCreate->fetch(
$object->fk_user_create);
1474 print
'<td class="titlefield">'.$langs->trans(
'RequestByCP').
'</td>';
1475 print
'<td>'.$userCreate->getNomUrl(-1).
'</td>';
1480 if (!$edit && $action !=
'editvalidator') {
1482 print
'<td class="titlefield">';
1484 print $langs->trans(
'ApprovedBy');
1486 print $langs->trans(
'ReviewedByCP');
1491 if (
$object->fk_user_approve > 0) {
1492 $approverdone =
new User($db);
1493 $approverdone->fetch(
$object->fk_user_approve);
1494 print $approverdone->getNomUrl(-1);
1497 print $approverexpected->getNomUrl(-1);
1499 $include_users =
$object->fetch_users_approver_holiday();
1501 print
'<a class="editfielda paddingleft" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editvalidator">'.
img_edit($langs->trans(
"Edit")).
'</a>';
1507 print
'<td class="titlefield">'.$langs->trans(
'ReviewedByCP').
'</td>';
1509 $include_users =
$object->fetch_users_approver_holiday();
1510 if (!in_array(
$object->fk_validator, $include_users)) {
1511 $include_users[] =
$object->fk_validator;
1513 if (empty($include_users)) {
1514 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1516 $arrayofvalidatorstoexclude = (($user->admin || ($user->id != $userRequest->id)) ?
'' : array($user->id));
1517 $s = $form->select_dolusers(
$object->fk_validator,
"valideur", (($action ==
'editvalidator') ? 0 : 1), $arrayofvalidatorstoexclude, 0, $include_users);
1518 print $form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1520 if ($action ==
'editvalidator') {
1521 print
'<input type="submit" class="button button-save" name="savevalidator" value="'.$langs->trans(
"Save").
'">';
1522 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1529 print
'<td>'.$langs->trans(
'DateCreation').
'</td>';
1530 print
'<td>'.dol_print_date(
$object->date_create,
'dayhour',
'tzuser').
'</td>';
1534 print
'<td>'.$langs->trans(
'DateValidCP').
'</td>';
1535 print
'<td>'.dol_print_date(
$object->date_approval,
'dayhour',
'tzuser').
'</td>';
1540 print
'<td>'.$langs->trans(
'DateCancelCP').
'</td>';
1541 print
'<td>'.dol_print_date(
$object->date_cancel,
'dayhour',
'tzuser').
'</td>';
1546 print
'<td>'.$langs->trans(
'DateRefusCP').
'</td>';
1547 print
'<td>'.dol_print_date(
$object->date_refuse,
'dayhour',
'tzuser').
'</td>';
1556 print
'<div class="clearboth"></div>';
1562 if ($action ==
'delete') {
1564 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleDeleteCP"), $langs->trans(
"ConfirmDeleteCP"),
"confirm_delete",
'', 0, 1);
1570 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleToValidCP"), $langs->trans(
"ConfirmToValidCP"),
"confirm_send",
'', 1, 1);
1574 if ($action ==
'valid') {
1575 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleValidCP"), $langs->trans(
"ConfirmValidCP"),
"confirm_valid",
'', 1, 1);
1579 if ($action ==
'refuse') {
1580 $array_input = array(array(
'type' =>
"text",
'label' => $langs->trans(
'DetailRefusCP'),
'name' =>
"detail_refuse",
'size' =>
"50",
'value' =>
""));
1581 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id.
"&action=confirm_refuse", $langs->trans(
"TitleRefuseCP"), $langs->trans(
'ConfirmRefuseCP'),
"confirm_refuse", $array_input, 1, 0);
1585 if ($action ==
'cancel') {
1586 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleCancelCP"), $langs->trans(
"ConfirmCancelCP"),
"confirm_cancel",
'', 1, 1);
1590 if ($action ==
'backtodraft') {
1591 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleSetToDraft"), $langs->trans(
"ConfirmSetToDraft"),
"confirm_draft",
'', 1, 1);
1597 print $form->buttonsSaveCancel();
1607 print
'<div class="tabsAction">';
1610 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=edit&token='.
newToken().
'" class="butAction">'.$langs->trans(
"EditCP").
'</a>';
1614 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=sendToValidate&token='.
newToken().
'" class="butAction">'.$langs->trans(
"Validate").
'</a>';
1619 if (($user->id ==
$object->fk_validator || $permissiontoaddall) && $permissiontoapprove) {
1620 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=valid&token='.
newToken().
'" class="butAction">'.$langs->trans(
"Approve").
'</a>';
1621 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=refuse&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1623 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"Approve").
'</a>';
1624 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1627 if ($permissiontoadd || $permissiontoaddall) {
1629 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1631 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
' - '.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1637 if ($user->id ==
$object->fk_validator || $user->id ==
$object->fk_user_approve || $permissiontoadd || $permissiontoaddall || $permissiontoapprove) {
1638 if (((
$object->date_fin >
dol_now()) && $permissiontoapprove) || $user->id ==
$object->fk_user_approve) {
1639 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1642 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1644 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
' - '.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1648 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1653 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=backtodraft" class="butAction">'.$langs->trans(
"SetToDraft").
'</a>';
1656 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'" class="butActionDelete">'.$langs->trans(
"DeleteCP").
'</a>';
1662 print
'<div class="tabBar">';
1663 print $langs->trans(
'ErrorUserViewCP');
1664 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1668 print
'<div class="tabBar">';
1669 print $langs->trans(
'ErrorIDFicheCP');
1670 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1676 if (
GETPOST(
'modelselected')) {
1677 $action =
'presend';
1680 if ($action !=
'presend' && $action !=
'edit') {
1681 print
'<div class="fichecenter"><div class="fichehalfleft">';
1682 print
'<a name="builddoc"></a>';
1701 print
'</div><div class="fichehalfright">';
1707 $morehtmlcenter =
'';
1710 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1712 $somethingshown = $formactions->showactions(
$object,
$object->element, (is_object(
$object->thirdparty) ?
$object->thirdparty->id : 0), 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1714 print
'</div></div>';
1722if (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.