dolibarr 23.0.4
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');
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 if ($action == 'update' && $permissiontoadd) {
134 // The edit form gives the user groups and the resources to save (an empty selection posts nothing and means none)
135 $object->usergroups = is_array($groups) ? array_map('intval', $groups) : array();
136 $object->resources = is_array($resources) ? array_map('intval', $resources) : array();
137 }
138
139 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
140 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
141
142 // Actions when linking object each other
143 include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
144
145 // Actions when printing a doc from card
146 include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
147
148 // Action to move up and down lines of object
149 //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
150
151 // Action to build doc
152 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
153
154 if ($action == 'confirm_enable' && $confirm == "yes" && $permissiontoadd) {
155 if (!empty($object->id)) {
156 $object->setStatus(1);
157 }
158 } elseif ($action == 'confirm_disable' && $confirm == "yes" && $permissiontoadd) {
159 if (!empty($object->id)) {
160 $object->setStatus(0);
161 }
162 }
163}
164
165
166
167/*
168 * View
169 */
170
171$form = new Form($db);
172$formfile = new FormFile($db);
173$formresource = new FormResource($db);
174
175$title = $langs->trans("Workstation")." - ".$langs->trans('Card');
176if ($action == 'create') {
177 $title = $langs->trans("NewObject", $langs->transnoentitiesnoconv("Workstation"));
178}
179$help_url = 'EN:Module_Workstation';
180
181llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-workstation page-workstation_card');
182
183// jquery code
184?>
185 <script>
186
187 jQuery(document).ready(function() {
188 jQuery("#type").change(function() {
189 if($(this).val() === 'MACHINE') {
190 $('#usergroups').hide();
191 $('#nb_operators_required').parent('td').parent('tr').hide();
192 $('#wsresources').show();
193 } else if($(this).val() === 'HUMAN') {
194 $('#wsresources').hide();
195 $('#nb_operators_required').parent('td').parent('tr').show();
196 $('#usergroups').show();
197 }
198 else {
199 $('#usergroups').show();
200 $('#wsresources').show();
201 $('#nb_operators_required').parent('td').parent('tr').show();
202 }
203 });
204 jQuery("#type").trigger('change');
205 });
206
207 </script>
208<?php
209
210// Part to create
211if ($action == 'create') {
212 if (empty($permissiontoadd)) {
213 accessforbidden('NotEnoughPermissions', 0, 1);
214 }
215
216 // Set default value of the property ref
217 $object->fields['ref']['default'] = $object->getNextNumRef();
218
219 print load_fiche_titre($title, '', 'object_'.$object->picto);
220
221 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
222 print '<input type="hidden" name="token" value="'.newToken().'">';
223 print '<input type="hidden" name="action" value="add">';
224 if ($backtopage) {
225 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
226 }
227 if ($backtopageforcancel) {
228 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
229 }
230
231 print dol_get_fiche_head(array(), '');
232
233 print '<table class="border centpercent tableforfieldcreate">'."\n";
234
235 // Common attributes
236 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
237
238 print '<tr id="usergroups">';
239 print '<td>';
240 print $langs->trans('UserGroups');
241 print '</td>';
242 print '<td>';
243 print img_picto('', 'group', 'class="pictofixedwidth"');
244 print $form->select_dolgroups($groups, 'groups', 1, '', 0, '', array(), (string) $object->entity, true, 'quatrevingtpercent widthcentpercentminusx');
245 print '</td></tr>';
246
247 print '<tr id="wsresources"><td>';
248 print $langs->trans('Machines');
249 print '</td>';
250 print '<td>';
251 print img_picto('', 'resource', 'class="pictofixedwidth"');
252 print $formresource->select_resource_list($resources, 'resources', '', 0, 0, 0, array(), '', 2, 0, 'quatrevingtpercent widthcentpercentminusx', true);
253 print '</td></tr>';
254
255 // Other attributes
256 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
257
258 print '</table>'."\n";
259
260 print dol_get_fiche_end();
261
262 print $form->buttonsSaveCancel("Create");
263
264 print '</form>';
265
266 //dol_set_focus('input[name="ref"]');
267}
268
269// Part to edit record
270if (($id || $ref) && $action == 'edit') {
271 print load_fiche_titre($langs->trans("Workstation"), '', 'object_'.$object->picto);
272
273 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
274 print '<input type="hidden" name="token" value="'.newToken().'">';
275 print '<input type="hidden" name="action" value="update">';
276 print '<input type="hidden" name="id" value="'.$object->id.'">';
277 if ($backtopage) {
278 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
279 }
280 if ($backtopageforcancel) {
281 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
282 }
283
284 print dol_get_fiche_head();
285
286 print '<table class="border centpercent tableforfieldedit">'."\n";
287
288 // Common attributes
289 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
290
291 print '<tr id="usergroups"';
292 print '><td>';
293 print $langs->trans('UserGroups');
294 print '</td>';
295 print '<td>';
296 print img_picto('', 'group', 'class="pictofixedwidth"');
297 print $form->select_dolgroups(empty($groups) ? $object->usergroups : $groups, 'groups', 1, '', 0, '', array(), (string) $object->entity, true, 'quatrevingtpercent widthcentpercentminusx');
298 print '</td></tr>';
299
300 print '<tr id="wsresources"><td>';
301 print $langs->trans('Machines');
302 print '</td>';
303 print '<td>';
304 print img_picto('', 'resource', 'class="pictofixedwidth"');
305 print $formresource->select_resource_list(empty($resources) ? $object->resources : $resources, 'resources', '', 0, 0, 0, array(), '', 2, 0, 'quatrevingtpercent widthcentpercentminusx', true);
306 print '</td></tr>';
307
308 // Other attributes
309 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
310
311 print '</table>';
312
313 print dol_get_fiche_end();
314
315 print $form->buttonsSaveCancel();
316
317 print '</form>';
318}
319
320// Part to show record
321if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
322 $head = workstationPrepareHead($object);
323
324 print dol_get_fiche_head($head, 'card', $langs->trans("Workstation"), -1, $object->picto);
325
326 $formconfirm = '';
327
328 // Confirmation to delete (using preloaded confirm popup)
329 if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) {
330 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteWorkstation'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 'action-delete');
331 }
332 $formquestion = array();
333 // Clone confirmation
334 if ($action == 'clone') {
335 // Create an array for form
336 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
337 }
338
339 // Confirmation of action xxxx
340 if ($action == 'enable') {
341 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('EnableAWorkstation'), $langs->trans("ConfirmEnableWorkstation", $object->ref), 'confirm_enable', $formquestion, 0, 1, 220);
342 } elseif ($action == 'disable') {
343 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DisableAWorkstation'), $langs->trans("ConfirmDisableWorkstation", $object->ref), 'confirm_disable', $formquestion, 0, 1, 220);
344 }
345
346 // Call Hook formConfirm
347 $parameters = array(
348 'formConfirm' => $formconfirm,
349 // 'lineid' => $lineid,
350 );
351 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
352 if (empty($reshook)) {
353 $formconfirm .= $hookmanager->resPrint;
354 } elseif ($reshook > 0) {
355 $formconfirm = $hookmanager->resPrint;
356 }
357
358 // Print form confirm
359 print $formconfirm;
360
361
362 // Object card
363 // ------------------------------------------------------------
364 $linkback = '<a href="'.dol_buildpath('/workstation/workstation_list.php', 1).'?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
365
366 $morehtmlref = '<div class="refidno">';
367 /*
368 // Ref customer
369 $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
370 $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
371 // Thirdparty
372 $morehtmlref .= '<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
373 // Project
374 if (isModEnabled('project')) {
375 $langs->load("projects");
376 $morehtmlref .= '<br>';
377 if ($permissiontoadd) {
378 $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
379 if ($action != 'classify') {
380 $morehtmlref .= '<a class="editfielda" href="'.dolBuildUrl($_SERVER['PHP_SELF'], ['action' => 'classify', 'id' => $object->id], true).'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
381 }
382 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
383 } else {
384 if (!empty($object->fk_project)) {
385 $proj = new Project($db);
386 $proj->fetch($object->fk_project);
387 $morehtmlref .= $proj->getNomUrl(1);
388 if ($proj->title) {
389 $morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
390 }
391 }
392 }
393 }
394 }
395 */
396 $morehtmlref .= '</div>';
397
398
399 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
400
401
402 print '<div class="fichecenter">';
403 print '<div class="fichehalfleft">';
404 print '<div class="underbanner clearboth"></div>';
405 print '<table class="border centpercent tableforfield">'."\n";
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 if ($object->type === 'MACHINE') {
412 $object->fields['nb_operators_required']['visible'] = 0;
413 }
414
415 // Common attributes
416 //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
417 //unset($object->fields['fk_project']); // Hide field already shown in banner
418 //unset($object->fields['fk_soc']); // Hide field already shown in banner
419 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
420
421 // Groups
422 if ($object->type !== 'MACHINE') {
423 $toprint = array();
424 $g = new UserGroup($db);
425 foreach ($object->usergroups as $id_group) {
426 $g->fetch($id_group);
427 $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $g->getNomUrl(1, '', 0, 'categtextwhite') . '</li>';
428 }
429
430 print '<tr><td>' . $langs->trans('Groups') . '</td><td>';
431 print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
432 print '</td></tr>';
433 }
434
435 // Resources
436 if ($object->type !== 'HUMAN') {
437 $toprint = array();
438 $r = new Dolresource($db);
439 foreach ($object->resources as $id_resource) {
440 $r->fetch($id_resource);
441 $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">' . $r->getNomUrl(1, '', '', 0, 'categtextwhite') . '</li>';
442 }
443
444 print '<tr><td>' . $langs->trans('Machines') . '</td><td>';
445 print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
446 print '</td></tr>';
447 }
448
449 // Other attributes. Fields from hook formObjectOptions and Extrafields.
450 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
451
452 print '</table>';
453 print '</div>';
454 print '</div>';
455
456 print '<div class="clearboth"></div>';
457
458 print dol_get_fiche_end();
459
460
461 // Buttons for actions
462
463 if ($action != 'presend' && $action != 'editline') {
464 print '<div class="tabsAction">'."\n";
465 $parameters = array();
466 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
467 if ($reshook < 0) {
468 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
469 }
470
471 if (empty($reshook)) {
472 // Modify
473 print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
474
475 // Clone
476 if ($permissiontoadd) {
477 print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken(), '', $permissiontoadd);
478 }
479
480 // Disable / Enable
481 if ($permissiontoadd) {
482 if ($object->status == Workstation::STATUS_ENABLED) {
483 print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd);
484 } else {
485 print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd);
486 }
487 }
488
489 // Delete (with preloaded confirm popup)
490 $deleteUrl = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken();
491 $buttonId = 'action-delete-no-ajax';
492 if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can use preloaded confirm if not jmobile
493 $deleteUrl = '';
494 $buttonId = 'action-delete';
495 }
496 $params = array();
497 print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $deleteUrl, $buttonId, $permissiontodelete, $params);
498 }
499 print '</div>'."\n";
500 }
501}
502
503// End of page
504llxFooter();
505$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.