dolibarr 18.0.6
card.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
24// Load Dolibarr environment
25require '../../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
27require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
28require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
29require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
30require_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php';
31
32// Load translation files required by the page
33$langs->loadLangs(array("stocks", "other"));
34
35// Get parameters
36$id = GETPOST('id', 'int');
37$ref = GETPOST('ref', 'alpha');
38$action = GETPOST('action', 'aZ09');
39$confirm = GETPOST('confirm', 'alpha');
40$cancel = GETPOST('cancel', 'aZ09');
41$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'inventorycard'; // To manage different context of search
42$backtopage = GETPOST('backtopage', 'alpha');
43
44if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
45 $result = restrictedArea($user, 'stock', $id);
46} else {
47 $result = restrictedArea($user, 'stock', $id, '', 'inventory_advance');
48}
49
50// Initialize technical objects
51$object = new Inventory($db);
52$extrafields = new ExtraFields($db);
53// no inventory docs yet
54$includedocgeneration = false;
55$diroutputmassaction = null;
56// $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id;
57$hookmanager->initHooks(array('inventorycard', '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();
67foreach ($object->fields as $key => $val) {
68 if (GETPOST('search_'.$key, 'alpha')) {
69 $search[$key] = GETPOST('search_'.$key, 'alpha');
70 }
71}
72
73if (empty($action) && empty($id) && empty($ref)) {
74 $action = 'view';
75}
76
77// Load object
78include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
79
80// Security check - Protection if external user
81//if ($user->socid > 0) accessforbidden();
82//if ($user->socid > 0) $socid = $user->socid;
83//$result = restrictedArea($user, 'mymodule', $id);
84
85if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
86 $permissiontoread = $user->rights->stock->lire;
87 $permissiontoadd = $user->rights->stock->creer;
88 $permissiontodelete = $user->rights->stock->supprimer;
89 $permissionnote = $user->rights->stock->creer; // Used by the include of actions_setnotes.inc.php
90 $permissiondellink = $user->rights->stock->creer; // Used by the include of actions_dellink.inc.php
91 $upload_dir = $conf->stock->multidir_output[isset($object->entity) ? $object->entity : 1];
92} else {
93 $permissiontoread = $user->rights->stock->inventory_advance->read;
94 $permissiontoadd = $user->rights->stock->inventory_advance->write;
95 $permissiontodelete = $user->rights->stock->inventory_advance->delete;
96 $permissionnote = $user->rights->stock->inventory_advance->write; // Used by the include of actions_setnotes.inc.php
97 $permissiondellink = $user->rights->stock->inventory_advance->write; // Used by the include of actions_dellink.inc.php
98 $upload_dir = $conf->stock->multidir_output[isset($object->entity) ? $object->entity : 1];
99}
100
101
102/*
103 * Actions
104 */
105
106$parameters = array();
107$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
108if ($reshook < 0) {
109 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
110}
111
112if (empty($reshook)) {
113 $savaction = $action;
114 $error = 0;
115
116 $backurlforlist = DOL_URL_ROOT.'/product/inventory/list.php';
117
118 if (empty($backtopage) || ($cancel && empty($id))) {
119 if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
120 if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
121 $backtopage = $backurlforlist;
122 } else {
123 $backtopage = dol_buildpath('/product/inventory/card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
124 }
125 }
126 }
127 $triggermodname = 'STOCK_INVENTORY_MODIFY'; // Name of trigger action code to execute when we modify record
128
129 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
130 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
131
132 // Actions when linking object each other
133 include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
134
135 // Actions when printing a doc from card
136 include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
137
138 // Action to move up and down lines of object
139 //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
140
141 // Action to build doc
142 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
143
144 /*if ($action == 'set_thirdparty' && $permissiontoadd)
145 {
146 $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MYOBJECT_MODIFY');
147 }*/
148 if ($action == 'classin' && $permissiontoadd) {
149 $object->setProject(GETPOST('projectid', 'int'));
150 }
151
152 // Actions to send emails
153 $triggersendname = 'INVENTORY_SENTBYMAIL';
154 $autocopy = 'MAIN_MAIL_AUTOCOPY_INVENTORY_TO';
155 $trackid = 'stockinv'.$object->id;
156 include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
157
158 if (!$error && $savaction == 'confirm_validate' && $action == '' && $object->id > 0) {
159 // Switch to the tab inventory
160 header("Location: ".DOL_URL_ROOT.'/product/inventory/inventory.php?id='.$object->id);
161 exit;
162 }
163}
164
165
166
167
168/*
169 * View
170 */
171
172$form = new Form($db);
173$formfile = new FormFile($db);
174$formproject = new FormProjets($db);
175
176$title = $langs->trans("Inventory");
177
178$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks|DE:Modul_Bestände';
179
180llxHeader('', $title, $help_url);
181
182
183
184// Part to create
185if ($action == 'create') {
186 print load_fiche_titre($langs->trans("NewInventory"), '', 'product');
187
188 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
189 print '<input type="hidden" name="token" value="'.newToken().'">';
190 print '<input type="hidden" name="action" value="add">';
191 if ($backtopage) {
192 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
193 }
194 if (!empty($backtopageforcancel)) {
195 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
196 }
197
198 print dol_get_fiche_head(array(), '');
199
200 print '<table class="border centpercent tableforfieldcreate">'."\n";
201
202 // Common attributes
203 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
204
205 // Other attributes
206 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
207
208 //print '<tr><td class="titlefield fieldname_invcode">'.$langs->trans("InventoryCode").'</td><td>INV'.$object->id.'</td></tr>';
209
210 print '</table>'."\n";
211
212 print dol_get_fiche_end();
213
214 print $form->buttonsSaveCancel("Create");
215
216 print '</form>';
217
218 dol_set_focus('input[name="ref"]');
219}
220
221// Part to edit record
222if (($id || $ref) && $action == 'edit') {
223 print load_fiche_titre($langs->trans("Inventory"), '', 'product');
224
225 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
226 print '<input type="hidden" name="token" value="'.newToken().'">';
227 print '<input type="hidden" name="action" value="update">';
228 print '<input type="hidden" name="id" value="'.$object->id.'">';
229 if ($backtopage) {
230 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
231 }
232 if ($backtopageforcancel) {
233 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
234 }
235
236 print dol_get_fiche_head();
237
238 print '<table class="border centpercent tableforfieldedit">'."\n";
239
240 // Common attributes
241 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
242
243 // Other attributes
244 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
245
246 print '</table>';
247
248 print dol_get_fiche_end();
249
250 print $form->buttonsSaveCancel();
251
252 print '</form>';
253}
254
255// Part to show record
256if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
257 $res = $object->fetch_optionals();
258
259 $head = inventoryPrepareHead($object);
260 print dol_get_fiche_head($head, 'card', $langs->trans("Inventory"), -1, 'stock');
261
262 $formconfirm = '';
263
264 // Confirmation to delete
265 if ($action == 'delete') {
266 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
267 }
268
269 // Clone confirmation
270 if ($action == 'clone') {
271 // Create an array for form
272 $formquestion = array();
273 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
274 }
275
276 // Confirmation of action xxxx
277 if ($action == 'xxx') {
278 $formquestion = array();
279 /*
280 $forcecombo=0;
281 if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
282 $formquestion = array(
283 // 'text' => $langs->trans("ConfirmClone"),
284 // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
285 // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
286 // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
287 );
288 */
289 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
290 }
291
292 // Call Hook formConfirm
293 $parameters = array('formConfirm' => $formconfirm);
294 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
295 if (empty($reshook)) {
296 $formconfirm .= $hookmanager->resPrint;
297 } elseif ($reshook > 0) {
298 $formconfirm = $hookmanager->resPrint;
299 }
300
301 // Print form confirm
302 print $formconfirm;
303
304
305 // Object card
306 // ------------------------------------------------------------
307 $linkback = '<a href="'.DOL_URL_ROOT.'/product/inventory/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
308
309 $morehtmlref = '<div class="refidno">';
310 /*
311 // Ref bis
312 $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', 0, 1);
313 $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->inventory->creer, 'string', '', null, null, '', 1);
314 // Thirdparty
315 $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
316 // Project
317 if (isModEnabled('project'))
318 {
319 $langs->load("projects");
320 $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
321 if ($permissiontoadd)
322 {
323 if ($action != 'classify')
324 {
325 $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
326 if ($action == 'classify') {
327 //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 0, 1, '', 'maxwidth300');
328 $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
329 $morehtmlref .= '<input type="hidden" name="action" value="classin">';
330 $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
331 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
332 $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
333 $morehtmlref .= '</form>';
334 } else {
335 $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
336 }
337 }
338 } else {
339 if (!empty($object->fk_project)) {
340 $proj = new Project($db);
341 $proj->fetch($object->fk_project);
342 $morehtmlref .= $proj->getNomUrl();
343 } else {
344 $morehtmlref.='';
345 }
346 }
347 }
348 */
349 $morehtmlref .= '</div>';
350
351
352 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
353
354
355 print '<div class="fichecenter">';
356 print '<div class="fichehalfleft">';
357 print '<div class="underbanner clearboth"></div>';
358 print '<table class="border centpercent tableforfield">'."\n";
359
360 // Common attributes
361 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
362
363 // Other attributes. Fields from hook formObjectOptions and Extrafields.
364 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
365
366 print '</table>';
367 print '</div>';
368 print '</div>';
369
370 print '<div class="clearboth"></div>';
371
372 print dol_get_fiche_end();
373
374
375 // Buttons for actions
376 if ($action != 'presend' && $action != 'editline') {
377 print '<div class="tabsAction">'."\n";
378 $parameters = array();
379 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
380 if ($reshook < 0) {
381 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
382 }
383
384 if (empty($reshook)) {
385 // Send
386 if (empty($user->socid)) {
387 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
388 }
389
390 // Back to draft
391 if ($object->status == $object::STATUS_VALIDATED) {
392 if ($permissiontoadd) {
393 print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken().'">'.$langs->trans("SetToDraft").'</a>';
394 }
395 }
396 // Back to validate
397 if ($object->status == $object::STATUS_RECORDED) {
398 if ($permissiontoadd) {
399 print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken().'">'.$langs->trans("ReOpen").'</a>';
400 }
401 }
402
403 // Modify
404 if ($object->status == $object::STATUS_DRAFT) {
405 if ($permissiontoadd) {
406 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
407 } else {
408 print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
409 }
410 }
411
412 // Validate
413 if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_CANCELED) {
414 if ($permissiontoadd) {
415 print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken().'">'.$langs->trans("Validate").' ('.$langs->trans("ToStart").')</a>';
416 }
417 }
418
419 // Clone
420 if ($permissiontoadd) {
421 //print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=inventory', 'clone', $permissiontoadd);
422 }
423
424 // Delete
425 print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
426 }
427 print '</div>'."\n";
428 }
429
430
431 // Select mail models is same action as presend
432 if (GETPOST('modelselected')) {
433 $action = 'presend';
434 }
435
436 if ($action != 'presend') {
437 print '<div class="fichecenter"><div class="fichehalfleft">';
438 print '<a name="builddoc"></a>'; // ancre
439
440 // Documents
441 if ($includedocgeneration) {
442 $objref = dol_sanitizeFileName($object->ref);
443 $relativepath = $objref.'/'.$objref.'.pdf';
444 $filedir = $conf->mymodule->dir_output.'/'.$object->element.'/'.$objref;
445 $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
446 $genallowed = $user->rights->mymodule->myobject->read; // If you can read, you can build the PDF to read content
447 $delallowed = $user->rights->mymodule->myobject->write; // If you can create/edit, you can remove a file on card
448 print $formfile->showdocuments('mymodule:MyObject', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
449 }
450
451 // Show links to link elements
452 $linktoelem = $form->showLinkToObjectBlock($object, null, array('inventory'));
453 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
454
455
456 print '</div><div class="fichehalfright">';
457
458 $MAXEVENT = 10;
459
460 //$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/product/inventory/inventory_info.php?id='.$object->id);
461 $morehtmlcenter = '';
462
463 // List of actions on element
464 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
465 $formactions = new FormActions($db);
466 $somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlcenter);
467
468 print '</div></div>';
469 }
470
471
472 //Select mail models is same action as presend
473 if (GETPOST('modelselected')) {
474 $action = 'presend';
475 }
476
477 // Presend form
478 $modelmail = 'inventory';
479 $defaulttopic = 'InformationMessage';
480 $diroutput = $conf->product->dir_output.'/inventory';
481 $trackid = 'stockinv'.$object->id;
482
483 include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
484}
485
486// End of page
487llxFooter();
488$db->close();
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif( $action=='specimen') elseif($action=='setmodel') elseif( $action=='del') elseif($action=='setdoc') $formactions
View.
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
Class to manage standard extra fields.
Class to manage building of HTML components.
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 building of HTML components.
Class for Inventory.
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='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_set_focus($selector)
Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag)
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.
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
inventoryPrepareHead(&$inventory, $title='Inventory', $get='')
Define head array for tabs of inventory tools setup pages.
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.