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