34require
'../main.inc.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
52require_once DOL_DOCUMENT_ROOT.
'/core/lib/holiday.lib.php';
53require_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
57$action =
GETPOST(
'action',
'aZ09');
58$cancel =
GETPOST(
'cancel',
'alpha');
59$confirm =
GETPOST(
'confirm',
'alpha');
60$backtopage =
GETPOST(
'backtopage',
'alpha');
61$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
66$users = (
GETPOST(
'users',
'array') ?
GETPOST(
'users',
'array') : array($user->id));
67$groups =
GETPOST(
'groups',
'array');
73$langs->loadLangs(array(
"other",
"holiday",
"mails",
"trips"));
79$childids = $user->getAllChildIds(1);
83 $morefilter =
'AND employee = 1';
89$extrafields->fetch_name_optionals_label(
$object->table_element);
91if (($id > 0) || $ref) {
96 if ($user->hasRight(
'holiday',
'readall')) {
99 if ($user->hasRight(
'holiday',
'read') && in_array(
$object->fk_user, $childids)) {
108$hookmanager->initHooks(array(
'holidaycard',
'globalcard'));
111$permissiontoaddall = 0;
112if ($user->hasRight(
'holiday',
'write') && in_array($fuserid, $childids)) {
113 $permissiontoadd = 1;
115if ($user->hasRight(
'holiday',
'writeall')) {
116 $permissiontoadd = 1;
117 $permissiontoaddall = 1;
121if ($user->hasRight(
'holiday',
'delete')) {
130 $socid = $user->socid;
135if ($action ==
'add' && !$user->hasRight(
'holiday',
'writeall')) {
144$parameters = array(
'socid' => $socid);
145$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
147 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
150if (empty($reshook)) {
151 $backurlforlist = DOL_URL_ROOT.
'/holiday/list.php';
153 if (empty($backtopage) || ($cancel && empty($id))) {
154 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
155 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
156 $backtopage = $backurlforlist;
158 $backtopage = DOL_URL_ROOT.
'/holiday/card_group.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
164 if (!empty($backtopageforcancel)) {
165 header(
"Location: ".$backtopageforcancel);
167 } elseif (!empty($backtopage)) {
168 header(
"Location: ".$backtopage);
175 if ($action ==
'add' && $permissiontoadd) {
176 $users =
GETPOST(
'users',
'array');
177 $groups =
GETPOST(
'groups',
'array');
183 $starthalfday =
GETPOST(
'starthalfday');
184 $endhalfday =
GETPOST(
'endhalfday');
188 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
190 } elseif ($starthalfday ==
'afternoon') {
192 } elseif ($endhalfday ==
'morning') {
197 $description = trim(
GETPOST(
'description',
'restricthtml'));
200 if (!$permissiontoaddall) {
202 if (!$user->hasRight(
'holiday',
'write')) {
204 setEventMessages($langs->trans(
"NotEnoughPermissions"),
null,
'errors');
205 } elseif (!in_array($fuserid, $childids)) {
207 setEventMessages($langs->trans(
"UserNotInHierachy"),
null,
'errors');
211 if (!$user->hasRight(
'holiday',
'write') && !$user->hasRight(
'holiday',
'writeall')) {
213 setEventMessages($langs->trans(
"NotEnoughPermissions"),
null,
'errors');
214 } elseif (!$user->hasRight(
'holiday',
'writeall') && !in_array($fuserid, $childids)) {
216 setEventMessages($langs->trans(
"UserNotInHierachy"),
null,
'errors');
222 if (empty($groups) && empty($users)) {
223 setEventMessages($langs->trans(
"ErrorFieldRequiredUserOrGroup"),
null,
'errors');
231 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
237 if (empty($date_debut)) {
238 setEventMessages($langs->trans(
"NoDateDebut"),
null,
'errors');
243 if (empty($date_fin)) {
244 setEventMessages($langs->trans(
"NoDateFin"),
null,
'errors');
249 if ($date_debut > $date_fin) {
250 setEventMessages($langs->trans(
"ErrorEndDateCP"),
null,
'errors');
256 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday,
$mysoc->country_id);
257 if ($nbopenedday < 0.5) {
258 setEventMessages($langs->trans(
"ErrorDureeCP"),
null,
'errors');
264 if ($approverid < 1) {
265 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidatorCP'),
null,
'errors');
273 $TusersToProcess = array();
277 if (is_array($groups) && count($groups) > 0) {
278 $sql =
' SELECT DISTINCT u.rowid,u.lastname,u.firstname from ' . MAIN_DB_PREFIX .
'user as u';
279 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'usergroup_user as ug on ug.fk_user = u.rowid ';
280 $sql .=
' WHERE fk_usergroup in (' .$db->sanitize(implode(
',', $groups)) .
')';
281 $resql = $db->query($sql);
284 while ($obj = $db->fetch_object($resql)) {
285 $TusersToProcess[$obj->rowid] = $obj->rowid;
290 if (is_array($users) && count($users) > 0) {
291 foreach ($users as $u) {
292 $TusersToProcess[$u] = $u;
295 foreach ($TusersToProcess as $u) {
297 $verifCP =
$object->verifDateHolidayCP($u, $date_debut, $date_fin, $halfday);
301 $userError =
new User($db);
302 $result = $userError->fetch($u);
305 setEventMessages($langs->trans(
"UseralreadyCPexist", $userError->firstname .
' '. $userError->lastname),
null,
'errors');
307 setEventMessages($langs->trans(
"ErrorUserFetch", $u),
null,
'errors');
318 foreach ($TusersToProcess as $u) {
321 $object->description = $description;
322 $object->fk_validator = $approverid;
324 $object->date_debut = $date_debut;
328 $result =
$object->create($user);
334 if ($autoValidation) {
336 $htemp->fetch($result);
339 $approver =
new User($db);
340 $approver->fetch($approverid);
341 $resultValidated = $htemp->validate($approver);
343 if ($resultValidated < 0) {
349 if ($AutoSendMail && !$error) {
351 $returnSendMail =
sendMail($result, $permissiontoadd, $now, $autoValidation);
352 if (!empty($returnSendMail->msg)) {
353 setEventMessage($returnSendMail->msg, $returnSendMail->style);
363 header(
'Location: '.DOL_URL_ROOT.
'/holiday/list.php');
378$form =
new Form($db);
381$listhalfday = array(
'morning' => $langs->trans(
"Morning"),
"afternoon" => $langs->trans(
"Afternoon"));
383$title = $langs->trans(
'Leave');
384$help_url =
'EN:Module_Holiday';
387llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-holiday page-card_group');
389if ((empty($id) && empty($ref)) || $action ==
'create' || $action ==
'add') {
391 if ((in_array($fuserid, $childids) && !$user->hasRight(
'holiday',
'writeall')) || (!in_array($fuserid, $childids) && (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') || !$user->hasRight(
'holiday',
'writeall')))) {
392 $errors[] = $langs->trans(
'CantCreateCP');
395 print
load_fiche_titre($langs->trans(
'MenuCollectiveAddCP'),
'',
'title_hrm.png');
401 $errors[] = $langs->trans(
'ErrorEndDateCP');
404 $errors[] = $langs->trans(
'ErrorSQLCreateCP');
407 $errors[] = $langs->trans(
'CantCreateCP');
410 $errors[] = $langs->trans(
'InvalidValidatorCP');
413 $errors[] = $langs->trans(
'NoDateDebut');
416 $errors[] = $langs->trans(
'NoDateFin');
419 $errors[] = $langs->trans(
'ErrorDureeCP');
422 $errors[] = $langs->trans(
'alreadyCPexist');
426 setEventMessages(
'', $errors,
'errors');
430 print
'<script type="text/javascript">
431 $( document ).ready(function() {
433 if( $("input[name=autoValidation]").is(":checked") ){
434 $("#AutoSendMail").prop("disabled", false);
435 $("#AutoSendMail").prop("checked", true);
438 $("#AutoSendMail").prop("disabled", true);
439 $("#AutoSendMail").prop("checked", false);
442 $("input[name=autoValidation]").click( function(e) {
445 if( $("input[name=autoValidation]").is(":checked") ){
446 $("#AutoSendMail").prop("disabled", false);
447 $("#AutoSendMail").prop("checked", true);
449 $("#AutoSendMail").prop("disabled", true);
450 $("#AutoSendMail").prop("checked", false);
456 $("input.button-save").click("submit", function(e) {
457 console.log("Call valider()");
458 if (document.demandeCP.date_debut_.value != "")
460 if(document.demandeCP.date_fin_.value != "")
462 if(document.demandeCP.valideur.value != "-1") {
466 alert(\''.dol_escape_js($langs->transnoentities(
'InvalidValidatorCP')).
'\');
472 alert(\
''.
dol_escape_js($langs->transnoentities(
'NoDateFin')).
'\');
478 alert(\
''.
dol_escape_js($langs->transnoentities(
'NoDateDebut')).
'\');
483 $(
"#autoValidation").change(
function(){
484 if( $(
"input[name=autoValidation]").is(
":checked") ){
485 $(
"#AutoSendMail").prop(
"disabled",
false);
487 $(
"#AutoSendMail").prop(
"disabled",
true);
488 $(
"#AutoSendMail").prop(
"checked",
false);
495 // Leave request form
496 print '<form method=
"POST" action=
"'.$_SERVER['PHP_SELF'].'" name=
"demandeCP">
'."\n";
497 print '<input
type=
"hidden" name=
"token" value=
"'.newToken().'" />
'."\n";
498 print '<input
type=
"hidden" name=
"action" value=
"add" />
'."\n";
500 print dol_get_fiche_head();
502 print '<
table class=
"border centpercent">
';
507 print '<td
class=
"titlefield fieldrequired">
';
508 print $form->textwithpicto($langs->trans("groups"), $langs->trans("fusionGroupsUsers"));
511 print img_picto($langs->trans("groups"), 'group
', 'class=
"pictofixedwidth"');
513 $sql = ' SELECT rowid, nom from
'.MAIN_DB_PREFIX.'usergroup WHERE entity IN (
'.getEntity('usergroup
').')
';
514 $resql = $db->query($sql);
516 while ($obj = $db->fetch_object($resql)) {
517 $Tgroup[$obj->rowid] = $obj->nom;
520 print $form->multiselectarray('groups
', $Tgroup, GETPOST('groups
', 'array
'), 0, 0, 'quatrevingtpercent widthcentpercentminusx
', 0, 0);
526 print '<td
class=
"titlefield fieldrequired">
';
527 print $form->textwithpicto($langs->trans("users"), $langs->trans("fusionGroupsUsers"));
529 print img_picto($langs->trans("users"), 'user', 'class=
"pictofixedwidth"');
531 $sql = 'SELECT u.rowid, u.lastname, u.firstname, u.login, u.photo FROM
'.MAIN_DB_PREFIX.'user as u
';
532 $sql .= ' WHERE 1 = 1
';
533 $sql .= empty($morefilter) ? '' : $morefilter;
536 $userstatic = new User($db);
538 $resql = $db->query($sql);
540 while ($obj = $db->fetch_object($resql)) {
541 $userstatic->id = $obj->rowid;
542 $userstatic->login = $obj->login;
543 $userstatic->firstname = $obj->firstname;
544 $userstatic->lastname = $obj->lastname;
545 $userstatic->photo = $obj->photo;
547 $userlist[$obj->rowid] = array(
549 'label
' => dolGetFirstLastname($obj->firstname, $obj->lastname),
550 'data-html
' => $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login
', '', 1).' '.dolGetFirstLastname($obj->firstname, $obj->lastname)
555 print img_picto('', 'users
', 'class=
"pictofixedwidth"') . $form->multiselectarray('users
', $userlist, GETPOST('users
', 'array
'), 0, 0, 'quatrevingtpercent widthcentpercentminusx
', 0, 0);
560 print '<td
class=
"fieldrequired">
'.$langs->trans("Type").'</td>
';
562 $typeleaves = $object->getTypes(1, -1);
563 $arraytypeleaves = array();
564 foreach ($typeleaves as $key => $val) {
565 $labeltoshow = ($langs->trans($val['code
']) != $val['code
'] ? $langs->trans($val['code
']) : $val['label
']);
566 $labeltoshow .= ($val['delay
'] > 0 ? ' (
'.$langs->trans("NoticePeriod").':
'.$val['delay
'].' '.$langs->trans("days").')
' : '');
567 $arraytypeleaves[$val['rowid
']] = $labeltoshow;
569 print $form->selectarray('type', $arraytypeleaves, (GETPOST('type', 'alpha
') ? GETPOST('type', 'alpha
') : ''), 1, 0, 0, '', 0, 0, 0, '', '', 1);
571 print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
578 print '<td
class=
"fieldrequired">
';
579 print $form->textwithpicto($langs->trans("DateDebCP"), $langs->trans("FirstDayOfHoliday"));
582 // If the request does not come from the agenda
583 if (!GETPOST('date_debut_
')) {
584 print $form->selectDate(-1, 'date_debut_
', 0, 0, 0, '', 1, 1);
586 $tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_debut_month
'), GETPOSTINT('date_debut_day
'), GETPOSTINT('date_debut_year
'));
587 print $form->selectDate($tmpdate, 'date_debut_
', 0, 0, 0, '', 1, 1);
589 print '
';
590 print $form->selectarray('starthalfday
', $listhalfday, (GETPOST('starthalfday
', 'alpha
') ? GETPOST('starthalfday
', 'alpha
') : 'morning
'));
596 print '<td
class=
"fieldrequired">
';
597 print $form->textwithpicto($langs->trans("DateFinCP"), $langs->trans("LastDayOfHoliday"));
600 if (!GETPOST('date_fin_
')) {
601 print $form->selectDate(-1, 'date_fin_
', 0, 0, 0, '', 1, 1);
603 $tmpdate = dol_mktime(0, 0, 0, GETPOSTINT('date_fin_month
'), GETPOSTINT('date_fin_day
'), GETPOSTINT('date_fin_year
'));
604 print $form->selectDate($tmpdate, 'date_fin_
', 0, 0, 0, '', 1, 1);
606 print '
';
607 print $form->selectarray('endhalfday
', $listhalfday, (GETPOST('endhalfday
', 'alpha
') ? GETPOST('endhalfday
', 'alpha
') : 'afternoon
'));
613 print '<td
class=
"fieldrequired">
'.$langs->trans("ReviewedByCP").'</td>
';
616 $object = new Holiday($db);
617 $include_users = $object->fetch_users_approver_holiday();
618 if (empty($include_users)) {
619 print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateHolidays");
621 // Defined default approver (the forced approver of user or the supervisor if no forced value defined)
622 // Note: This use will be set only if the defined approver has permission to approve so is inside include_users
623 $defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
624 if (getDolGlobalString('HOLIDAY_DEFAULT_VALIDATOR
')) {
625 $defaultselectuser = getDolGlobalString('HOLIDAY_DEFAULT_VALIDATOR
'); // Can force default approver
627 if (GETPOSTINT('valideur
') > 0) {
628 $defaultselectuser = GETPOSTINT('valideur
');
630 $s = $form->select_dolusers($defaultselectuser, "valideur", 1, null, 0, $include_users, '', '0,
'.$conf->entity, 0, 0, '', 0, '', 'minwidth200 maxwidth500
');
631 print img_picto('', 'user').$form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate"));
638 //auto validation ON CREATE
639 print '<tr><td>
'.$langs->trans("AutoValidationOnCreate").'</td><td>
';
640 print '<input
type=
"checkbox" id=
"autoValidation" name=
"autoValidation" value=
"1"'.($autoValidation ? ' checked=
"checked"' : '').'>
';
641 print '</td></tr>
'."\n";
645 print '<tr><td>
'.$langs->trans("AutoSendMail").'</td><td>
';
646 print '<input
type=
"checkbox" id=
"AutoSendMail" name=
"AutoSendMail" value=
"1"'.($AutoSendMail ? ' checked=
"checked"' : '').'>
';
647 print '</td></tr>
'."\n";
651 print '<td>
'.$langs->trans("DescCP").'</td>
';
652 print '<td
class=
"tdtop">
';
653 $doleditor = new DolEditor('description', GETPOST('description', 'restricthtml
'), '', 80, 'dolibarr_notes
', 'In
', false, false, isModEnabled('fckeditor
'), ROWS_3, '90%
');
654 print $doleditor->Create(1);
658 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php
';
663 print dol_get_fiche_end();
665 print $form->buttonsSaveCancel("SendRequestCollectiveCP");
667 print '</from>
'."\n";
671 print '<div
class=
"tabBar">
';
673 print '<br><br><input
type=
"button" value=
"'.$langs->trans("ReturnCP
").'" class=
"button" onclick=
"history.go(-1)" />
';
696function sendMail($id, $cancreate, $now, $autoValidation)
698 $objStd = new stdClass();
700 $objStd->status = 'success
';
704 global $db, $user, $langs;
706 $object = new Holiday($db);
708 $result = $object->fetch($id);
711 // If draft and owner of leave
712 if ($object->status == Holiday::STATUS_VALIDATED && $cancreate) {
713 $object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
715 //if ($autoValidation) $object->status = Holiday::STATUS_VALIDATED;
717 $verif = $object->validate($user);
721 $destinataire = new User($db);
722 $destinataire->fetch($object->fk_validator);
723 $emailTo = $destinataire->email;
727 dol_syslog("Expected validator has no email, so we redirect directly to finished page without sending email");
730 $objStd->msg = $langs->trans('ErrorMailRecipientIsEmpty
');
731 $objStd->status = 'error
';
732 $objStd->style = "warnings";
737 $expediteur = new User($db);
738 $expediteur->fetch($object->fk_user);
740 //$emailFrom = $expediteur->email; Email of user can be an email into another company. Sending will fails, we must use the generic email.
741 $emailFrom = getDolGlobalString('MAIN_MAIL_EMAIL_FROM
');
744 $societeName = getDolGlobalString('MAIN_INFO_SOCIETE_NOM
');
745 if (getDolGlobalString('MAIN_APPLICATION_TITLE
')) {
746 $societeName = getDolGlobalString('MAIN_APPLICATION_TITLE
');
749 $subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysToValidate");
752 $message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";
754 $message .= "<p>".$langs->transnoentities("HolidaysToValidateBody")."</p>\n";
757 // option to warn the validator in case of too short delay
758 if (!getDolGlobalString('HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY
')) {
759 $delayForRequest = 0; // TODO Set delay depending of holiday leave type
760 if ($delayForRequest) {
761 $nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd
');
763 if ($object->date_debut < $nowplusdelay) {
764 $message = "<p>".$langs->transnoentities("HolidaysToValidateDelay", $delayForRequest)."</p>\n";
769 // option to notify the validator if the balance is less than the request
770 // (only for leave types that actually use the balance counter)
771 if (!getDolGlobalString('HOLIDAY_HIDE_APPROVER_ABOUT_NEGATIVE_BALANCE
')) {
772 $affectingtypes = $object->getTypes(1, 1);
773 if (!empty($affectingtypes[$object->fk_type])) {
774 $nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday, $expediteur->country_id, $object->fk_user);
776 if ($nbopenedday > $object->getCPforUser($object->fk_user, $object->fk_type)) {
777 $message .= "<p>".$langs->transnoentities("HolidaysToValidateAlertSolde")."</p>\n";
782 $typeleaves = $object->getTypes(1, -1);
783 $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
']);
785 if ($object->halfday == 2) {
786 $starthalfdaykey = "Afternoon";
787 $endhalfdaykey = "Morning";
788 } elseif ($object->halfday == -1) {
789 $starthalfdaykey = "Afternoon";
790 $endhalfdaykey = "Afternoon";
791 } elseif ($object->halfday == 1) {
792 $starthalfdaykey = "Morning";
793 $endhalfdaykey = "Morning";
794 } elseif ($object->halfday == 0 || $object->halfday == 2) {
795 $starthalfdaykey = "Morning";
796 $endhalfdaykey = "Afternoon";
798 // For static analysis, ensure variables are defined
799 $starthalfdaykey = "InvalidHalfday";
800 $endhalfdaykey = "InvalidHalfday";
803 $link = dol_buildpath("/holiday/card.php", 3) . '?
id=
'.$object->id;
806 $message .= "<li>".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
807 $message .= "<li>".$langs->transnoentitiesnoconv("Type")." : ".(empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow)."</li>\n";
808 $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";
809 $message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href=
"'.$link.'" target=
"_blank">
'.$link."</a></li>\n";
810 $message .= "</ul>\n";
812 $trackid = 'leav
'.$object->id;
814 $sendtobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_HOLIDAY_TO
');
816 $mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', $sendtobcc, 0, 1, '', '', $trackid);
819 $result = $mail->sendfile();
823 $objStd->msg = $langs->trans('ErrorMailNotSend
');
824 $objStd->style = "warnings";
825 $objStd->status = 'error
';
827 $objStd->msg = $langs->trans('MailSent
');
833 $objStd->msg = $langs->trans('ErrorVerif
');
834 $objStd->status = 'error
';
835 $objStd->style = "errors";
841 $objStd->msg = $langs->trans('ErrorloadUserOnSendingMail
');
842 $objStd->status = 'error
';
843 $objStd->style = "warnings";
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
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.
if(is_object( $db)) sendMail($id, $cancreate, $now, $autoValidation)
send email to validator for current leave represented by (id)
Class of the module paid holiday.
const STATUS_VALIDATED
Validated status.
const STATUS_DRAFT
Draft status.
Class to manage Dolibarr users.
num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $countryCodeOrId='', $user_id=0)
Function to return number of working days (and text of units) between two dates (working days)
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_now($mode='gmt')
Return date for now.
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...
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into JavaScript code.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
$conf db user
Active Directory does not allow anonymous connections.
$conf db name
Only used if Module[ID]Name translation string is not found.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
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.
treeview li table
No Email.