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