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