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