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