36require
'../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/lib/holiday.lib.php';
52require_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
53require_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) {
102 if ($user->hasRight(
'holiday',
'readall')) {
105 if ($user->hasRight(
'holiday',
'read') && in_array(
$object->fk_user, $childids)) {
108 if ($permissiontoapprove &&
$object->fk_validator == $user->id && !
getDolGlobalString(
'HOLIDAY_CAN_APPROVE_ONLY_THE_SUBORDINATES')) {
120$permissiontoaddall = 0;
121if ($user->hasRight(
'holiday',
'write') && in_array($fuserid, $childids)) {
122 $permissiontoadd = 1;
124if ($user->hasRight(
'holiday',
'writeall')) {
125 $permissiontoadd = 1;
126 $permissiontoaddall = 1;
128$permissiontoeditextra = $permissiontoadd;
129if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
131 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
135if ($user->hasRight(
'holiday',
'delete')) {
144 $socid = $user->socid;
153$parameters = array(
'socid' => $socid);
154$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
159if (empty($reshook)) {
160 $backurlforlist = DOL_URL_ROOT.
'/holiday/list.php';
162 if (empty($backtopage) || ($cancel && empty($id))) {
163 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
164 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
165 $backtopage = $backurlforlist;
167 $backtopage = DOL_URL_ROOT.
'/holiday/card.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
173 if (!empty($backtopageforcancel)) {
174 header(
"Location: ".$backtopageforcancel);
176 } elseif (!empty($backtopage)) {
177 header(
"Location: ".$backtopage);
184 if ($action ==
'add' && $permissiontoadd) {
189 $date_debut =
GETPOSTDATE(
'date_debut_',
'00:00:00');
191 $date_debut_gmt =
GETPOSTDATE(
'date_debut_',
'00:00:00', 1);
192 $date_fin_gmt =
GETPOSTDATE(
'date_fin_',
'00:00:00', 1);
193 $starthalfday =
GETPOST(
'starthalfday');
194 $endhalfday =
GETPOST(
'endhalfday');
197 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
199 } elseif ($starthalfday ==
'afternoon') {
201 } elseif ($endhalfday ==
'morning') {
206 $description = trim(
GETPOST(
'description',
'restricthtml'));
209 if (!$permissiontoaddall) {
211 if (!$user->hasRight(
'holiday',
'write')) {
214 } elseif (!in_array($fuserid, $childids)) {
220 if (!$user->hasRight(
'holiday',
'write') && !$user->hasRight(
'holiday',
'writeall_advance')) {
223 } elseif (!$user->hasRight(
'holiday',
'writeall_advance') && !in_array($fuserid, $childids)) {
233 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
239 if (empty($date_debut)) {
245 if (empty($date_fin)) {
251 if ($date_debut > $date_fin) {
258 $verifCP =
$object->verifDateHolidayCP($fuserid, $date_debut, $date_fin, $halfday);
265 $tmpUser =
new User($db);
266 $tmpUser->fetch($fuserid);
269 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday, $tmpUser->country_id);
270 if ($nbopenedday < 0.5) {
277 if ($approverid < 1) {
278 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidatorCP'),
null,
'errors');
282 $approverslist =
$object->fetch_users_approver_holiday();
283 if (!in_array($approverid, $approverslist)) {
284 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidator'),
null,
'errors');
289 $ret = $extrafields->setOptionalsFromPost(
null, $object);
298 $object->description = $description;
299 $object->fk_validator = $approverid;
301 $object->date_debut = $date_debut;
304 $object->entity = $conf->entity;
306 $result =
$object->create($user);
317 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
325 if ($action ==
'update' && GETPOSTISSET(
'savevalidator') && $permissiontoapprove) {
333 $verif =
$object->update($user);
337 $action =
'editvalidator';
339 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
347 if ($action ==
'update' && !GETPOSTISSET(
'savevalidator')) {
348 $date_debut =
GETPOSTDATE(
'date_debut_',
'00:00:00');
350 $date_debut_gmt =
GETPOSTDATE(
'date_debut_',
'00:00:00', 1);
351 $date_fin_gmt =
GETPOSTDATE(
'date_fin_',
'00:00:00', 1);
352 $starthalfday =
GETPOST(
'starthalfday');
353 $endhalfday =
GETPOST(
'endhalfday');
355 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
357 } elseif ($starthalfday ==
'afternoon') {
359 } elseif ($endhalfday ==
'morning') {
364 if (!$permissiontoaddall) {
365 if ($permissiontoadd) {
366 if (!in_array($fuserid, $childids)) {
368 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?action=create');
373 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?action=create');
383 if ($permissiontoadd) {
387 $description = trim(
GETPOST(
'description',
'restricthtml'));
397 if ($date_debut > $date_fin) {
404 if ($approverid < 1) {
410 $tmpUser =
new User($db);
411 $tmpUser->fetch($fuserid);
414 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday, $tmpUser->country_id);
415 if ($nbopenedday < 0.5) {
424 $object->description = $description;
425 $object->date_debut = $date_debut;
427 $object->fk_validator = $approverid;
431 $verif =
$object->update($user);
443 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
459 if ($action ==
'confirm_delete' &&
GETPOST(
'confirm') ==
'yes' && $candelete) {
468 $result =
$object->delete($user);
477 header(
'Location: list.php?restore_lastsearch_values=1');
485 if ($action ==
'confirm_send') {
494 $verif =
$object->validate($user);
499 $destinataire =
new User($db);
500 $destinataire->fetch(
$object->fk_validator);
501 $emailTo = $destinataire->email;
504 dol_syslog(
"Expected validator has no email, so we redirect directly to finished page without sending email");
505 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
510 $expediteur =
new User($db);
511 $expediteur->fetch(
$object->fk_user);
523 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysToValidate");
526 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
528 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateBody").
"</p>\n";
534 if ($delayForRequest) {
537 if (
$object->date_debut < $nowplusdelay) {
538 $message =
"<p>".$langs->transnoentities(
"HolidaysToValidateDelay", (
string) $delayForRequest).
"</p>\n";
547 $affectingtypes =
$object->getTypes(1, 1);
548 if (!empty($affectingtypes[
$object->fk_type])) {
549 $tmpUser =
new User($db);
550 $tmpUser->fetch(
$object->fk_user);
555 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateAlertSolde").
"</p>\n";
560 $typeleaves =
$object->getTypes(1, -1);
561 if (empty($typeleaves[
$object->fk_type])) {
562 $labeltoshow = $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type);
564 $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']);
567 $starthalfdaykey =
"Afternoon";
568 $endhalfdaykey =
"Morning";
569 } elseif (
$object->halfday == -1) {
570 $starthalfdaykey =
"Afternoon";
571 $endhalfdaykey =
"Afternoon";
572 } elseif (
$object->halfday == 1) {
573 $starthalfdaykey =
"Morning";
574 $endhalfdaykey =
"Morning";
576 $starthalfdaykey =
"Morning";
577 $endhalfdaykey =
"Afternoon";
579 $starthalfdaykey =
"";
583 $link =
dol_buildpath(
"/holiday/card.php", 3) .
'?id='.$object->id;
586 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Name").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
587 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Type").
" : ".(empty($labeltoshow) ? $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type) : $labeltoshow).
"</li>\n";
588 $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";
589 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
590 $message .=
"</ul>\n";
592 $trackid =
'leav'.$object->id;
596 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
599 $result = $mail->sendfile();
605 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
615 if ($action ==
'update_extras' && $permissiontoeditextra) {
618 $attribute_name =
GETPOST(
'attribute',
'aZ09');
621 $ret = $extrafields->setOptionalsFromPost(
null, $object, $attribute_name);
627 $result =
$object->updateExtraField($attribute_name,
'HOLIDAY_MODIFY');
635 $action =
'edit_extras';
640 if ($action ==
'confirm_valid' && $permissiontoapprove) {
648 $object->fk_user_approve = $user->id;
656 $verif =
$object->approve($user);
663 if (!$error && empty($decrease)) {
664 $tmpUser =
new User($db);
665 $tmpUser->fetch(
$object->fk_user);
670 $newSolde = ($soldeActuel - $nbopenedday);
671 $label =
$object->ref.
' - '.$langs->transnoentitiesnoconv(
"HolidayConsumption");
690 $destinataire =
new User($db);
691 $destinataire->fetch(
$object->fk_user);
692 $emailTo = $destinataire->email;
695 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
698 $expediteur =
new User($db);
699 $expediteur->fetch(
$object->fk_validator);
709 $subject =
'['.$societeName.
"] ".$langs->transnoentitiesnoconv(
"HolidaysValidated");
712 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
718 $message .=
"<ul>\n";
719 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ValidatedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
720 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
721 $message .=
"</ul>\n";
723 $trackid =
'leav'.$object->id;
727 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
730 $result = $mail->sendfile();
746 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
751 if ($action ==
'confirm_refuse' &&
GETPOST(
'confirm',
'alpha') ==
'yes' && $permissiontoapprove) {
752 if (
GETPOST(
'detail_refuse')) {
758 $object->fk_user_refuse = $user->id;
765 $verif =
$object->update($user);
774 $destinataire =
new User($db);
775 $destinataire->fetch(
$object->fk_user);
776 $emailTo = $destinataire->email;
779 dol_syslog(
"User that request leave has no email, so we redirect directly to finished page without sending email");
782 $expediteur =
new User($db);
783 $expediteur->fetch(
$object->fk_validator);
793 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysRefused");
796 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
799 $message .=
"<p>".GETPOST(
'detail_refuse',
'alpha').
"</p>";
803 $message .=
"<ul>\n";
804 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
805 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
808 $trackid =
'leav'.$object->id;
812 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
815 $result = $mail->sendfile();
829 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
837 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"DetailRefusCP")),
null,
'errors');
843 if ($action ==
'confirm_draft' &&
GETPOST(
'confirm') ==
'yes' && $permissiontoadd) {
849 if (!$user->hasRight(
'holiday',
'writeall') && !($user->hasRight(
'holiday',
'write') && in_array(
$object->fk_user, $childids))) {
854 setEventMessages($langs->trans(
'StatusOfRefMustBe',
$object->ref, $langs->transnoentitiesnoconv(
'Canceled')),
null,
'errors');
862 $result =
$object->update($user);
872 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
881 setEventMessages($langs->trans(
"HolidayStarted").
' - '.$langs->trans(
"NotAllowed"),
null,
'errors');
886 if ($action ==
'confirm_cancel' &&
GETPOST(
'confirm') ==
'yes') {
893 ($user->id ==
$object->fk_validator || $permissiontoadd || $permissiontoaddall || $permissiontoapprove)) {
898 $object->fk_user_cancel = $user->id;
904 $result =
$object->update($user);
908 $result =
$object->call_trigger(
'HOLIDAY_CANCEL', $user);
913 $startDate =
$object->date_debut_gmt;
914 $endDate =
$object->date_fin_gmt;
915 $alreadydebited =
true;
917 if (!empty($decrease)) {
919 $date = strtotime(
'-1 month', $lastUpdate);
920 $endOfMonthBeforeLastUpdate =
dol_mktime(0, 0, 0, (
int)
date(
'm', $date), (
int)
date(
't', $date), (
int)
date(
'Y', $date), 1);
921 if (
$object->date_debut_gmt < $endOfMonthBeforeLastUpdate &&
$object->date_fin_gmt > $endOfMonthBeforeLastUpdate) {
922 $endDate = $endOfMonthBeforeLastUpdate;
923 } elseif (
$object->date_debut_gmt > $endOfMonthBeforeLastUpdate) {
924 $alreadydebited =
false;
928 $tmpUser =
new User($db);
929 $tmpUser->fetch(
$object->fk_user);
932 $nbopenedday =
num_open_day($startDate, $endDate, 0, 1,
$object->halfday, $tmpUser->country_id);
934 if (!$alreadydebited) {
938 $newSolde = ($soldeActuel + $nbopenedday);
941 $result1 =
$object->addLogCP($user->id,
$object->fk_user,
$object->ref.
' - '.$langs->transnoentitiesnoconv(
"HolidayCreditAfterCancellation"), $newSolde,
$object->fk_type);
946 if ($result1 < 0 || $result2 < 0) {
959 if (!$error && $result > 0) {
961 $destinataire =
new User($db);
962 $destinataire->fetch(
$object->fk_user);
963 $emailTo = $destinataire->email;
966 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
971 $expediteur =
new User($db);
972 $expediteur->fetch(
$object->fk_user_cancel);
982 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysCanceled");
985 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
991 $message .=
"<ul>\n";
992 $message .=
"<li>".$langs->transnoentitiesnoconv(
"ModifiedBy").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
993 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
994 $message .=
"</ul>\n";
996 $trackid =
'leav'.$object->id;
1000 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
1003 $result = $mail->sendfile();
1009 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id);
1039$form =
new Form($db);
1043$listhalfday = array(
'morning' => $langs->trans(
"Morning"),
"afternoon" => $langs->trans(
"Afternoon"));
1045$title = $langs->trans(
'Leave');
1046$help_url =
'EN:Module_Holiday';
1048llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-holiday page-card');
1052if ((empty($id) && empty($ref)) || $action ==
'create' || $action ==
'add') {
1054 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'))))) {
1055 $errors[] = $langs->trans(
'CantCreateCP');
1064 $errors[] = $langs->trans(
'ErrorEndDateCP');
1067 $errors[] = $langs->trans(
'ErrorSQLCreateCP');
1070 $errors[] = $langs->trans(
'CantCreateCP');
1073 $errors[] = $langs->trans(
'InvalidValidatorCP');
1076 $errors[] = $langs->trans(
'NoDateDebut');
1079 $errors[] = $langs->trans(
'NoDateFin');
1081 case 'DureeHoliday':
1082 $errors[] = $langs->trans(
'ErrorDureeCP');
1085 $errors[] = $langs->trans(
'alreadyCPexist');
1093 print
'<script type="text/javascript">
1094 $( document ).ready(function() {
1095 $("input.button-save").click("submit", function(e) {
1096 console.log("Call valider()");
1097 if (document.demandeCP.date_debut_.value != "")
1099 if(document.demandeCP.date_fin_.value != "")
1101 if(document.demandeCP.valideur.value != "-1") {
1105 alert("'.dol_escape_js($langs->transnoentities(
'InvalidValidatorCP')).
'");
1111 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateFin')).
'");
1117 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateDebut')).
'");
1126 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="demandeCP">'.
"\n";
1127 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
1128 print
'<input type="hidden" name="action" value="add" />'.
"\n";
1134 print
'<table class="border centpercent">';
1139 print
'<td class="titlefield fieldrequired tdtop">'.$langs->trans(
"User").
'</td>';
1140 print
'<td><div class="inline-block">';
1141 if ($permissiontoadd && !$permissiontoaddall) {
1142 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');
1145 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');
1150 print
'<div class="leaveuserbalance paddingtop inline-block floatright badge badge-status0 badge-status margintoponsmartphone">';
1154 $typeleaves =
$object->getTypes(1, 1);
1155 foreach ($typeleaves as $key => $val) {
1156 $nb_type =
$object->getCPforUser(($fuserid ? $fuserid : $user->id), $val[
'rowid']);
1157 $nb_holiday += $nb_type;
1159 $out .=
' - '.($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']).
': <strong>'.($nb_type ?
price2num($nb_type) : 0).
'</strong>';
1160 if ($val[
'newbymonth'] > 0) {
1161 $out .=
' <span class="opacitymedium">+'.$val[
'newbymonth'].
' / '.$langs->trans(
"Month").
'</span>';
1166 print
' ';
1168 $htmltooltip = $langs->trans(
"Detail").
'<br>';
1169 $htmltooltip .= $out;
1171 print $form->textwithtooltip($langs->trans(
'SoldeCPUser', (
string) round($nb_holiday, 5)).
' '.
img_picto(
'',
'help'), $htmltooltip);
1174 if (!empty($conf->use_javascript_ajax)) {
1176 print
'$( document ).ready(function() {
1177 jQuery("#fuserid").change(function() {
1178 console.log("We change to user id "+jQuery("#fuserid").val());
1179 if (jQuery("#fuserid").val() == '.((int) $user->id).
') {
1180 jQuery(".leaveuserbalance").show();
1182 jQuery(".leaveuserbalance").hide();
1189 print
'<div class="leaveuserbalance paddingtop">';
1199 print
'<td class="fieldrequired">'.$langs->trans(
"Type").
'</td>';
1201 $typeleaves =
$object->getTypes(1, -1);
1202 $arraytypeleaves = array();
1203 foreach ($typeleaves as $key => $val) {
1204 $labeltoshow = ($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']);
1205 $labeltoshow .= ($val[
'delay'] > 0 ?
' ('.$langs->trans(
"NoticePeriod").
': '.$val[
'delay'].
' '.$langs->trans(
"days").
')' :
'');
1206 $arraytypeleaves[$val[
'rowid']] = $labeltoshow;
1208 if (empty($typeleaves)) {
1209 print $langs->trans(
"PleaseDefineSomeTypeOfHolidayFirst");
1211 print $form->selectarray(
'type', $arraytypeleaves, (
GETPOST(
'type',
'alpha') ?
GETPOST(
'type',
'alpha') :
''), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
1213 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
1221 print
'<td class="fieldrequired">';
1222 print $form->textwithpicto($langs->trans(
"DateDebCP"), $langs->trans(
"FirstDayOfHoliday"));
1224 print
'<td>'.img_picto(
'',
'action',
'class="pictofixedwidth"');
1225 if (!
GETPOST(
'date_debut_')) {
1226 print $form->selectDate(-1,
'date_debut_', 0, 0, 0,
'', 1, 1);
1228 $tmpdate =
GETPOSTDATE(
'date_debut_',
'00:00:00');
1229 print $form->selectDate($tmpdate,
'date_debut_', 0, 0, 0,
'', 1, 1);
1231 print
' ';
1232 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday',
'alpha') ?
GETPOST(
'starthalfday',
'alpha') :
'morning'));
1238 print
'<td class="fieldrequired">';
1239 print $form->textwithpicto($langs->trans(
"DateFinCP"), $langs->trans(
"LastDayOfHoliday"));
1241 print
'<td>'.img_picto(
'',
'action',
'class="pictofixedwidth"');
1243 print $form->selectDate(-1,
'date_fin_', 0, 0, 0,
'', 1, 1);
1246 print $form->selectDate($tmpdate,
'date_fin_', 0, 0, 0,
'', 1, 1);
1248 print
' ';
1249 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday',
'alpha') ?
GETPOST(
'endhalfday',
'alpha') :
'afternoon'));
1255 print
'<td class="fieldrequired">'.$langs->trans(
"ReviewedByCP").
'</td>';
1259 $include_users =
$object->fetch_users_approver_holiday();
1260 if (empty($include_users)) {
1261 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1265 $defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
1266 if ($fuserid != $user->id) {
1267 $fuser =
new User($db);
1268 $fuser->fetch($fuserid);
1269 $defaultselectuser = (empty($fuser->fk_user_holiday_validator) ? $fuser->fk_user : $fuser->fk_user_holiday_validator);
1278 $s = $form->select_dolusers($defaultselectuser,
"valideur", 1,
null, 0, $include_users,
'',
'0,'.$conf->entity, 0, 0,
'', 0,
'',
'minwidth200 maxwidth500');
1279 print
img_picto(
'',
'user',
'class="pictofixedwidth"').$form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1288 print
'<td>'.$langs->trans(
"DescCP").
'</td>';
1289 print
'<td class="tdtop">';
1290 $doleditor =
new DolEditor(
'description',
GETPOST(
'description',
'restricthtml'),
'', 80,
'dolibarr_notes',
'In',
false,
false,
isModEnabled(
'fckeditor'), ROWS_3,
'90%');
1291 print $doleditor->Create(1);
1295 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
1302 print $form->buttonsSaveCancel(
"SendRequestCP");
1304 print
'</from>'.
"\n";
1307 if ($error && $action !=
'edit') {
1308 print
'<div class="tabBar">';
1309 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1313 if (($id > 0) || $ref) {
1314 $result =
$object->fetch($id, $ref);
1316 $approverexpected =
new User($db);
1317 $approverexpected->fetch(
$object->fk_validator);
1319 $userRequest =
new User($db);
1320 $userRequest->fetch(
$object->fk_user);
1328 $errors[] = $langs->transnoentitiesnoconv(
'ErrorEndDateCP');
1331 $errors[] = $langs->transnoentitiesnoconv(
'ErrorSQLCreateCP');
1334 $errors[] = $langs->transnoentitiesnoconv(
'CantCreateCP');
1337 $errors[] = $langs->transnoentitiesnoconv(
'InvalidValidatorCP');
1340 $errors[] = $langs->transnoentitiesnoconv(
'NoDateDebut');
1343 $errors[] = $langs->transnoentitiesnoconv(
'NoDateFin');
1345 case 'DureeHoliday':
1346 $errors[] = $langs->transnoentitiesnoconv(
'ErrorDureeCP');
1348 case 'NoMotifRefuse':
1349 $errors[] = $langs->transnoentitiesnoconv(
'NoMotifRefuseCP');
1352 $errors[] = $langs->transnoentitiesnoconv(
'ErrorMailNotSend');
1368 print
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">'.
"\n";
1369 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
1370 print
'<input type="hidden" name="action" value="update"/>'.
"\n";
1371 print
'<input type="hidden" name="id" value="'.$object->id.
'" />'.
"\n";
1374 print
dol_get_fiche_head($head,
'card', $langs->trans(
"CPTitreMenu"), -1,
'holiday');
1376 $linkback =
'<a href="'.DOL_URL_ROOT.
'/holiday/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
1378 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref');
1381 print
'<div class="fichecenter">';
1382 print
'<div class="fichehalfleft">';
1383 print
'<div class="underbanner clearboth"></div>';
1385 print
'<table class="border tableforfield centpercent">';
1390 print
'<td class="titlefield">'.$langs->trans(
"User").
'</td>';
1392 print $userRequest->getNomUrl(-1,
'leave');
1397 print
'<td>'.$langs->trans(
"Type").
'</td>';
1399 $typeleaves =
$object->getTypes(1, -1);
1400 if (empty($typeleaves[
$object->fk_type])) {
1401 $labeltoshow = $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type);
1403 $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']);
1409 $starthalfday = (
$object->halfday == -1 ||
$object->halfday == 2) ?
'afternoon' :
'morning';
1410 $endhalfday = (
$object->halfday == 1 ||
$object->halfday == 2) ?
'morning' :
'afternoon';
1414 print
'<td class="nowrap">';
1415 print $form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1417 print
'<td>'.dol_print_date(
$object->date_debut,
'day');
1418 print
' ';
1419 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).
'</span>';
1424 print
'<td class="nowrap">';
1425 print $form->textwithpicto($langs->trans(
'DateDebCP'), $langs->trans(
"FirstDayOfHoliday"));
1428 $tmpdate =
GETPOSTDATE(
'date_debut_',
'00:00:00');
1429 print $form->selectDate($tmpdate ? $tmpdate :
$object->date_debut,
'date_debut_');
1430 print
' ';
1431 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday') ?
GETPOST(
'starthalfday') : $starthalfday));
1438 print
'<td class="nowrap">';
1439 print $form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1441 print
'<td>'.dol_print_date(
$object->date_fin,
'day');
1442 print
' ';
1443 print
'<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).
'</span>';
1448 print
'<td class="nowrap">';
1449 print $form->textwithpicto($langs->trans(
'DateFinCP'), $langs->trans(
"LastDayOfHoliday"));
1452 print $form->selectDate(
$object->date_fin,
'date_fin_');
1453 print
' ';
1454 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday') ?
GETPOST(
'endhalfday') : $endhalfday));
1462 $htmlhelp = $langs->trans(
'NbUseDaysCPHelp');
1463 $includesaturday =
getDolGlobalInt(
'MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', 1);
1464 $includesunday =
getDolGlobalInt(
'MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', 1);
1465 if ($includesaturday) {
1466 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Saturday"));
1468 if ($includesunday) {
1469 $htmlhelp .=
'<br>'.$langs->trans(
"DayIsANonWorkingDay", $langs->trans(
"Sunday"));
1471 print $form->textwithpicto($langs->trans(
'NbUseDaysCP'), $htmlhelp);
1480 print
'<td>'.$langs->trans(
'DetailRefusCP').
'</td>';
1481 print
'<td>'.$object->detail_refuse.
'</td>';
1488 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1489 print
'<td>'.nl2br(
$object->description).
'</td>';
1493 print
'<td>'.$langs->trans(
'DescCP').
'</td>';
1494 print
'<td class="tdtop">';
1495 $doleditor =
new DolEditor(
'description',
$object->description,
'', 80,
'dolibarr_notes',
'In',
false,
false,
isModEnabled(
'fckeditor'), ROWS_3,
'90%');
1496 print $doleditor->Create(1);
1501 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
1504 print
'</table>'.
"\n";
1507 print
'<div class="fichehalfright">';
1509 print
'<div class="underbanner clearboth"></div>';
1512 print
'<table class="border tableforfield centpercent">'.
"\n";
1515 if (!empty(
$object->fk_user_create)) {
1516 $userCreate =
new User($db);
1517 $userCreate->fetch(
$object->fk_user_create);
1519 print
'<td class="titlefield">'.$langs->trans(
'RequestByCP').
'</td>';
1520 print
'<td>'.$userCreate->getNomUrl(-1).
'</td>';
1525 if (!$edit && $action !=
'editvalidator') {
1527 print
'<td class="titlefield">';
1529 print $langs->trans(
'ApprovedBy');
1531 print $langs->trans(
'ReviewedByCP');
1536 if (
$object->fk_user_approve > 0) {
1537 $approverdone =
new User($db);
1538 $approverdone->fetch(
$object->fk_user_approve);
1539 print $approverdone->getNomUrl(-1);
1542 print $approverexpected->getNomUrl(-1);
1544 $include_users =
$object->fetch_users_approver_holiday();
1546 print
'<a class="editfielda paddingleft" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=editvalidator">'.
img_edit($langs->trans(
"Edit")).
'</a>';
1552 print
'<td class="titlefield">'.$langs->trans(
'ReviewedByCP').
'</td>';
1554 $include_users =
$object->fetch_users_approver_holiday();
1555 if (!in_array(
$object->fk_validator, $include_users)) {
1556 $include_users[] =
$object->fk_validator;
1558 if (empty($include_users)) {
1559 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
1561 $arrayofvalidatorstoexclude = (($user->admin || ($user->id != $userRequest->id)) ?
'' : array($user->id));
1562 $s = $form->select_dolusers(
$object->fk_validator,
"valideur", (($action ==
'editvalidator') ? 0 : 1), $arrayofvalidatorstoexclude, 0, $include_users);
1563 print $form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
1565 if ($action ==
'editvalidator') {
1566 print
'<input type="submit" class="button button-save" name="savevalidator" value="'.$langs->trans(
"Save").
'">';
1567 print
'<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1574 print
'<td>'.$langs->trans(
'DateCreation').
'</td>';
1575 print
'<td>'.dol_print_date(
$object->date_create,
'dayhour',
'tzuser').
'</td>';
1579 print
'<td>'.$langs->trans(
'DateValidCP').
'</td>';
1580 print
'<td>'.dol_print_date(
$object->date_approval,
'dayhour',
'tzuser').
'</td>';
1585 print
'<td>'.$langs->trans(
'DateCancelCP').
'</td>';
1586 print
'<td>'.dol_print_date(
$object->date_cancel,
'dayhour',
'tzuser').
'</td>';
1591 print
'<td>'.$langs->trans(
'DateRefusCP').
'</td>';
1592 print
'<td>'.dol_print_date(
$object->date_refuse,
'dayhour',
'tzuser').
'</td>';
1601 print
'<div class="clearboth"></div>';
1607 if ($action ==
'delete') {
1609 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleDeleteCP"), $langs->trans(
"ConfirmDeleteCP"),
"confirm_delete",
'', 0, 1);
1615 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleToValidCP"), $langs->trans(
"ConfirmToValidCP"),
"confirm_send",
'', 1, 1);
1619 if ($action ==
'valid') {
1620 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleValidCP"), $langs->trans(
"ConfirmValidCP"),
"confirm_valid",
'', 1, 1);
1624 if ($action ==
'refuse') {
1625 $array_input = array(array(
'type' =>
"text",
'label' => $langs->trans(
'DetailRefusCP'),
'name' =>
"detail_refuse",
'size' =>
"50",
'value' =>
""));
1626 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id.
"&action=confirm_refuse", $langs->trans(
"TitleRefuseCP"), $langs->trans(
'ConfirmRefuseCP'),
"confirm_refuse", $array_input, 1, 0);
1630 if ($action ==
'cancel') {
1631 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleCancelCP"), $langs->trans(
"ConfirmCancelCP"),
"confirm_cancel",
'', 1, 1);
1635 if ($action ==
'backtodraft') {
1636 print $form->formconfirm($_SERVER[
"PHP_SELF"].
"?id=".
$object->id, $langs->trans(
"TitleSetToDraft"), $langs->trans(
"ConfirmSetToDraft"),
"confirm_draft",
'', 1, 1);
1642 print $form->buttonsSaveCancel();
1652 print
'<div class="tabsAction">';
1655 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=edit&token='.
newToken().
'" class="butAction">'.$langs->trans(
"EditCP").
'</a>';
1659 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=sendToValidate&token='.
newToken().
'" class="butAction">'.$langs->trans(
"Validate").
'</a>';
1664 if (($user->id ==
$object->fk_validator || $permissiontoaddall) && $permissiontoapprove) {
1665 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=valid&token='.
newToken().
'" class="butAction">'.$langs->trans(
"Approve").
'</a>';
1666 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=refuse&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1668 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"Approve").
'</a>';
1669 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotTheAssignedApprover").
'">'.$langs->trans(
"ActionRefuseCP").
'</a>';
1672 if ($permissiontoadd || $permissiontoaddall) {
1674 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1676 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
' - '.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1682 if ($user->id ==
$object->fk_validator || $user->id ==
$object->fk_user_approve || $permissiontoadd || $permissiontoaddall || $permissiontoapprove) {
1683 if (((
$object->date_fin >
dol_now()) && $permissiontoapprove) || $user->id ==
$object->fk_user_approve) {
1684 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1687 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=cancel&token='.
newToken().
'" class="butAction">'.$langs->trans(
"ActionCancelCP").
'</a>';
1689 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"HolidayStarted").
' - '.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1693 print
'<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans(
"NotAllowed").
'">'.$langs->trans(
"ActionCancelCP").
'</a>';
1698 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=backtodraft&token='.
newToken().
'" class="butAction">'.$langs->trans(
"SetToDraft").
'</a>';
1701 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=delete&token='.
newToken().
'" class="butActionDelete">'.$langs->trans(
"DeleteCP").
'</a>';
1707 print
'<div class="tabBar">';
1708 print $langs->trans(
'ErrorUserViewCP');
1709 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1713 print
'<div class="tabBar">';
1714 print $langs->trans(
'ErrorIDFicheCP');
1715 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
1721 if (
GETPOST(
'modelselected')) {
1722 $action =
'presend';
1725 if ($action !=
'presend' && $action !=
'edit') {
1726 print
'<div class="fichecenter"><div class="fichehalfleft">';
1727 print
'<a name="builddoc"></a>';
1746 print
'</div><div class="fichehalfright">';
1752 $morehtmlcenter =
'';
1755 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
1757 $somethingshown = $formactions->showactions($object,
$object->element, (is_object(
$object->thirdparty) ?
$object->thirdparty->id : 0), 1,
'', $MAXEVENT,
'', $morehtmlcenter);
1759 print
'</div></div>';
1767if (is_object($db)) {
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $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, $countryCodeOrId='')
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, $tz='')
Add a delay to a date.
dol_now($mode='gmt')
Return date for now.
getDolGlobalFloat($key, $default=0)
Return a Dolibarr global constant float value.
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...
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.
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.
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($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.
if(getDolGlobalString( 'TAKEPOS_SHOW_CUSTOMER')) print $langs trans('Date')." left Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right PaymentTypeShortLIQ right SELECT p pos_change as p datep as date
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.