dolibarr 23.0.3
workstation_card.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
5 * Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
30require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
31require_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
32require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
33require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php';
34require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstationusergroup.class.php';
35require_once DOL_DOCUMENT_ROOT.'/workstation/lib/workstation_workstation.lib.php';
36
46// Load translation files required by the page
47$langs->loadLangs(array('mrp', 'other'));
48
49// Get parameters
50$id = GETPOSTINT('id');
51$ref = GETPOST('ref', 'alpha');
52$action = GETPOST('action', 'aZ09');
53$confirm = GETPOST('confirm', 'alpha');
54$cancel = GETPOST('cancel');
55$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
56$backtopage = GETPOST('backtopage', 'alpha');
57$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
58$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
59
60$groups = GETPOST('groups', 'array:int');
61$resources = GETPOST('resources', 'array:int');
62//$lineid = GETPOST('lineid', 'int');
63
64// Initialize a technical objects
65$object = new Workstation($db);
66
67//$extrafields = new ExtraFields($db);
68$diroutputmassaction = $conf->workstation->dir_output.'/temp/massgeneration/'.$user->id;
69$hookmanager->initHooks(array($object->element.'card', 'globalcard')); // Note that conf->hooks_modules contains array
70
71// Fetch optionals attributes and labels
72$extrafields->fetch_name_optionals_label($object->table_element);
73
74$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
75
76// Initialize array of search criteria
77$search_all = trim(GETPOST("search_all", 'alpha'));
78$search = array();
79foreach ($object->fields as $key => $val) {
80 if (GETPOST('search_'.$key, 'alpha')) {
81 $search[$key] = GETPOST('search_'.$key, 'alpha');
82 }
83}
84
85if (empty($action) && empty($id) && empty($ref)) {
86 $action = 'view';
87}
88
89// Load object
90include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
91
92// Permissions
93$permissiontoread = $user->hasRight('workstation', 'workstation', 'read');
94$permissiontoadd = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
95$permissiontodelete = $user->hasRight('workstation', 'workstation', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == Workstation::STATUS_DISABLED);
96$permissionnote = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_setnotes.inc.php
97$permissiondellink = $user->hasRight('workstation', 'workstation', 'write'); // Used by the include of actions_dellink.inc.php
98
99$upload_dir = rtrim(getMultidirOutput($object, '', 1), '/');
100
101// Security check
102$isdraft = 0;
103restrictedArea($user, $object->element, $object->id, $object->table_element, 'workstation', 'fk_soc', 'rowid', $isdraft);
104
105
106/*
107 * Actions
108 */
109
110$parameters = array();
111$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
112if ($reshook < 0) {
113 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
114}
115
116if (empty($reshook)) {
117 $error = 0;
118
119 $backurlforlist = dol_buildpath('/workstation/workstation_list.php', 1);
120
121 if (empty($backtopage) || ($cancel && empty($id))) {
122 if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
123 if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
124 $backtopage = $backurlforlist;
125 } else {
126 $backtopage = dol_buildpath('/workstation/workstation_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
127 }
128 }
129 }
130
131 $triggermodname = 'WORKSTATION_WORKSTATION_MODIFY'; // Name of trigger action code to execute when we modify record
132
133 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
134 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
135
136 // Actions when linking object each other
137 include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
138
139 // Actions when printing a doc from card
140 include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
141
142 // Action to move up and down lines of object
143 //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
144
145 // Action to build doc
146 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
147
148 if ($action == 'confirm_enable' && $confirm == "yes" && $permissiontoadd) {
149 if (!empty($object->id)) {
150 $object->setStatus(1);
151 }
152 } elseif ($action == 'confirm_disable' && $confirm == "yes" && $permissiontoadd) {
153 if (!empty($object->id)) {
154 $object->setStatus(0);
155 }
156 }
157}
158
159
160
161/*
162 * View
163 */
164
165$form = new Form($db);
166$formfile = new FormFile($db);
167$formresource = new FormResource($db);
168
169$title = $langs->trans("Workstation")." - ".$langs->trans('Card');
170if ($action == 'create') {
171 $title = $langs->trans("NewObject", $langs->transnoentitiesnoconv("Workstation"));
172}
173$help_url = 'EN:Module_Workstation';
174
175llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-workstation page-workstation_card');
176
177// jquery code
178?>
179 <script>
180
181 jQuery(document).ready(function() {
182 jQuery("#type").change(function() {
183 if($(this).val() === 'MACHINE') {
184 $('#usergroups').hide();
185 $('#nb_operators_required').parent('td').parent('tr').hide();
186 $('#wsresources').show();
187 } else if($(this).val() === 'HUMAN') {
188 $('#wsresources').hide();
189 $('#nb_operators_required').parent('td').parent('tr').show();
190 $('#usergroups').show();
191 }
192 else {
193 $('#usergroups').show();
194 $('#wsresources').show();
195 $('#nb_operators_required').parent('td').parent('tr').show();
196 }
197 });
198 jQuery("#type").trigger('change');
199 });
200
201 </script>
202<?php
203
204// Part to create
205if ($action == 'create') {
206 if (empty($permissiontoadd)) {
207 accessforbidden('NotEnoughPermissions', 0, 1);
208 }
209
210 // Set default value of the property ref
211 $object->fields['ref']['default'] = $object->getNextNumRef();
212
213 print load_fiche_titre($title, '', 'object_'.$object->picto);
214
215 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
216 print '<input type="hidden" name="token" value="'.newToken().'">';
217 print '<input type="hidden" name="action" value="add">';
218 if ($backtopage) {
219 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
220 }
221 if ($backtopageforcancel) {
222 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
223 }
224
225 print dol_get_fiche_head(array(), '');
226
227 print '<table class="border centpercent tableforfieldcreate">'."\n";
228
229 // Common attributes
230 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
231
232 print '<tr id="usergroups">';
233 print '<td>';
234 print $langs->trans('UserGroups');
235 print '</td>';
236 print '<td>';
237 print img_picto('', 'group', 'class="pictofixedwidth"');
238 print $form->select_dolgroups($groups, 'groups', 1, '', 0, '', array(), (string) $object->entity, true, 'quatrevingtpercent widthcentpercentminusx');
239 print '</td></tr>';
240
241 print '<tr id="wsresources"><td>';
242 print $langs->trans('Machines');
243 print '</td>';
244 print '<td>';
245 print img_picto('', 'resource', 'class="pictofixedwidth"');
246 print $formresource->select_resource_list($resources, 'resources', '', 0, 0, 0, array(), '', 2, 0, 'quatrevingtpercent widthcentpercentminusx', true);
247 print '</td></tr>';
248
249 // Other attributes
250 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
251
252 print '</table>'."\n";
253
254 print dol_get_fiche_end();
255
256 print $form->buttonsSaveCancel("Create");
257
258 print '</form>';
259
260 //dol_set_focus('input[name="ref"]');
261}
262
263// Part to edit record
264if (($id || $ref) && $action == 'edit') {
265 print load_fiche_titre($langs->trans("Workstation"), '', 'object_'.$object->picto);
266
267 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
268 print '<input type="hidden" name="token" value="'.newToken().'">';
269 print '<input type="hidden" name="action" value="update">';
270 print '<input type="hidden" name="id" value="'.$object->id.'">';
271 if ($backtopage) {
272 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
273 }
274 if ($backtopageforcancel) {
275 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
276 }
277
278 print dol_get_fiche_head();
279
280 print '<table class="border centpercent tableforfieldedit">'."\n";
281
282 // Common attributes
283 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
284
285 print '<tr id="usergroups"';
286 print '><td>';
287 print $langs->trans('UserGroups');
288 print '</td>';
289 print '<td>';
290 print img_picto('', 'group', 'class="pictofixedwidth"');
291 print $form->select_dolgroups(empty($groups) ? $object->usergroups : $groups, 'groups', 1, '', 0, '', array(), (string) $object->entity, true, 'quatrevingtpercent widthcentpercentminusx');
292 print '</td></tr>';
293
294 print '<tr id="wsresources"><td>';
295 print $langs->trans('Machines');
296 print '</td>';
297 print '<td>';
298 print img_picto('', 'resource', 'class="pictofixedwidth"');
299 print $formresource->select_resource_list(empty($resources) ? $object->resources : $resources, 'resources', '', 0, 0, 0, array(), '', 2, 0, 'quatrevingtpercent widthcentpercentminusx', true);
300 print '</td></tr>';
301
302 // Other attributes
303 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
304
305 print '</table>';
306
307 print dol_get_fiche_end();
308
309 print $form->buttonsSaveCancel();
310
311 print '</form>';
312}
313
314// Part to show record
315if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
316 $head = workstationPrepareHead($object);
317
318 print dol_get_fiche_head($head, 'card', $langs->trans("Workstation"), -1, $object->picto);
319
320 $formconfirm = '';
321
322 // Confirmation to delete (using preloaded confirm popup)
323 if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) {
324 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteWorkstation'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 'action-delete');
325 }
326 $formquestion = array();
327 // Clone confirmation
328 if ($action == 'clone') {
329 // Create an array for form
330 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
331 }
332
333 // Confirmation of action xxxx
334 if ($action == 'enable') {
335 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('EnableAWorkstation'), $langs->trans("ConfirmEnableWorkstation", $object->ref), 'confirm_enable', $formquestion, 0, 1, 220);
336 } elseif ($action == 'disable') {
337 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DisableAWorkstation'), $langs->trans("ConfirmDisableWorkstation", $object->ref), 'confirm_disable', $formquestion, 0, 1, 220);
338 }
339
340 // Call Hook formConfirm
341 $parameters = array(
342 'formConfirm' => $formconfirm,
343 // 'lineid' => $lineid,
344 );
345 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
346 if (empty($reshook)) {
347 $formconfirm .= $hookmanager->resPrint;
348 } elseif ($reshook > 0) {
349 $formconfirm = $hookmanager->resPrint;
350 }
351
352 // Print form confirm
353 print $formconfirm;
354
355
356 // Object card
357 // ------------------------------------------------------------
358 $linkback = '<a href="'.dol_buildpath('/workstation/workstation_list.php', 1).'?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
359
360 $morehtmlref = '<div class="refidno">';
361 /*
362 // Ref customer
363 $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
364 $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
365 // Thirdparty
366 $morehtmlref .= '<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
367 // Project
368 if (isModEnabled('project')) {
369 $langs->load("projects");
370 $morehtmlref .= '<br>';
371 if ($permissiontoadd) {
372 $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
373 if ($action != 'classify') {
374 $morehtmlref .= '<a class="editfielda" href="'.dolBuildUrl($_SERVER['PHP_SELF'], ['action' => 'classify', 'id' => $object->id], true).'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
375 }
376 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
377 } else {
378 if (!empty($object->fk_project)) {
379 $proj = new Project($db);
380 $proj->fetch($object->fk_project);
381 $morehtmlref .= $proj->getNomUrl(1);
382 if ($proj->title) {
383 $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
384 }
385 }
386 }
387 }
388 }
389 */
390 $morehtmlref .= '</div>';
391
392
393 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
394
395
396 print '<div class="fichecenter">';
397 print '<div class="fichehalfleft">';
398 print '<div class="underbanner clearboth"></div>';
399 print '<table class="border centpercent tableforfield">'."\n";
400
401 // Common attributes
402 //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
403 //unset($object->fields['fk_project']); // Hide field already shown in banner
404 //unset($object->fields['fk_soc']); // Hide field already shown in banner
405 if ($object->type === 'MACHINE') {
406 $object->fields['nb_operators_required']['visible'] = 0;
407 }
408
409 // Common attributes
410 //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
411 //unset($object->fields['fk_project']); // Hide field already shown in banner
412 //unset($object->fields['fk_soc']); // Hide field already shown in banner
413 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
414
415 // Groups
416 if ($object->type !== 'MACHINE') {
417 $toprint = array();
418 $g = new UserGroup($db);
419 foreach ($object->usergroups as $id_group) {
420 $g->fetch($id_group);
421 $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $g->getNomUrl(1, '', 0, 'categtextwhite') . '</li>';
422 }
423
424 print '<tr><td>' . $langs->trans('Groups') . '</td><td>';
425 print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
426 print '</td></tr>';
427 }
428
429 // Resources
430 if ($object->type !== 'HUMAN') {
431 $toprint = array();
432 $r = new Dolresource($db);
433 foreach ($object->resources as $id_resource) {
434 $r->fetch($id_resource);
435 $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $r->getNomUrl(1, '', '', 0, 'categtextwhite') . '</li>';
436 }
437
438 print '<tr><td>' . $langs->trans('Machines') . '</td><td>';
439 print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
440 print '</td></tr>';
441 }
442
443 // Other attributes. Fields from hook formObjectOptions and Extrafields.
444 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
445
446 print '</table>';
447 print '</div>';
448 print '</div>';
449
450 print '<div class="clearboth"></div>';
451
452 print dol_get_fiche_end();
453
454
455 // Buttons for actions
456
457 if ($action != 'presend' && $action != 'editline') {
458 print '<div class="tabsAction">'."\n";
459 $parameters = array();
460 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
461 if ($reshook < 0) {
462 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
463 }
464
465 if (empty($reshook)) {
466 // Modify
467 print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
468
469 // Clone
470 if ($permissiontoadd) {
471 print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd);
472 }
473
474 // Disable / Enable
475 if ($permissiontoadd) {
476 if ($object->status == Workstation::STATUS_ENABLED) {
477 print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd);
478 } else {
479 print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd);
480 }
481 }
482
483 // Delete (with preloaded confirm popup)
484 $deleteUrl = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken();
485 $buttonId = 'action-delete-no-ajax';
486 if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can use preloaded confirm if not jmobile
487 $deleteUrl = '';
488 $buttonId = 'action-delete';
489 }
490 $params = array();
491 print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $deleteUrl, $buttonId, $permissiontodelete, $params);
492 }
493 print '</div>'."\n";
494 }
495}
496
497// End of page
498llxFooter();
499$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
DAO Resource object.
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 forms for the module resource.
Class to manage user groups.
Class for Workstation.
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)
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!function_exists( 'utf8_encode')) if(!function_exists('utf8_decode')) if(!function_exists( 'str_starts_with')) if(!function_exists('str_ends_with')) if(!function_exists( 'str_contains')) getMultidirOutput($object, $module='', $forobject=0, $mode='output')
Return the full path of the directory where a module (or an object of a module) stores its files.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.
workstationPrepareHead($object)
Prepare array of tabs for Workstation.