dolibarr 21.0.0-alpha
card.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2005-2021 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
6 * Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
7 * Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
8 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
29// Load Dolibarr environment
30require '../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
34require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35
36// Define if user can read permissions
37$permissiontoadd = ($user->admin || $user->hasRight("user", "user", "write"));
38$permissiontoread = ($user->admin || $user->hasRight("user", "user", "read"));
39$permissiontoedit = ($user->admin || $user->hasRight("user", "user", "write"));
40$permissiontodisable = ($user->admin || $user->hasRight("user", "user", "delete"));
41$feature2 = 'user';
42
43// Advanced permissions
44$advancedpermsactive = false;
45if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
46 $advancedpermsactive = true;
47 $permissiontoread = ($user->admin || ($user->hasRight("user", "group_advance", "read") && $user->hasRight("user", "group_advance", "readperms")));
48 $permissiontoedit = ($user->admin || $user->hasRight("user", "group_advance", "write"));
49 $permissiontodisable = ($user->admin || $user->hasRight("user", "group_advance", "delete"));
50 $feature2 = 'group_advance';
51}
52
53// Load translation files required by page
54$langs->loadLangs(array('users', 'other'));
55
56$id = GETPOSTINT('id');
57$action = GETPOST('action', 'aZ09');
58$cancel = GETPOST('cancel', 'aZ09');
59$confirm = GETPOST('confirm', 'alpha');
60$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'groupcard'; // To manage different context of search
61$backtopage = GETPOST('backtopage', 'alpha');
62
63$userid = GETPOSTINT('user');
64
65$object = new UserGroup($db);
66$extrafields = new ExtraFields($db);
67// fetch optionals attributes and labels
68$extrafields->fetch_name_optionals_label($object->table_element);
69
70// Load object
71include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
72$object->loadRights();
73
74// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
75$hookmanager->initHooks(array('groupcard', 'globalcard'));
76
77// Security check
78$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', $feature2);
79
80// Users/Groups management only in master entity if transverse mode
81if (isModEnabled('multicompany') && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) {
83}
84
85
90$parameters = array('id' => $id, 'userid' => $userid, 'caneditperms' => $permissiontoedit);
91$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
92if ($reshook < 0) {
93 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
94}
95
96if (empty($reshook)) {
97 $backurlforlist = DOL_URL_ROOT.'/user/group/list.php';
98
99 if (empty($backtopage) || ($cancel && empty($id))) {
100 if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
101 if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
102 $backtopage = $backurlforlist;
103 } else {
104 $backtopage = DOL_URL_ROOT.'/user/group/card.php?id='.($id > 0 ? $id : '__ID__');
105 }
106 }
107 }
108
109 if ($cancel) {
110 header("Location: ".$backtopage);
111 exit;
112 }
113
114 // Action remove group
115 if ($action == 'confirm_delete' && $confirm == "yes" && $permissiontoedit) {
116 $object->fetch($id);
117 $object->delete($user);
118 header("Location: ".DOL_URL_ROOT."/user/group/list.php?restore_lastsearch_values=1");
119 exit;
120 }
121
122 // Action add group
123 if ($action == 'add' && $permissiontoedit) {
124 if (!GETPOST("nom", "alphanohtml")) {
125 setEventMessages($langs->trans("NameNotDefined"), null, 'errors');
126 $action = "create"; // Go back to create page
127 } else {
128 $object->name = GETPOST("nom", 'alphanohtml');
129 $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml')));
130
131 // Fill array 'array_options' with data from add form
132 $ret = $extrafields->setOptionalsFromPost(null, $object);
133 if ($ret < 0) {
134 $error++;
135 }
136
137 if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
138 $object->entity = 0;
139 } else {
140 if ($conf->entity == 1 && $user->admin && !$user->entity) { // Same permissions test than the one used to show the combo of entities into the form
141 $object->entity = GETPOSTISSET("entity") ? GETPOST("entity") : $conf->entity;
142 } else {
143 $object->entity = $conf->entity;
144 }
145 }
146
147 $db->begin();
148
149 $id = $object->create();
150
151 if ($id > 0) {
152 $db->commit();
153
154 header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
155 exit;
156 } else {
157 $db->rollback();
158
159 $langs->load("errors");
160 setEventMessages($langs->trans("ErrorGroupAlreadyExists", $object->name), null, 'errors');
161 $action = "create"; // Go back to create page
162 }
163 }
164 }
165
166 // Add/Remove user into group
167 if (($action == 'adduser' || $action == 'removeuser') && $permissiontoedit) {
168 if ($userid > 0) {
169 $object->fetch($id);
170 $object->oldcopy = clone $object;
171
172 $edituser = new User($db);
173 $edituser->fetch($userid);
174 if ($action == 'adduser') { // Test on permission already done
175 $result = $edituser->SetInGroup($object->id, $object->entity);
176 }
177 if ($action == 'removeuser') { // Test on permission already done
178 $result = $edituser->RemoveFromGroup($object->id, $object->entity);
179 }
180
181 if ($result > 0) {
182 header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
183 exit;
184 } else {
185 setEventMessages($edituser->error, $edituser->errors, 'errors');
186 }
187 }
188 }
189
190
191 if ($action == 'update' && $permissiontoedit) {
192 $db->begin();
193
194 $object->fetch($id);
195
196 $object->oldcopy = clone $object;
197
198 $object->name = GETPOST("nom", 'alphanohtml');
199 $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml')));
200 $object->tms = dol_now();
201
202 // Fill array 'array_options' with data from add form
203 $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
204 if ($ret < 0) {
205 $error++;
206 }
207
208 if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
209 $object->entity = 0;
210 } elseif (GETPOSTISSET("entity")) {
211 $object->entity = GETPOSTINT("entity");
212 }
213
214 $ret = $object->update();
215
216 if ($ret >= 0 && !count($object->errors)) {
217 setEventMessages($langs->trans("GroupModified"), null, 'mesgs');
218 $db->commit();
219 } else {
220 setEventMessages($object->error, $object->errors, 'errors');
221 $db->rollback();
222 }
223 }
224
225 // Actions to build doc
226 $upload_dir = $conf->user->dir_output.'/usergroups';
227 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
228}
229
230
231/*
232 * View
233 */
234
235$title = $object->name.' - '.$langs->trans("Card");
236if ($action == 'create') {
237 $title = $langs->trans("NewGroup");
238}
239$help_url = "";
240llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-user page-group_card');
241
242
243$form = new Form($db);
244$fuserstatic = new User($db);
245$form = new Form($db);
246$formfile = new FormFile($db);
247
248if ($action == 'create') {
249 print load_fiche_titre($langs->trans("NewGroup"), '', 'object_group');
250
251 dol_set_focus('#nom');
252
253 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
254 print '<input type="hidden" name="token" value="'.newToken().'">';
255 print '<input type="hidden" name="action" value="add">';
256 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
257
258 print dol_get_fiche_head(array(), '', '', 0, '');
259
260 print '<table class="border centpercent tableforfieldcreate">';
261
262 // Multicompany
263 if (isModEnabled('multicompany') && is_object($mc)) {
264 if (!getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && $user->admin && !$user->entity) {
265 print "<tr>".'<td class="tdtop">'.$langs->trans("Entity").'</td>';
266 print "<td>".$mc->select_entities($conf->entity);
267 print "</td></tr>\n";
268 } else {
269 print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
270 }
271 }
272
273 // Common attributes
274 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
275
276 // Other attributes
277 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
278
279 print "</table>\n";
280
281 print dol_get_fiche_end();
282
283 print '<div class="center">';
284 print '<input class="button" name="add" value="'.$langs->trans("CreateGroup").'" type="submit">';
285 print ' &nbsp; ';
286 print '<input class="button button-cancel" value="'.$langs->trans("Cancel").'" name="cancel" type="submit">';
287 print '</div>';
288
289 print "</form>";
290} else {
291 /* ************************************************************************** */
292 /* */
293 /* Visu et edition */
294 /* */
295 /* ************************************************************************** */
296 if ($id) {
298 $title = $langs->trans("Group");
299
300 /*
301 * Confirmation suppression
302 */
303 if ($action == 'delete') {
304 print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("DeleteAGroup"), $langs->trans("ConfirmDeleteGroup", $object->name), "confirm_delete", '', 0, 1);
305 }
306
307 /*
308 * Card in view mode
309 */
310
311 if ($action != 'edit') {
312 print dol_get_fiche_head($head, 'group', $title, -1, 'group');
313
314 $linkback = '<a href="'.DOL_URL_ROOT.'/user/group/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
315
316 dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin);
317
318 print '<div class="fichecenter">';
319 print '<div class="fichehalfleft">';
320 print '<div class="underbanner clearboth"></div>';
321
322 print '<table class="border centpercent tableforfield">';
323
324 // Name (already in dol_banner, we keep it to have the GlobalGroup picto, but we should move it in dol_banner)
325 if (isModEnabled('multicompany')) {
326 print '<tr><td class="titlefield">'.$langs->trans("Name").'</td>';
327 print '<td class="valeur">'.dol_escape_htmltag($object->name);
328 if (empty($object->entity)) {
329 print img_picto($langs->trans("GlobalGroup"), 'redstar');
330 }
331 print "</td></tr>\n";
332 }
333
334 // Multicompany
335 if (isModEnabled('multicompany') && is_object($mc) && !getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && $user->admin && !$user->entity) {
336 $mc->getInfo($object->entity);
337 print "<tr>".'<td class="titlefield">'.$langs->trans("Entity").'</td>';
338 print '<td class="valeur">'.dol_escape_htmltag($mc->label);
339 print "</td></tr>\n";
340 }
341
342 unset($object->fields['nom']); // Name already displayed in banner
343
344 // Common attributes
345 $keyforbreak = '';
346 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
347
348 // Other attributes
349 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
350
351 print '</table>';
352 print '</div>';
353 print '</div>';
354
355 print '<div class="clearboth"></div>';
356
357 print dol_get_fiche_end();
358
359
360 /*
361 * Action bar
362 */
363 print '<div class="tabsAction">';
364
365 $parameters = array();
366 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
367 if ($reshook < 0) {
368 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
369 }
370
371 if ($permissiontoedit) {
372 print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
373 }
374
375 if ($permissiontodisable) {
376 print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans("DeleteGroup").'</a>';
377 }
378
379 print "</div>\n";
380
381 // List users in group
382
383 print load_fiche_titre($langs->trans("ListOfUsersInGroup"), '', 'user');
384
385 // Select the users that do not belong to the group yet
386 $exclude = array();
387
388 if (!empty($object->members)) {
389 foreach ($object->members as $useringroup) {
390 $exclude[] = $useringroup->id;
391 }
392 }
393
394 // Other form for add user to group
395 $parameters = array('caneditperms' => $permissiontoedit, 'exclude' => $exclude);
396 $reshook = $hookmanager->executeHooks('formAddUserToGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
397 print $hookmanager->resPrint;
398
399 if (empty($reshook)) {
400 if ($permissiontoedit) {
401 print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST">'."\n";
402 print '<input type="hidden" name="token" value="'.newToken().'">';
403 print '<input type="hidden" name="action" value="adduser">';
404 print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
405 print '<table class="noborder centpercent">'."\n";
406 print '<tr class="liste_titre"><td class="titlefield liste_titre">'.$langs->trans("NonAffectedUsers").'</td>'."\n";
407 print '<td class="liste_titre">';
408 print $form->select_dolusers('', 'user', 1, $exclude, 0, '', '', $object->entity, 0, 0, '', 0, '', 'minwidth200 maxwidth500');
409 print ' &nbsp; ';
410 print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
411 print '<input type="submit" class="button buttongen button-add" value="'.$langs->trans("Add").'">';
412 print '</td></tr>'."\n";
413 print '</table>';
414 print '</div>';
415 print '</form>'."\n";
416 //print '<br>';
417 }
418
419 /*
420 * Group members
421 */
422
423 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
424 print '<table class="noborder centpercent">';
425 print '<tr class="liste_titre">';
426 print '<td class="liste_titre">'.$langs->trans("Login").'</td>';
427 print '<td class="liste_titre">'.$langs->trans("Lastname").'</td>';
428 print '<td class="liste_titre">'.$langs->trans("Firstname").'</td>';
429 print '<td class="liste_titre center" width="5">'.$langs->trans("Status").'</td>';
430 print '<td class="liste_titre right" width="5">&nbsp;</td>';
431 print "</tr>\n";
432
433 $object->fetch($object->id, '', true); // true to force load of all users, member of the group
434
435 if (!empty($object->members)) {
436 foreach ($object->members as $useringroup) {
437 print '<tr class="oddeven">';
438 print '<td class="tdoverflowmax150">';
439 print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login');
440 if (isModEnabled('multicompany') && $useringroup->admin && empty($useringroup->entity)) {
441 print img_picto($langs->trans("SuperAdministratorDesc"), 'redstar');
442 } elseif ($useringroup->admin) {
443 print img_picto($langs->trans("AdministratorDesc"), 'star');
444 }
445 print '</td>';
446 print '<td>'.$useringroup->lastname.'</td>';
447 print '<td>'.$useringroup->firstname.'</td>';
448 print '<td class="center">'.$useringroup->getLibStatut(5).'</td>';
449 print '<td class="right">';
450 if (!empty($user->admin)) {
451 print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=removeuser&token='.newToken().'&user='.$useringroup->id.'">';
452 print img_picto($langs->trans("RemoveFromGroup"), 'unlink');
453 print '</a>';
454 } else {
455 print "-";
456 }
457 print "</td></tr>\n";
458 }
459 } else {
460 print '<tr><td colspan="6"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
461 }
462 print "</table>";
463 print '</div>';
464 }
465
466 print "<br>";
467
468 print '<div class="fichecenter"><div class="fichehalfleft">';
469
470 /*
471 * Generated documents
472 */
473
474 $filename = dol_sanitizeFileName($object->ref);
475 $filedir = $conf->user->dir_output."/usergroups/".dol_sanitizeFileName($object->ref);
476 $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
477 $genallowed = $user->hasRight("user", "user", "write");
478 $delallowed = $user->hasRight("user", "user", "delete");
479
480 $somethingshown = $formfile->showdocuments('usergroup', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', $mysoc->default_lang);
481
482 // Show links to link elements
483 $tmparray = $form->showLinkToObjectBlock($object, array(), array(), 1);
484 $linktoelem = $tmparray['linktoelem'];
485 $htmltoenteralink = $tmparray['htmltoenteralink'];
486 print $htmltoenteralink;
487
488 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
489
490 print '</div><div class="fichehalfright">';
491
492 // List of actions on element
493 /*include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
494 $formactions = new FormActions($db);
495 $somethingshown = $formactions->showactions($object, 'usergroup', $socid, 1, '', $MAXEVENT);*/
496
497 print '</div></div>';
498 }
499
500 /*
501 * Card in edit mode
502 */
503
504 if ($action == 'edit' && $permissiontoedit) {
505 print '<form action="'.$_SERVER['PHP_SELF'].'" method="post" name="updategroup" enctype="multipart/form-data">';
506 print '<input type="hidden" name="token" value="'.newToken().'">';
507 print '<input type="hidden" name="action" value="update">';
508 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
509 print '<input type="hidden" name="id" value="'.$object->id.'">';
510
511 print dol_get_fiche_head($head, 'group', $title, 0, 'group');
512
513 print '<table class="border centpercent tableforfieldedit">'."\n";
514
515 // Multicompany
516 if (isModEnabled('multicompany') && is_object($mc)) {
517 if (!getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && $user->admin && !$user->entity) {
518 print "<tr>".'<td class="tdtop">'.$langs->trans("Entity").'</td>';
519 print "<td>".$mc->select_entities($object->entity);
520 print "</td></tr>\n";
521 } else {
522 print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
523 }
524 }
525
526 // Common attributes
527 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
528
529 // Other attributes
530 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
531
532 print '</table>';
533
534 print dol_get_fiche_end();
535
536 print $form->buttonsSaveCancel();
537
538 print '</form>';
539 }
540 }
541}
542
543// End of page
544llxFooter();
545$db->close();
$id
Definition account.php:39
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
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.
Definition wrapper.php:70
Class to manage standard extra fields.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to manage user groups.
Class to manage Dolibarr users.
llxFooter()
Footer empty.
Definition document.php:107
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_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.
dol_now($mode='auto')
Return date for now.
dol_set_focus($selector)
Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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.
group_prepare_head($object)
Prepare array with list of tabs.