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';
55$action =
GETPOST(
'action',
'aZ09');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$confirm =
GETPOST(
'confirm',
'alpha');
58$backtopage =
GETPOST(
'backtopage',
'alpha');
59$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
64$users = (
GETPOST(
'users',
'array') ?
GETPOST(
'users',
'array') : array($user->id));
65$groups =
GETPOST(
'groups',
'array');
71$langs->loadLangs(array(
"other",
"holiday",
"mails",
"trips"));
77$childids = $user->getAllChildIds(1);
81 $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;
139$parameters = array(
'socid' => $socid);
140$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
145if (empty($reshook)) {
146 $backurlforlist = DOL_URL_ROOT.
'/holiday/list.php';
148 if (empty($backtopage) || ($cancel && empty($id))) {
149 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
150 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
151 $backtopage = $backurlforlist;
153 $backtopage = DOL_URL_ROOT.
'/holiday/card_group.php?id='.((!empty($id) &&
$id > 0) ? $id :
'__ID__');
159 if (!empty($backtopageforcancel)) {
160 header(
"Location: ".$backtopageforcancel);
162 } elseif (!empty($backtopage)) {
163 header(
"Location: ".$backtopage);
170 if ($action ==
'add' && $permissiontoadd) {
171 $users =
GETPOST(
'users',
'array');
172 $groups =
GETPOST(
'groups',
'array');
178 $starthalfday =
GETPOST(
'starthalfday');
179 $endhalfday =
GETPOST(
'endhalfday');
183 if ($starthalfday ==
'afternoon' && $endhalfday ==
'morning') {
185 } elseif ($starthalfday ==
'afternoon') {
187 } elseif ($endhalfday ==
'morning') {
192 $description = trim(
GETPOST(
'description',
'restricthtml'));
195 if (!$permissiontoaddall) {
197 if (!$user->hasRight(
'holiday',
'write')) {
200 } elseif (!in_array($fuserid, $childids)) {
206 if (!$user->hasRight(
'holiday',
'write') && !$user->hasRight(
'holiday',
'writeall_advance')) {
209 } elseif (!$user->hasRight(
'holiday',
'writeall_advance') && !in_array($fuserid, $childids)) {
217 if (empty($groups) && empty($users)) {
218 setEventMessages($langs->trans(
"ErrorFieldRequiredUserOrGroup"),
null,
'errors');
226 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Type")),
null,
'errors');
232 if (empty($date_debut)) {
238 if (empty($date_fin)) {
244 if ($date_debut > $date_fin) {
251 $nbopenedday =
num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
252 if ($nbopenedday < 0.5) {
259 if ($approverid < 1) {
260 setEventMessages($langs->transnoentitiesnoconv(
'InvalidValidatorCP'),
null,
'errors');
268 $TusersToProcess = array();
272 $sql =
' SELECT DISTINCT u.rowid,u.lastname,u.firstname from ' . MAIN_DB_PREFIX .
'user as u';
273 $sql .=
' LEFT JOIN ' . MAIN_DB_PREFIX .
'usergroup_user as ug on ug.fk_user = u.rowid ';
274 $sql .=
' WHERE fk_usergroup in (' .$db->sanitize(implode(
',', $groups)) .
')';
275 $resql = $db->query($sql);
278 while ($obj = $db->fetch_object($resql)) {
279 $TusersToProcess[$obj->rowid] = $obj->rowid;
283 if (is_array($users) && count($users) > 0) {
284 foreach ($users as $u) {
285 $TusersToProcess[$u] = $u;
288 foreach ($TusersToProcess as $u) {
290 $verifCP =
$object->verifDateHolidayCP($u, $date_debut, $date_fin, $halfday);
294 $userError =
new User($db);
295 $result = $userError->fetch($u);
298 setEventMessages($langs->trans(
"UseralreadyCPexist", $userError->firstname .
' '. $userError->lastname),
null,
'errors');
311 foreach ($TusersToProcess as $u) {
314 $object->description = $description;
315 $object->fk_validator = $approverid;
317 $object->date_debut = $date_debut;
321 $result =
$object->create($user);
328 if ($autoValidation) {
330 $htemp->fetch($result);
333 $resultValidated = $htemp->update($approverid);
335 if ($resultValidated < 0) {
341 if ($AutoSendMail && !$error) {
343 $returnSendMail =
sendMail($result, $permissiontoadd, $now, $autoValidation);
344 if (!empty($returnSendMail->msg)) {
355 header(
'Location: '.DOL_URL_ROOT.
'/holiday/list.php');
370$form =
new Form($db);
373$listhalfday = array(
'morning' => $langs->trans(
"Morning"),
"afternoon" => $langs->trans(
"Afternoon"));
375$title = $langs->trans(
'Leave');
376$help_url =
'EN:Module_Holiday';
378llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-holiday page-card_group');
380if ((empty($id) && empty($ref)) || $action ==
'create' || $action ==
'add') {
382 if ((in_array($fuserid, $childids) && !$user->hasRight(
'holiday',
'writeall')) || (!in_array($fuserid, $childids) && (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') || !$user->hasRight(
'holiday',
'writeall_advance')))) {
383 $errors[] = $langs->trans(
'CantCreateCP');
386 print
load_fiche_titre($langs->trans(
'MenuCollectiveAddCP'),
'',
'title_hrm.png');
392 $errors[] = $langs->trans(
'ErrorEndDateCP');
395 $errors[] = $langs->trans(
'ErrorSQLCreateCP');
398 $errors[] = $langs->trans(
'CantCreateCP');
401 $errors[] = $langs->trans(
'InvalidValidatorCP');
404 $errors[] = $langs->trans(
'NoDateDebut');
407 $errors[] = $langs->trans(
'NoDateFin');
410 $errors[] = $langs->trans(
'ErrorDureeCP');
413 $errors[] = $langs->trans(
'alreadyCPexist');
421 print
'<script type="text/javascript">
422 $( document ).ready(function() {
424 if( $("input[name=autoValidation]").is(":checked") ){
425 $("#AutoSendMail").prop("disabled", false);
426 $("#AutoSendMail").prop("checked", true);
429 $("#AutoSendMail").prop("disabled", true);
430 $("#AutoSendMail").prop("checked", false);
433 $("input[name=autoValidation]").click( function(e) {
436 if( $("input[name=autoValidation]").is(":checked") ){
437 $("#AutoSendMail").prop("disabled", false);
438 $("#AutoSendMail").prop("checked", true);
440 $("#AutoSendMail").prop("disabled", true);
441 $("#AutoSendMail").prop("checked", false);
447 $("input.button-save").click("submit", function(e) {
448 console.log("Call valider()");
449 if (document.demandeCP.date_debut_.value != "")
451 if(document.demandeCP.date_fin_.value != "")
453 if(document.demandeCP.valideur.value != "-1") {
457 alert("'.dol_escape_js($langs->transnoentities(
'InvalidValidatorCP')).
'");
463 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateFin')).
'");
469 alert("'.
dol_escape_js($langs->transnoentities(
'NoDateDebut')).
'");
474 $("#autoValidation").change(function(){
475 if( $("input[name=autoValidation]").is(":checked") ){
476 $("#AutoSendMail").prop("disabled", false);
478 $("#AutoSendMail").prop("disabled", true);
479 $("#AutoSendMail").prop("checked", false);
487 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" name="demandeCP">'.
"\n";
488 print
'<input type="hidden" name="token" value="'.newToken().
'" />'.
"\n";
489 print
'<input type="hidden" name="action" value="add" />'.
"\n";
493 print
'<table class="border centpercent">';
498 print
'<td class="titlefield fieldrequired">';
499 print $form->textwithpicto($langs->trans(
"groups"), $langs->trans(
"fusionGroupsUsers"));
502 print
img_picto($langs->trans(
"groups"),
'group',
'class="pictofixedwidth"');
504 $sql =
' SELECT rowid, nom from '.MAIN_DB_PREFIX.
'usergroup WHERE entity IN ('.
getEntity(
'usergroup').
')';
505 $resql = $db->query($sql);
507 while ($obj = $db->fetch_object($resql)) {
508 $Tgroup[$obj->rowid] = $obj->nom;
511 print $form->multiselectarray(
'groups', $Tgroup,
GETPOST(
'groups',
'array'),
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
517 print
'<td class="titlefield fieldrequired">';
518 print $form->textwithpicto($langs->trans(
"users"), $langs->trans(
"fusionGroupsUsers"));
520 print
img_picto($langs->trans(
"users"),
'user',
'class="pictofixedwidth"');
522 $sql =
'SELECT u.rowid, u.lastname, u.firstname, u.login, u.photo FROM '.MAIN_DB_PREFIX.
'user as u';
523 $sql .=
' WHERE 1 = 1';
524 $sql .= !empty($morefilter) ? $morefilter :
'';
527 $userstatic =
new User($db);
529 $resql = $db->query($sql);
531 while ($obj = $db->fetch_object($resql)) {
532 $userstatic->id = $obj->rowid;
533 $userstatic->login = $obj->login;
534 $userstatic->firstname = $obj->fistname;
535 $userstatic->lastname = $obj->lastname;
536 $userstatic->photo = $obj->photo;
538 $userlist[$obj->rowid] = array(
541 'data-html' => $userstatic->getNomUrl(-3,
'', 0, 1, 24, 1,
'login',
'', 1).
' '.
dolGetFirstLastname($obj->firstname, $obj->lastname)
546 print
img_picto(
'',
'users',
'class="pictofixedwidth"') . $form->multiselectarray(
'users', $userlist,
GETPOST(
'users',
'array'),
'', 0,
'quatrevingtpercent widthcentpercentminusx', 0, 0);
551 print
'<td class="fieldrequired">'.$langs->trans(
"Type").
'</td>';
553 $typeleaves =
$object->getTypes(1, -1);
554 $arraytypeleaves = array();
555 foreach ($typeleaves as $key => $val) {
556 $labeltoshow = ($langs->trans($val[
'code']) != $val[
'code'] ? $langs->trans($val[
'code']) : $val[
'label']);
557 $labeltoshow .= ($val[
'delay'] > 0 ?
' ('.$langs->trans(
"NoticePeriod").
': '.$val[
'delay'].
' '.$langs->trans(
"days").
')' :
'');
558 $arraytypeleaves[$val[
'rowid']] = $labeltoshow;
560 print $form->selectarray(
'type', $arraytypeleaves, (
GETPOST(
'type',
'alpha') ?
GETPOST(
'type',
'alpha') :
''), 1, 0, 0,
'', 0, 0, 0,
'',
'', true);
562 print
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
569 print
'<td class="fieldrequired">';
570 print $form->textwithpicto($langs->trans(
"DateDebCP"), $langs->trans(
"FirstDayOfHoliday"));
575 print $form->selectDate(-1,
'date_debut_', 0, 0, 0,
'', 1, 1);
578 print $form->selectDate($tmpdate,
'date_debut_', 0, 0, 0,
'', 1, 1);
580 print
' ';
581 print $form->selectarray(
'starthalfday', $listhalfday, (
GETPOST(
'starthalfday',
'alpha') ?
GETPOST(
'starthalfday',
'alpha') :
'morning'));
587 print
'<td class="fieldrequired">';
588 print $form->textwithpicto($langs->trans(
"DateFinCP"), $langs->trans(
"LastDayOfHoliday"));
592 print $form->selectDate(-1,
'date_fin_', 0, 0, 0,
'', 1, 1);
595 print $form->selectDate($tmpdate,
'date_fin_', 0, 0, 0,
'', 1, 1);
597 print
' ';
598 print $form->selectarray(
'endhalfday', $listhalfday, (
GETPOST(
'endhalfday',
'alpha') ?
GETPOST(
'endhalfday',
'alpha') :
'afternoon'));
604 print
'<td class="fieldrequired">'.$langs->trans(
"ReviewedByCP").
'</td>';
608 $include_users =
$object->fetch_users_approver_holiday();
609 if (empty($include_users)) {
610 print
img_warning().
' '.$langs->trans(
"NobodyHasPermissionToValidateHolidays");
614 $defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
621 $s = $form->select_dolusers($defaultselectuser,
"valideur", 1,
'', 0, $include_users,
'',
'0,'.
$conf->entity, 0, 0,
'', 0,
'',
'minwidth200 maxwidth500');
622 print
img_picto(
'',
'user').$form->textwithpicto($s, $langs->trans(
"AnyOtherInThisListCanValidate"));
630 print
'<tr><td>'.$langs->trans(
"AutoValidationOnCreate").
'</td><td>';
631 print
'<input type="checkbox" id="autoValidation" name="autoValidation" value="1"'.($autoValidation ?
' checked="checked"' :
'').
'>';
632 print
'</td></tr>'.
"\n";
636 print
'<tr><td>'.$langs->trans(
"AutoSendMail").
'</td><td>';
637 print
'<input type="checkbox" id="AutoSendMail" name="AutoSendMail" value="1"'.($AutoSendMail ?
' checked="checked"' :
'').
'>';
638 print
'</td></tr>'.
"\n";
642 print
'<td>'.$langs->trans(
"DescCP").
'</td>';
643 print
'<td class="tdtop">';
644 $doleditor =
new DolEditor(
'description',
GETPOST(
'description',
'restricthtml'),
'', 80,
'dolibarr_notes',
'In',
false,
false, isModEnabled(
'fckeditor'), ROWS_3,
'90%');
645 print $doleditor->Create(1);
649 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
656 print $form->buttonsSaveCancel(
"SendRequestCollectiveCP");
658 print
'</from>'.
"\n";
662 print
'<div class="tabBar">';
664 print
'<br><br><input type="button" value="'.$langs->trans(
"ReturnCP").
'" class="button" onclick="history.go(-1)" />';
687function sendMail($id, $cancreate, $now, $autoValidation)
691 $objStd->status =
'success';
695 global $db, $user, $langs;
708 $verif =
$object->validate($user);
712 $destinataire =
new User($db);
713 $destinataire->fetch(
$object->fk_validator);
714 $emailTo = $destinataire->email;
718 dol_syslog(
"Expected validator has no email, so we redirect directly to finished page without sending email");
721 $objStd->msg = $langs->trans(
'ErrorMailRecipientIsEmpty');
722 $objStd->status =
'error';
723 $objStd->style =
"warnings";
728 $expediteur =
new User($db);
729 $expediteur->fetch(
$object->fk_user);
739 $subject = $societeName.
" - ".$langs->transnoentitiesnoconv(
"HolidaysToValidate");
742 $message =
"<p>".$langs->transnoentitiesnoconv(
"Hello").
" ".$destinataire->firstname.
",</p>\n";
744 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateBody").
"</p>\n";
749 $delayForRequest = 0;
750 if ($delayForRequest) {
753 if (
$object->date_debut < $nowplusdelay) {
754 $message =
"<p>".$langs->transnoentities(
"HolidaysToValidateDelay", $delayForRequest).
"</p>\n";
764 $message .=
"<p>".$langs->transnoentities(
"HolidaysToValidateAlertSolde").
"</p>\n";
768 $typeleaves =
$object->getTypes(1, -1);
769 $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']);
772 $starthalfdaykey =
"Afternoon";
773 $endhalfdaykey =
"Morning";
774 } elseif (
$object->halfday == -1) {
775 $starthalfdaykey =
"Afternoon";
776 $endhalfdaykey =
"Afternoon";
777 } elseif (
$object->halfday == 1) {
778 $starthalfdaykey =
"Morning";
779 $endhalfdaykey =
"Morning";
781 $starthalfdaykey =
"Morning";
782 $endhalfdaykey =
"Afternoon";
785 $link =
dol_buildpath(
"/holiday/card.php", 3) .
'?id='.$object->id;
788 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Name").
" : ".
dolGetFirstLastname($expediteur->firstname, $expediteur->lastname).
"</li>\n";
789 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Type").
" : ".(empty($labeltoshow) ? $langs->trans(
"TypeWasDisabledOrRemoved",
$object->fk_type) : $labeltoshow).
"</li>\n";
790 $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";
791 $message .=
"<li>".$langs->transnoentitiesnoconv(
"Link").
' : <a href="'.$link.
'" target="_blank">'.$link.
"</a></li>\n";
792 $message .=
"</ul>\n";
794 $trackid =
'leav'.$object->id;
798 $mail =
new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(),
'', $sendtobcc, 0, 1,
'',
'', $trackid);
801 $result = $mail->sendfile();
805 $objStd->msg = $langs->trans(
'ErrorMailNotSend');
806 $objStd->style =
"warnings";
807 $objStd->status =
'error';
809 $objStd->msg = $langs->trans(
'MailSent');
815 $objStd->msg = $langs->trans(
'ErrorVerif');
816 $objStd->status =
'error';
817 $objStd->style =
"errors";
823 $objStd->msg = $langs->trans(
'ErrorloadUserOnSendingMail');
824 $objStd->status =
'error';
825 $objStd->style =
"warnings";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
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.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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)
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_now($mode='auto')
Return date for now.
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).
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.
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.
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.