dolibarr 21.0.0-beta
dir_card.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.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
19
26// Load Dolibarr environment
27require '../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
29require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
33require_once DOL_DOCUMENT_ROOT.'/ecm/class/htmlecm.form.class.php';
34
43// Load translation files required by page
44$langs->loadLangs(array('ecm', 'companies', 'other'));
45
46$action = GETPOST('action', 'alpha');
47$cancel = GETPOST('cancel', 'aZ09');
48$backtopage = GETPOST('backtopage', 'alpha');
49$confirm = GETPOST('confirm', 'alpha');
50
51$module = GETPOST('module', 'alpha');
52$website = GETPOST('website', 'alpha');
53$pageid = GETPOSTINT('pageid');
54if (empty($module)) {
55 $module = 'ecm';
56}
57
58// Get parameters
59$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
60$sortfield = GETPOST('sortfield', 'aZ09comma');
61$sortorder = GETPOST('sortorder', 'aZ09comma');
62$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
63if (empty($page) || $page == -1) {
64 $page = 0;
65} // If $page is not defined, or '' or -1
66$offset = $limit * $page;
67$pageprev = $page - 1;
68$pagenext = $page + 1;
69if (!$sortorder) {
70 $sortorder = "ASC";
71}
72if (!$sortfield) {
73 $sortfield = "name";
74}
75
76$section = GETPOST("section", 'alpha') ? GETPOST("section", 'alpha') : GETPOST("relativedir", 'alpha');
77if (!$section) {
78 dol_print_error(null, "ErrorSectionParamNotDefined");
79 exit;
80}
81
82// Load ecm object
83$ecmdir = new EcmDirectory($db);
84
85if ($module == 'ecm') {
86 // $section should be an int except if it is dir not yet created into EcmDirectory
87 $result = $ecmdir->fetch($section);
88 if ($result > 0) {
89 $relativepath = $ecmdir->getRelativePath();
90 $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
91 } else {
92 $relativepath = $section;
93 $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
94 }
95} else { // For example $module == 'medias'
96 $relativepath = $section;
97 $upload_dir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath;
98}
99
100// Permissions
101$permissiontoread = 0;
102$permissiontoadd = 0;
103$permissiontoupload = 0;
104if ($module == 'ecm') {
105 $permissiontoread = $user->hasRight("ecm", "read");
106 $permissiontoadd = $user->hasRight("ecm", "setup");
107 $permissiontoupload = $user->hasRight("ecm", "upload");
108}
109if ($module == 'medias') {
110 $permissiontoread = ($user->hasRight("mailing", "lire") || $user->hasRight("website", "read"));
111 $permissiontoadd = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
112 $permissiontoupload = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
113}
114
115if (!$permissiontoread) {
117}
118
119
120/*
121 * Actions
122 */
123
124// Upload file
125if (GETPOST("sendit") && getDolGlobalString('MAIN_UPLOAD_DOC') && $permissiontoupload) {
126 if (dol_mkdir($upload_dir) >= 0) {
127 $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir."/".dol_unescapefile($_FILES['userfile']['name']), 0, 0, $_FILES['userfile']['error']);
128 if (is_numeric($resupload) && $resupload > 0) {
129 $result = $ecmdir->changeNbOfFiles('+');
130 } else {
131 $langs->load("errors");
132 if ($resupload < 0) { // Unknown error
133 setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
134 } elseif (preg_match('/ErrorFileIsInfectedWithAVirus/', $resupload)) {
135 // Files infected by a virus
136 setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
137 } else { // Known error
138 setEventMessages($langs->trans($resupload), null, 'errors');
139 }
140 }
141 } else {
142 // Failed transfer (exceeding the limit file?)
143 $langs->load("errors");
144 setEventMessages($langs->trans("ErrorFailToCreateDir", $upload_dir), null, 'errors');
145 }
146}
147
148// Remove file
149if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permissiontoupload) {
150 $langs->load("other");
151 $file = $upload_dir."/".GETPOST('urlfile'); // Do not use urldecode here
152 $ret = dol_delete_file($file);
153 if ($ret) {
154 setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
155 } else {
156 setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
157 }
158
159 $result = $ecmdir->changeNbOfFiles('-');
160}
161
162// Remove dir
163if ($action == 'confirm_deletedir' && $confirm == 'yes' && $permissiontoupload) {
164 $backtourl = DOL_URL_ROOT."/ecm/index.php";
165 if ($module == 'medias') {
166 $backtourl = DOL_URL_ROOT."/website/index.php?file_manager=1";
167 }
168
169 $deletedirrecursive = (GETPOST('deletedirrecursive', 'alpha') == 'on' ? 1 : 0);
170
171 if ($module == 'ecm' && $ecmdir->id > 0) { // If manual ECM and directory is indexed into database
172 // Fetch was already done
173 $result = $ecmdir->delete($user, 'all', $deletedirrecursive);
174 if ($result <= 0) {
175 $langs->load('errors');
176 setEventMessages($langs->trans($ecmdir->error, $ecmdir->label), null, 'errors');
177 }
178 } else {
179 if ($deletedirrecursive) {
180 $resbool = dol_delete_dir_recursive($upload_dir, 0, 1);
181 } else {
182 $resbool = dol_delete_dir($upload_dir, 1);
183 }
184 if ($resbool) {
185 $result = 1;
186 } else {
187 $langs->load('errors');
188 setEventMessages($langs->trans("ErrorFailToDeleteDir", $upload_dir), null, 'errors');
189 $result = 0;
190 }
191 }
192 if ($result > 0) {
193 header("Location: ".$backtourl);
194 exit;
195 }
196}
197
198// Update dirname or description
199if ($action == 'update' && !GETPOST('cancel', 'alpha') && $permissiontoadd) {
200 $error = 0;
201
202 if ($module == 'ecm') {
203 $oldlabel = $ecmdir->label;
204 $olddir = $ecmdir->getRelativePath(0);
205 $olddir = $conf->ecm->dir_output.'/'.$olddir;
206 } else {
207 $olddir = GETPOST('section', 'alpha');
208 $olddir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath;
209 }
210
211 if ($module == 'ecm') {
212 $db->begin();
213
214 // Fetch was already done
215 $ecmdir->label = dol_sanitizeFileName(GETPOST("label"));
216 $fk_parent = GETPOSTINT("catParent");
217 if ($fk_parent == -1) {
218 $ecmdir->fk_parent = 0;
219 } else {
220 $ecmdir->fk_parent = $fk_parent;
221 }
222 $ecmdir->description = GETPOST("description");
223 $ret = $extrafields->setOptionalsFromPost(null, $ecmdir);
224 if ($ret < 0) {
225 $error++;
226 }
227 if (!$error) {
228 // Actions on extra fields
229 $result = $ecmdir->insertExtraFields();
230 if ($result < 0) {
231 setEventMessages($ecmdir->error, $ecmdir->errors, 'errors');
232 $error++;
233 }
234 }
235 $result = $ecmdir->update($user);
236 if ($result > 0) {
237 $newdir = $ecmdir->getRelativePath(1);
238 $newdir = $conf->ecm->dir_output.'/'.$newdir;
239 // Try to rename file if changed
240 if (($oldlabel != $ecmdir->label && file_exists($olddir)) || ($olddir != $newdir && file_exists($olddir))) {
241 $newdir = $ecmdir->getRelativePath(1); // return "xxx/zzz/" from ecm directory
242 $newdir = $conf->ecm->dir_output.'/'.$newdir;
243 //print $olddir.'-'.$newdir;
244 $result = @rename($olddir, $newdir);
245 if (!$result) {
246 $langs->load('errors');
247 setEventMessages($langs->trans('ErrorFailToRenameDir', $olddir, $newdir), null, 'errors');
248 $error++;
249 }
250 }
251
252 if (!$error) {
253 $db->commit();
254
255 // Set new value after renaming
256 $relativepath = $ecmdir->getRelativePath();
257 $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
258 } else {
259 $db->rollback();
260 }
261 } else {
262 $db->rollback();
263 setEventMessages($ecmdir->error, $ecmdir->errors, 'errors');
264 }
265 } else {
266 $newdir = $conf->medias->multidir_output[$conf->entity].'/'.GETPOST('oldrelparentdir', 'alpha').'/'.GETPOST('label', 'alpha');
267
268 $result = @rename($olddir, $newdir);
269 if (!$result) {
270 $langs->load('errors');
271 setEventMessages($langs->trans('ErrorFailToRenameDir', $olddir, $newdir), null, 'errors');
272 $error++;
273 }
274
275 if (!$error) {
276 // Set new value after renaming
277 $relativepath = GETPOST('oldrelparentdir', 'alpha').'/'.GETPOST('label', 'alpha');
278 $upload_dir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath;
279 $section = $relativepath;
280 }
281 }
282}
283
284
285/*
286 * View
287 */
288
289$form = new Form($db);
290$formecm = new FormEcm($db);
291
292$object = new EcmDirectory($db); // Need to create a new one instance
293$extrafields = new ExtraFields($db);
294// fetch optionals attributes and labels
295$extrafields->fetch_name_optionals_label($object->table_element);
296
297if ($module == 'ecm' && $ecmdir->id > 0) {
298 $object->fetch($ecmdir->id);
299}
300
301llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-ecm page-dir_card');
302
303// Built the file List
304$filearrayall = dol_dir_list($upload_dir, "all", 0, '', '', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
305$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
306$totalsize = 0;
307foreach ($filearray as $key => $file) {
308 $totalsize += $file['size'];
309}
310
311
312$head = ecm_prepare_head($ecmdir, $module, $section);
313print dol_get_fiche_head($head, 'card', $langs->trans("ECMSectionManual"), -1, 'dir');
314
315
316if ($action == 'edit') {
317 print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
318 print '<input type="hidden" name="token" value="'.newToken().'">';
319 print '<input type="hidden" name="section" value="'.$section.'">';
320 print '<input type="hidden" name="module" value="'.$module.'">';
321 print '<input type="hidden" name="action" value="update">';
322}
323
324
325$morehtml = '';
326
327$morehtmlref = '/'.$module.'/'.$relativepath;
328
329if ($module == 'ecm') {
330 $s = '';
331 $result = 1;
332 $i = 0;
333 $tmpecmdir = new EcmDirectory($db); // Need to create a new one
334 if ($ecmdir->id > 0) {
335 $tmpecmdir->fetch($ecmdir->id);
336 while ($tmpecmdir && $result > 0) {
337 $tmpecmdir->ref = $tmpecmdir->label;
338 $s = $tmpecmdir->getNomUrl(1).$s;
339 if ($tmpecmdir->fk_parent) {
340 $s = ' -> '.$s;
341 $result = $tmpecmdir->fetch($tmpecmdir->fk_parent);
342 } else {
343 $tmpecmdir = 0;
344 }
345 $i++;
346 }
347 } else {
348 $s .= implode(' -> ', explode('/', $section));
349 }
350 $morehtmlref = '<a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> '.$s;
351}
352if ($module == 'medias') {
353 $s = 'medias -> ';
354 $result = 1;
355 $subdirs = explode('/', $section);
356 $i = 0;
357 foreach ($subdirs as $subdir) {
358 if ($i == (count($subdirs) - 1)) {
359 if ($action == 'edit') {
360 $s .= '<input type="text" name="label" class="minwidth300" maxlength="32" value="'.$subdir.'">';
361 $s .= '<input type="hidden" name="oldrelparentdir" value="'.dirname($section).'">';
362 $s .= '<input type="hidden" name="oldreldir" value="'.basename($section).'">';
363 } else {
364 $s .= $subdir;
365 }
366 }
367 if ($i < (count($subdirs) - 1)) {
368 $s .= $subdir.' -> ';
369 }
370 $i++;
371 }
372
373 $morehtmlref = $s;
374}
375
376
377dol_banner_tab($object, '', $morehtml, 0, '', '', $morehtmlref);
378
379print '<div class="fichecenter">';
380
381print '<div class="underbanner clearboth"></div>';
382print '<table class="border centpercent tableforfield">';
383/*print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
384print img_picto('','object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> ';
385print $s;
386print '</td></tr>';*/
387if ($module == 'ecm') {
388 if ($action == 'edit') {
389 print '<tr><td class="titlefield tdtop">'.$langs->trans("ECMDirName").'</td><td>';
390 print '<input type="text" name="label" class="minwidth300" maxlength="32" value="'.$ecmdir->label.'">';
391 print '</td></tr>';
392 print '<tr><td class="titlefield tdtop">'.$langs->trans("ECMParentDirectory").'</td><td>';
393 print $formecm->selectAllSections($ecmdir->fk_parent, '', 'ecm', array($ecmdir->id));
394 print '</td><td>';
395 print '</td></tr>';
396 }
397
398 print '<tr><td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
399 if ($action == 'edit') {
400 print '<textarea class="flat quatrevingtpercent" name="description">';
401 print $ecmdir->description;
402 print '</textarea>';
403 } else {
404 print dol_nl2br($ecmdir->description);
405 }
406 print '</td></tr>';
407
408 print '<tr><td class="titlefield">'.$langs->trans("ECMCreationUser").'</td><td>';
409 if ($ecmdir->fk_user_c > 0) {
410 $userecm = new User($db);
411 $userecm->fetch($ecmdir->fk_user_c);
412 print $userecm->getNomUrl(1);
413 }
414 print '</td></tr>';
415}
416print '<tr><td class="titlefield">'.$langs->trans("ECMCreationDate").'</td><td>';
417if ($module == 'ecm') {
418 print dol_print_date($ecmdir->date_c, 'dayhour');
419} else {
420 //var_dump($upload_dir);
421 print dol_print_date(dol_filemtime($upload_dir), 'dayhour');
422}
423print '</td></tr>';
424print '<tr><td>'.$langs->trans("ECMDirectoryForFiles").'</td><td>';
425if ($module == 'ecm') {
426 print '/ecm/'.$relativepath;
427} else {
428 print '/'.$module.'/'.$relativepath;
429}
430print '</td></tr>';
431print '<tr><td>'.$langs->trans("ECMNbOfDocs").'</td><td>';
432$nbofiles = count($filearray);
433print $nbofiles;
434if ($ecmdir->id > 0) {
435 // Test if nb is same than in cache
436 if ($nbofiles != $ecmdir->cachenbofdoc) {
437 $ecmdir->changeNbOfFiles((string) $nbofiles);
438 }
439}
440print '</td></tr>';
441print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>';
442print dol_print_size($totalsize);
443print '</td></tr>';
444print $object->showOptionals($extrafields, ($action == 'edit' ? 'edit' : 'view'));
445print '</table>';
446
447if ($action == 'edit') {
448 print $form->buttonsSaveCancel();
449}
450
451print '</div>';
452if ($action == 'edit') {
453 print '</form>';
454}
455
456print dol_get_fiche_end();
457
458
459
460// Actions buttons
461if ($action != 'edit' && $action != 'delete' && $action != 'deletefile') {
462 print '<div class="tabsAction">';
463
464 if ($permissiontoadd) {
465 print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().($module ? '&module='.$module : '').'&section='.$section.'">'.$langs->trans('Edit').'</a>';
466 }
467
468 if ($permissiontoadd) {
469 print '<a class="butAction" href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&token='.newToken().($module ? '&module='.$module : '').'&catParent='.$section.'">'.$langs->trans('ECMAddSection').'</a>';
470 } else {
471 print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('ECMAddSection').'</a>';
472 }
473
474 print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().($module ? '&module='.urlencode($module) : '').'&section='.urlencode($section).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), '', $permissiontoadd);
475
476 print '</div>';
477}
478
479
480// Confirm remove file
481if ($action == 'deletefile') {
482 print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST("section", 'alpha')).'&urlfile='.urlencode(GETPOST("urlfile")).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
483}
484
485// Confirm remove dir
486if ($action == 'delete' || $action == 'delete_dir') {
487 $relativepathwithoutslash = preg_replace('/[\/]$/', '', $relativepath);
488 $formquestion = [];
489 // Form to delete files
490 if (count($filearrayall) > 0) {
491 $langs->load("other");
492 $formquestion = array(
493 array('type' => 'checkbox', 'name' => 'deletedirrecursive', 'label' => $langs->trans("ContentOfDirectoryIsNotEmpty").'<br>'.$langs->trans("DeleteAlsoContentRecursively"), 'value' => '0') // Field to complete private note (not replace)
494 );
495 }
496
497 print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST('section', 'alpha')).($module ? '&module='.$module : '').($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $relativepathwithoutslash), 'confirm_deletedir', $formquestion, 1, 1);
498}
499
500
501/*
502$formfile = new FormFile($db);
503
504// Display upload form
505if ($user->hasRight('ecm', 'upload')) {
506 $formfile->form_attach_new_file(DOL_URL_ROOT . '/ecm/dir_card.php', '', 0, $section);
507}
508
509// List of document
510if ($user->hasRight('ecm', 'read')) {
511 $param = '&amp;section=' . $section;
512 $formfile->list_of_documents($filearray, '', 'ecm', $param, 1, $relativepath, $user->rights->ecm->upload);
513}
514*/
515
516// End of page
517llxFooter();
518$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
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 to manage ECM directories.
Class to manage standard extra fields.
Class to manage HTML component for ECM and generic filemanager.
Class to manage generation of HTML components Only common components must be here.
Class to manage Dolibarr users.
llxFooter()
Footer empty.
Definition document.php:107
ecm_prepare_head($object, $module='ecm', $section='')
Prepare array with list of tabs.
Definition ecm.lib.php:91
dol_filemtime($pathoffile)
Return time of a file.
dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0, $indexdatabase=1, $nolog=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories)
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Check validity of a file upload from an GUI page, and move it to its final destination.
dol_delete_dir($dir, $nophperrors=0)
Remove a directory (not recursive, so content must be empty).
dol_unescapefile($filename)
Unescape a file submitted by upload.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
Definition files.lib.php:63
dol_print_size($size, $shortvalue=0, $shortunit=0)
Return string with formatted size.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.