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