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