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