dolibarr 19.0.4
card.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
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
26require '../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php';
28require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php';
29require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
30require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
31
32// Load translation files required by the page
33$langs->loadLangs(array("assets", "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') : 'assetcard'; // To manage different context of search
42$backtopage = GETPOST('backtopage', 'alpha');
43$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
44
45// Initialize technical objects
46$object = new Asset($db);
47$extrafields = new ExtraFields($db);
48$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id;
49$hookmanager->initHooks(array('assetcard', 'globalcard')); // Note that conf->hooks_modules contains array
50
51// Fetch optionals attributes and labels
52$extrafields->fetch_name_optionals_label($object->table_element);
53
54$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
55
56// Initialize array of search criterias
57$search_all = GETPOST("search_all", 'alpha');
58$search = array();
59foreach ($object->fields as $key => $val) {
60 if (GETPOST('search_'.$key, 'alpha')) {
61 $search[$key] = GETPOST('search_'.$key, 'alpha');
62 }
63}
64
65if (empty($action) && empty($id) && empty($ref)) {
66 $action = 'view';
67}
68
69// Load object
70include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
71
72$permissiontoread = $user->hasRight('asset', 'read');
73$permissiontoadd = $user->hasRight('asset', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
74$permissiontodelete = $user->hasRight('asset', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
75$permissionnote = $user->hasRight('asset', 'write'); // Used by the include of actions_setnotes.inc.php
76$permissiondellink = $user->hasRight('asset', 'write'); // Used by the include of actions_dellink.inc.php
77$upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1];
78
79// Security check (enable the most restrictive one)
80if ($user->socid > 0) {
82}
83if ($user->socid > 0) {
84 $socid = $user->socid;
85}
86$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
87restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
88if (!isModEnabled('asset')) {
90}
91if (!$permissiontoread) {
93}
94
95
96/*
97 * Actions
98 */
99
100$parameters = array();
101$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
102if ($reshook < 0) {
103 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
104}
105
106if (empty($reshook)) {
107 $error = 0;
108
109 $backurlforlist = DOL_URL_ROOT.'/asset/list.php';
110
111 if (empty($backtopage) || ($cancel && empty($id))) {
112 if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
113 if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
114 $backtopage = $backurlforlist;
115 } else {
116 $backtopage = DOL_URL_ROOT.'/asset/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
117 }
118 }
119 }
120
121 $object->oldcopy = dol_clone($object, 2);
122 $triggermodname = 'ASSET_MODIFY'; // Name of trigger action code to execute when we modify record
123
124 // Action dispose object
125 if ($action == 'confirm_disposal' && $confirm == 'yes' && $permissiontoadd) {
126 $object->disposal_date = dol_mktime(12, 0, 0, GETPOST('disposal_datemonth', 'int'), GETPOST('disposal_dateday', 'int'), GETPOST('disposal_dateyear', 'int')); // for date without hour, we use gmt
127 $object->disposal_amount_ht = GETPOST('disposal_amount', 'int');
128 $object->fk_disposal_type = GETPOST('fk_disposal_type', 'int');
129 $disposal_invoice_id = GETPOST('disposal_invoice_id', 'int');
130 $object->disposal_depreciated = ((GETPOST('disposal_depreciated') == '1' || GETPOST('disposal_depreciated') == 'on') ? 1 : 0);
131 $object->disposal_subject_to_vat = ((GETPOST('disposal_subject_to_vat') == '1' || GETPOST('disposal_subject_to_vat') == 'on') ? 1 : 0);
132
133 $result = $object->dispose($user, $disposal_invoice_id);
134 if ($result < 0) {
135 setEventMessages($object->error, $object->errors, 'errors');
136 }
137 $action = '';
138 } elseif ($action == "add") {
139 $object->supplier_invoice_id = GETPOST('supplier_invoice_id', 'int');
140 }
141
142 // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
143 include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
144
145 // Actions when linking object each other
146 include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
147
148 // Actions when printing a doc from card
149 include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
150
151 // Action to move up and down lines of object
152 //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
153
154 // Action to build doc
155 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
156
157 // Actions to send emails
158 $triggersendname = 'ASSET_SENTBYMAIL';
159 $autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
160 $trackid = 'asset'.$object->id;
161 include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
162}
163
164
165/*
166 * View
167 *
168 */
169
170$form = new Form($db);
171$formfile = new FormFile($db);
172
173$title = $langs->trans("Asset").' - '.$langs->trans("Card");
174$help_url = '';
175llxHeader('', $title, $help_url);
176
177// Part to create
178if ($action == 'create') {
179 print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Asset")), '', 'object_'.$object->picto);
180
181 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
182 print '<input type="hidden" name="token" value="'.newToken().'">';
183 print '<input type="hidden" name="action" value="add">';
184 if ($backtopage) {
185 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
186 }
187 if ($backtopageforcancel) {
188 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
189 }
190 if (GETPOSTISSET('supplier_invoice_id')) {
191 $object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => '1', 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',);
192 print '<input type="hidden" name="supplier_invoice_id" value="' . GETPOST('supplier_invoice_id', 'int') . '">';
193 }
194
195 print dol_get_fiche_head(array(), '');
196
197 // Set some default values
198 //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue';
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 '</table>'."\n";
209
210 print dol_get_fiche_end();
211
212 print $form->buttonsSaveCancel("Create");
213
214 print '</form>';
215
216 //dol_set_focus('input[name="ref"]');
217}
218
219// Part to edit record
220if (($id || $ref) && $action == 'edit') {
221 print load_fiche_titre($langs->trans("Asset"), '', 'object_'.$object->picto);
222
223 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
224 print '<input type="hidden" name="token" value="'.newToken().'">';
225 print '<input type="hidden" name="action" value="update">';
226 print '<input type="hidden" name="id" value="'.$object->id.'">';
227 if ($backtopage) {
228 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
229 }
230 if ($backtopageforcancel) {
231 print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
232 }
233
234 print dol_get_fiche_head();
235
236 print '<table class="border centpercent tableforfieldedit">'."\n";
237
238 // Common attributes
239 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
240
241 // Other attributes
242 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
243
244 print '</table>';
245
246 print dol_get_fiche_end();
247
248 print $form->buttonsSaveCancel();
249
250 print '</form>';
251}
252
253// Part to show record
254if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
255 $res = $object->fetch_optionals();
256
257 $head = assetPrepareHead($object);
258 print dol_get_fiche_head($head, 'card', $langs->trans("Asset"), -1, $object->picto);
259
260 $formconfirm = '';
261
262 // Confirmation to delete
263 if ($action == 'delete') {
264 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteAsset'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
265 } elseif ($action == 'disposal') {
266 // Disposal
267 $langs->load('bills');
268
269 $disposal_date = dol_mktime(12, 0, 0, GETPOST('disposal_datemonth', 'int'), GETPOST('disposal_dateday', 'int'), GETPOST('disposal_dateyear', 'int')); // for date without hour, we use gmt
270 $disposal_amount = GETPOST('disposal_amount', 'int');
271 $fk_disposal_type = GETPOST('fk_disposal_type', 'int');
272 $disposal_invoice_id = GETPOST('disposal_invoice_id', 'int');
273 $disposal_depreciated = GETPOSTISSET('disposal_depreciated') ? GETPOST('disposal_depreciated') : 1;
274 $disposal_depreciated = !empty($disposal_depreciated) ? 1 : 0;
275 $disposal_subject_to_vat = GETPOSTISSET('disposal_subject_to_vat') ? GETPOST('disposal_subject_to_vat') : 1;
276 $disposal_subject_to_vat = !empty($disposal_subject_to_vat) ? 1 : 0;
277
278 $object->fields['fk_disposal_type']['visible'] = 1;
279 $disposal_type_form = $object->showInputField(null, 'fk_disposal_type', $fk_disposal_type, '', '', '', 0);
280 $object->fields['fk_disposal_type']['visible'] = -2;
281
282 $disposal_invoice_form = $form->selectForForms('Facture:compta/facture/class/facture.class.php::(entity:IN:__SHARED_ENTITIES__)', 'disposal_invoice_id', $disposal_invoice_id);
283
284 // Create an array for form
285 $formquestion = array(
286 array('type' => 'date', 'name' => 'disposal_date', 'tdclass' => 'fieldrequired', 'label' => $langs->trans("AssetDisposalDate"), 'value' => $disposal_date),
287 array('type' => 'text', 'name' => 'disposal_amount', 'tdclass' => 'fieldrequired', 'label' => $langs->trans("AssetDisposalAmount"), 'value' => $disposal_amount),
288 array('type' => 'other', 'name' => 'fk_disposal_type', 'tdclass' => 'fieldrequired', 'label' => $langs->trans("AssetDisposalType"), 'value' => $disposal_type_form),
289 array('type' => 'other', 'name' => 'disposal_invoice_id', 'label' => $langs->trans("InvoiceCustomer"), 'value' => $disposal_invoice_form),
290 array('type' => 'checkbox', 'name' => 'disposal_depreciated', 'label' => $langs->trans("AssetDisposalDepreciated"), 'value' => $disposal_depreciated),
291 array('type' => 'checkbox', 'name' => 'disposal_subject_to_vat', 'label' => $langs->trans("AssetDisposalSubjectToVat"), 'value' => $disposal_subject_to_vat),
292 );
293 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref . ' - ' . $object->label), 'confirm_disposal', $formquestion, 'yes', 1);
294 } elseif ($action == 'reopen') {
295 // Re-open
296 // Create an array for form
297 $formquestion = array();
298 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('AssetConfirmReOpenAsk', $object->ref), 'confirm_reopen', $formquestion, 'yes', 1);
299 }
300 // Clone confirmation
301 /* elseif ($action == 'clone') {
302 // Create an array for form
303 $formquestion = array();
304 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
305 }*/
306
307 // Call Hook formConfirm
308 $parameters = array('formConfirm' => $formconfirm);
309 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
310 if (empty($reshook)) {
311 $formconfirm .= $hookmanager->resPrint;
312 } elseif ($reshook > 0) {
313 $formconfirm = $hookmanager->resPrint;
314 }
315
316 // Print form confirm
317 print $formconfirm;
318
319
320 // Object card
321 // ------------------------------------------------------------
322 $linkback = '<a href="'.DOL_URL_ROOT.'/asset/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
323
324 $morehtmlref = '<div class="refidno">';
325 $morehtmlref .= '</div>';
326
327
328 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
329
330
331 print '<div class="fichecenter">';
332 print '<div class="fichehalfleft">';
333 print '<div class="underbanner clearboth"></div>';
334 print '<table class="border centpercent tableforfield">'."\n";
335
336 // Common attributes
337 $keyforbreak='date_acquisition'; // We change column just before this field
338 //unset($object->fields['fk_project']); // Hide field already shown in banner
339 //unset($object->fields['fk_soc']); // Hide field already shown in banner
340 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
341
342 // Other attributes. Fields from hook formObjectOptions and Extrafields.
343 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
344
345 print '</table>';
346 print '</div>';
347 print '</div>';
348
349 print '<div class="clearboth"></div>';
350
351 print dol_get_fiche_end();
352
353 // Buttons for actions
354 if ($action != 'presend' && $action != 'editline') {
355 print '<div class="tabsAction">' . "\n";
356 $parameters = array();
357 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
358 if ($reshook < 0) {
359 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
360 }
361
362 if (empty($reshook)) {
363 // Send
364 if (empty($user->socid)) {
365 print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle');
366 }
367
368 if ($object->status == $object::STATUS_DRAFT) {
369 print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
370 }
371
372 // Clone
373 //print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', false && $permissiontoadd);
374
375 if ($object->status == $object::STATUS_DRAFT) {
376 print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disposal&token=' . newToken(), '', $permissiontoadd);
377 } else {
378 print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen&token=' . newToken(), '', $permissiontoadd);
379 }
380
381 // Delete (need delete permission, or if draft, just need create/modify permission)
382 print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
383 }
384 print '</div>' . "\n";
385 }
386
387 // Select mail models is same action as presend
388 if (GETPOST('modelselected')) {
389 $action = 'presend';
390 }
391
392 if ($action != 'presend') {
393 print '<div class="fichecenter"><div class="fichehalfleft">';
394 print '<a name="builddoc"></a>'; // ancre
395
396 $includedocgeneration = 0;
397
398 // Documents
399 if ($includedocgeneration) {
400 $objref = dol_sanitizeFileName($object->ref);
401 $relativepath = $objref.'/'.$objref.'.pdf';
402 $filedir = $conf->asset->dir_output.'/'.$objref;
403 $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
404 $genallowed = $user->hasRight('asset', 'read'); // If you can read, you can build the PDF to read content
405 $delallowed = $user->hasRight('asset', 'write'); // If you can create/edit, you can remove a file on card
406 print $formfile->showdocuments('asset:Asset', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
407 }
408
409 // Show links to link elements
410 $linktoelem = $form->showLinkToObjectBlock($object, null, array('asset'));
411 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
412
413
414 print '</div><div class="fichehalfright">';
415
416 $morehtmlcenter = '';
417 $MAXEVENT = 10;
418
419 $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/asset/agenda.php?id='.$object->id);
420
421 // List of actions on element
422 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
423 $formactions = new FormActions($db);
424 $somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlcenter);
425
426 print '</div></div>';
427 }
428
429 //Select mail models is same action as presend
430 if (GETPOST('modelselected')) {
431 $action = 'presend';
432 }
433
434 // Presend form
435 $modelmail = 'asset';
436 $defaulttopic = 'InformationMessage';
437 $diroutput = $conf->asset->dir_output;
438 $trackid = 'asset'.$object->id;
439
440 include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
441}
442
443// End of page
444llxFooter();
445$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.
assetPrepareHead(Asset $object)
Prepare array of tabs for Asset.
Definition asset.lib.php:87
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
Class for Asset.
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.
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.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
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.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
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_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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.