34require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/holiday.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.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';
91$extrafields->fetch_name_optionals_label(
$object->table_element);
93if (($id > 0) || $ref) {
98 if ($user->hasRight(
'holiday',
'readall')) {
101 if ($user->hasRight(
'holiday',
'read') && in_array(
$object->fk_user, $childids)) {
110$hookmanager->initHooks(array(
'holidaycard',
'globalcard'));
113$permissiontoaddall = 0;
114if ($user->hasRight(
'holiday',
'write') && in_array($fuserid, $childids)) {
115 $permissiontoadd = 1;
117if ($user->hasRight(
'holiday',
'writeall')) {
118 $permissiontoadd = 1;
119 $permissiontoaddall = 1;
123if ($user->hasRight(
'holiday',
'delete')) {
132 $socid = $user->socid;
141$parameters = array(
'socid' => $socid);
142$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
147if (empty($reshook)) {
148 $backurlforlist = DOL_URL_ROOT.
'/holiday/list.php';
150 if (empty($backtopage) || ($cancel && empty($id))) {
151 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
152 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
153 $backtopage = $backurlforlist;
155 $backtopage = DOL_URL_ROOT.
'/holiday/card_group.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
161 if (!empty($backtopageforcancel)) {
162 header(
"Location: ".$backtopageforcancel);
164 } elseif (!empty($backtopage)) {
165 header(
"Location: ".$backtopage);
172 if ($action ==
'add' && $permissiontoadd) {
173 $users =
GETPOST(
'users',
'array');
174 $groups =
GETPOST(
'groups',
'array');
180 $starthalfday =
GETPOST(
'starthalfday');
181 $endhalfday =
GETPOST(
'endhalfday');
185 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
187 } elseif ($starthalfday ==
'afternoon') {
189 } elseif ($endhalfday ==
'morning') {
194 $description = trim(
GETPOST(
'description',
'restricthtml'));
197 if (!$permissiontoaddall) {
199 if (!$user->hasRight(
'holiday',
'write')) {
202 } elseif (!in_array($fuserid, $childids)) {
208 if (!$user->hasRight(
'holiday',
'write') && !$user->hasRight(
'holiday',
'writeall_advance')) {
211 } elseif (!$user->hasRight(
'holiday',
'writeall_advance') && !in_array($fuserid, $childids)) {
219 if (empty($groups) && empty($users)) {
220 setEventMessages($langs->trans(
"ErrorFieldRequiredUserOrGroup"),
null,
'errors');
228 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
234 if (empty($date_debut)) {
240 if (empty($date_fin)) {
246 if ($date_debut > $date_fin) {
253 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday,
$mysoc->country_id);
254 if ($nbopenedday < 0.5) {
261 if ($approverid < 1) {
262 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidatorCP'),
null,
'errors');
270 $TusersToProcess = array();
274 $sql =
' SELECT DISTINCT u.rowid,u.lastname,u.firstname from ' . MAIN_DB_PREFIX .
'user as u';
275 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'usergroup_user as ug on ug.fk_user = u.rowid ';
276 $sql .=
' WHERE fk_usergroup in (' .$db->sanitize(implode(
',', $groups)) .
')';
277 $resql = $db->query($sql);
280 while ($obj = $db->fetch_object($resql)) {
281 $TusersToProcess[$obj->rowid] = $obj->rowid;
285 if (is_array($users) && count($users) > 0) {
286 foreach ($users as $u) {
287 $TusersToProcess[$u] = $u;
290 foreach ($TusersToProcess as $u) {
292 $verifCP =
$object->verifDateHolidayCP($u, $date_debut, $date_fin, $halfday);
296 $userError =
new User($db);
297 $result = $userError->fetch($u);
300 setEventMessages($langs->trans(
"UseralreadyCPexist", $userError->firstname .
' '. $userError->lastname),
null,
'errors');
313 foreach ($TusersToProcess as $u) {
316 $object->description = $description;
317 $object->fk_validator = $approverid;
319 $object->date_debut = $date_debut;
323 $result =
$object->create($user);
330 if ($autoValidation) {
332 $htemp->fetch($result);
335 $resultValidated = $htemp->update($approverid);
337 if ($resultValidated < 0) {
343 if ($AutoSendMail && !$error) {
345 $returnSendMail =
sendMail($result, $permissiontoadd, $now, $autoValidation);
346 if (!empty($returnSendMail->msg)) {
357 header(
'Location: '.DOL_URL_ROOT.
'/holiday/list.php');
372$form =
new Form($db);
375$listhalfday = array(
'morning' => $langs->trans(
"Morning"),
"afternoon" => $langs->trans(
"Afternoon"));
377$title = $langs->trans(
'Leave');
378$help_url =
'EN:Module_Holiday';
380llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-holiday page-card_group');
382if ((empty($id) && empty($ref)) || $action ==
'create' || $action ==
'add') {
384 if ((in_array($fuserid, $childids) && !$user->hasRight(
'holiday',
'writeall')) || (!in_array($fuserid, $childids) && (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') || !$user->hasRight(
'holiday',
'writeall_advance')))) {
385 $errors[] = $langs->trans(
'CantCreateCP');
388 print
load_fiche_titre($langs->trans(
'MenuCollectiveAddCP'),
'',
'title_hrm.png');
394 $errors[] = $langs->trans(
'ErrorEndDateCP');
397 $errors[] = $langs->trans(
'ErrorSQLCreateCP');
400 $errors[] = $langs->trans(
'CantCreateCP');
403 $errors[] = $langs->trans(
'InvalidValidatorCP');
406 $errors[] = $langs->trans(
'NoDateDebut');
409 $errors[] = $langs->trans(
'NoDateFin');
412 $errors[] = $langs->trans(
'ErrorDureeCP');
415 $errors[] = $langs->trans(
'alreadyCPexist');
423 print
'<script type="text/javascript">
424 $( document ).ready(function() {
426 if( $("input[name=autoValidation]").is(":checked") ){
427 $("#AutoSendMail").prop("disabled", false);
428 $("#AutoSendMail").prop("checked", true);
431 $("#AutoSendMail").prop("disabled", true);
432 $("#AutoSendMail").prop("checked", false);
435 $("input[name=autoValidation]").click( function(e) {
438 if( $("input[name=autoValidation]").is(":checked") ){
439 $("#AutoSendMail").prop("disabled", false);
440 $("#AutoSendMail").prop("checked", true);
442 $("#AutoSendMail").prop("disabled", true);
443 $("#AutoSendMail").prop("checked", false);
449 $("input.button-save").click("submit", function(e) {
450 console.log("Call valider()");
451 if (document.demandeCP.date_debut_.value != "")
453 if(document.demandeCP.date_fin_.value != "")
455 if(document.demandeCP.valideur.value != "-1") {
459 alert("'.dol_escape_js($langs->transnoentities(
'InvalidValidatorCP')).
'");
465 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateFin')).
'");
471 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateDebut')).
'");
476 $("#autoValidation").change(function(){
477 if( $("input[name=autoValidation]").is(":checked") ){
478 $("#AutoSendMail").prop("disabled", false);
480 $("#AutoSendMail").prop("disabled", true);
481 $("#AutoSendMail").prop("checked", false);
489 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="demandeCP">'.
"\n";
490 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
491 print
'<input type="hidden" name="action" value="add" />'.
"\n";
495 print
'<table class="border centpercent">';
500 print
'<td class="titlefield fieldrequired">';
501 print $form->textwithpicto($langs->trans(
"groups"), $langs->trans(
"fusionGroupsUsers"));
504 print
img_picto($langs->trans(
"groups"),
'group',
'class="pictofixedwidth"');
506 $sql =
' SELECT rowid, nom from '.MAIN_DB_PREFIX.
'usergroup WHERE entity IN ('.
getEntity(
'usergroup').
')';
507 $resql = $db->query($sql);
509 while ($obj = $db->fetch_object($resql)) {
510 $Tgroup[$obj->rowid] = $obj->nom;
513 print $form->multiselectarray(
'groups', $Tgroup,
GETPOST(
'groups',
'array'), 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
519 print
'<td class="titlefield fieldrequired">';
520 print $form->textwithpicto($langs->trans(
"users"), $langs->trans(
"fusionGroupsUsers"));
522 print
img_picto($langs->trans(
"users"),
'user',
'class="pictofixedwidth"');
524 $sql =
'SELECT u.rowid, u.lastname, u.firstname, u.login, u.photo FROM '.MAIN_DB_PREFIX.
'user as u';
525 $sql .=
' WHERE 1 = 1';
526 $sql .= empty($morefilter) ?
'' : $morefilter;
529 $userstatic =
new User($db);
531 $resql = $db->query($sql);
533 while ($obj = $db->fetch_object($resql)) {
534 $userstatic->id = $obj->rowid;
535 $userstatic->login = $obj->login;
536 $userstatic->firstname = $obj->firstname;
537 $userstatic->lastname = $obj->lastname;
538 $userstatic->photo = $obj->photo;
540 $userlist[$obj->rowid] = array(
543 'data-html' => $userstatic->getNomUrl(-3,
'', 0, 1, 24, 1,
'login',
'', 1).
' '.
dolGetFirstLastname($obj->firstname, $obj->lastname)
548 print
img_picto(
'',
'users',
'class="pictofixedwidth"') . $form->multiselectarray(
'users', $userlist,
GETPOST(
'users',
'array'), 0, 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
553 print
'<td class="fieldrequired">'.$langs->trans(
"Type").
'</td>';
555 $typeleaves =
$object->getTypes(1, -1);
556 $arraytypeleaves = array();
557 foreach ($typeleaves as $key => $val) {
558 $labeltoshow = ($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']);
559 $labeltoshow .= ($val[
'delay'] > 0 ?
' ('.$langs->trans(
"NoticePeriod").
': '.$val[
'delay'].
' '.$langs->trans(
"days").
')' :
'');
560 $arraytypeleaves[$val[
'rowid']] = $labeltoshow;
562 print $form->selectarray(
'type', $arraytypeleaves, (
GETPOST(
'type',
'alpha') ?
GETPOST(
'type',
'alpha') :
''), 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
564 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
571 print
'<td class="fieldrequired">';
572 print $form->textwithpicto($langs->trans(
"DateDebCP"), $langs->trans(
"FirstDayOfHoliday"));
577 print $form->selectDate(-1,
'date_debut_', 0, 0, 0,
'', 1, 1);
580 print $form->selectDate($tmpdate,
'date_debut_', 0, 0, 0,
'', 1, 1);
582 print
' ';
583 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday',
'alpha') ?
GETPOST(
'starthalfday',
'alpha') :
'morning'));
589 print
'<td class="fieldrequired">';
590 print $form->textwithpicto($langs->trans(
"DateFinCP"), $langs->trans(
"LastDayOfHoliday"));
594 print $form->selectDate(-1,
'date_fin_', 0, 0, 0,
'', 1, 1);
597 print $form->selectDate($tmpdate,
'date_fin_', 0, 0, 0,
'', 1, 1);
599 print
' ';
600 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday',
'alpha') ?
GETPOST(
'endhalfday',
'alpha') :
'afternoon'));
606 print
'<td class="fieldrequired">'.$langs->trans(
"ReviewedByCP").
'</td>';
610 $include_users =
$object->fetch_users_approver_holiday();
611 if (empty($include_users)) {
612 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
616 $defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
623 $s = $form->select_dolusers($defaultselectuser,
"valideur", 1,
null, 0, $include_users,
'',
'0,'.$conf->entity, 0, 0,
'', 0,
'',
'minwidth200 maxwidth500');
624 print
img_picto(
'',
'user').$form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
632 print
'<tr><td>'.$langs->trans(
"AutoValidationOnCreate").
'</td><td>';
633 print
'<input type="checkbox" id="autoValidation" name="autoValidation" value="1"'.($autoValidation ?
' checked="checked"' :
'').
'>';
634 print
'</td></tr>'.
"\n";
638 print
'<tr><td>'.$langs->trans(
"AutoSendMail").
'</td><td>';
639 print
'<input type="checkbox" id="AutoSendMail" name="AutoSendMail" value="1"'.($AutoSendMail ?
' checked="checked"' :
'').
'>';
640 print
'</td></tr>'.
"\n";
644 print
'<td>'.$langs->trans(
"DescCP").
'</td>';
645 print
'<td class="tdtop">';
646 $doleditor =
new DolEditor(
'description',
GETPOST(
'description',
'restricthtml'),
'', 80,
'dolibarr_notes',
'In',
false,
false,
isModEnabled(
'fckeditor'), ROWS_3,
'90%');
647 print $doleditor->Create(1);
651 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
658 print $form->buttonsSaveCancel(
"SendRequestCollectiveCP");
660 print
'</from>'.
"\n";
664 print
'<div class="tabBar">';
666 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
689function sendMail($id, $cancreate, $now, $autoValidation)
693 $objStd->status =
'success';
697 global $db, $user, $langs;
710 $verif =
$object->validate($user);
714 $destinataire =
new User($db);
715 $destinataire->fetch(
$object->fk_validator);
716 $emailTo = $destinataire->email;
720 dol_syslog(
"Expected validator has no email, so we redirect directly to finished page without sending email");
723 $objStd->msg = $langs->trans(
'ErrorMailRecipientIsEmpty');
724 $objStd->status =
'error';
725 $objStd->style =
"warnings";
730 $expediteur =
new User($db);
731 $expediteur->fetch(
$object->fk_user);
742 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysToValidate");
745 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
747 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateBody").
"</p>\n";
752 $delayForRequest = 0;
753 if ($delayForRequest) {
756 if (
$object->date_debut < $nowplusdelay) {
757 $message =
"<p>".$langs->transnoentities(
"HolidaysToValidateDelay", $delayForRequest).
"</p>\n";
765 $affectingtypes =
$object->getTypes(1, 1);
766 if (!empty($affectingtypes[
$object->fk_type])) {
770 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateAlertSolde").
"</p>\n";
775 $typeleaves =
$object->getTypes(1, -1);
776 $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']);
779 $starthalfdaykey =
"Afternoon";
780 $endhalfdaykey =
"Morning";
781 } elseif (
$object->halfday == -1) {
782 $starthalfdaykey =
"Afternoon";
783 $endhalfdaykey =
"Afternoon";
784 } elseif (
$object->halfday == 1) {
785 $starthalfdaykey =
"Morning";
786 $endhalfdaykey =
"Morning";
788 $starthalfdaykey =
"Morning";
789 $endhalfdaykey =
"Afternoon";
792 $starthalfdaykey =
"InvalidHalfday";
793 $endhalfdaykey =
"InvalidHalfday";
796 $link =
dol_buildpath(
"/holiday/card.php", 3) .
'?id='.$object->id;
799 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Name").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
800 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Type").
" : ".(empty($labeltoshow) ? $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type) : $labeltoshow).
"</li>\n";
801 $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";
802 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
803 $message .=
"</ul>\n";
805 $trackid =
'leav'.$object->id;
809 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
812 $result = $mail->sendfile();
816 $objStd->msg = $langs->trans(
'ErrorMailNotSend');
817 $objStd->style =
"warnings";
818 $objStd->status =
'error';
820 $objStd->msg = $langs->trans(
'MailSent');
826 $objStd->msg = $langs->trans(
'ErrorVerif');
827 $objStd->status =
'error';
828 $objStd->style =
"errors";
834 $objStd->msg = $langs->trans(
'ErrorloadUserOnSendingMail');
835 $objStd->status =
'error';
836 $objStd->style =
"warnings";
$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.
if(is_object( $db)) sendMail($id, $cancreate, $now, $autoValidation)
send email to validator for current leave represented by (id)
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.
Class to manage Dolibarr users.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
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_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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0, $attop=0)
Set event message in dol_events session object.
dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
Returns text escaped for inclusion into javascript code.
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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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.