dolibarr  13.0.2
ajaxdirtree.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007-2018 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.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 
26 // This script is called with a POST method.
27 // Directory to scan (full path) is inside POST['dir'] and encode by js escape() if ajax is used or encoded by urlencode if mode=noajax
28 
29 if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); // Disables token renewal
30 if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
31 if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
32 if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
33 
34 if (!isset($mode) || $mode != 'noajax') // For ajax call
35 {
36  $res = @include '../../main.inc.php';
37  include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
38  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
39  include_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
40  include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
41  include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
42 
43  //if (GETPOST('preopened')) { $_GET['dir'] = $_POST['dir'] = '/bbb/'; }
44 
45  $openeddir = GETPOST('openeddir');
46  $modulepart = GETPOST('modulepart');
47  $selecteddir = jsUnEscape(GETPOST('dir')); // relative path. We must decode using same encoding function used by javascript: escape()
48 
49  $preopened = GETPOST('preopened');
50 
51  if ($selecteddir != '/') $selecteddir = preg_replace('/\/$/', '', $selecteddir); // We removed last '/' except if it is '/'
52 } else // For no ajax call
53 {
54  //if (GETPOST('preopened')) { $_GET['dir'] = $_POST['dir'] = GETPOST('preopened'); }
55 
56  $openeddir = GETPOST('openeddir');
57  $modulepart = GETPOST('modulepart');
58  $selecteddir = GETPOST('dir');
59 
60  $preopened = GETPOST('preopened');
61 
62  if ($selecteddir != '/') $selecteddir = preg_replace('/\/$/', '', $selecteddir); // We removed last '/' except if it is '/'
63  if (empty($url)) $url = DOL_URL_ROOT.'/ecm/index.php';
64 }
65 
66 // Load translation files required by the page
67 $langs->load("ecm");
68 
69 // Define fullpathselecteddir.
70 $fullpathselecteddir = '<none>';
71 if ($modulepart == 'ecm')
72 {
73  $fullpathselecteddir = $conf->ecm->dir_output.'/'.($selecteddir != '/' ? $selecteddir : '');
74  $fullpathpreopened = $conf->ecm->dir_output.'/'.($preopened != '/' ? $preopened : '');
75 } elseif ($modulepart == 'medias')
76 {
77  $fullpathselecteddir = $dolibarr_main_data_root.'/medias/'.($selecteddir != '/' ? $selecteddir : '');
78  $fullpathpreopened = $dolibarr_main_data_root.'/medias/'.($preopened != '/' ? $preopened : '');
79 }
80 
81 
82 // Security:
83 // On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers.
84 if (preg_match('/\.\./', $fullpathselecteddir) || preg_match('/[<>|]/', $fullpathselecteddir))
85 {
86  dol_syslog("Refused to deliver file ".$original_file);
87  // Do no show plain path in shown error message
88  dol_print_error(0, $langs->trans("ErrorFileNameInvalid", GETPOST("file")));
89  exit;
90 }
91 
92 // Check permissions
93 if ($modulepart == 'ecm')
94 {
95  if (!$user->rights->ecm->read) accessforbidden();
96 } elseif ($modulepart == 'medias')
97 {
98  // Always allowed
99 }
100 
101 
102 /*
103  * View
104  */
105 
106 if (!isset($mode) || $mode != 'noajax') // if ajax mode
107 {
108  top_httphead();
109 }
110 
111 //print '<!-- selecteddir (relative dir we click on) = '.$selecteddir.', openeddir = '.$openeddir.', modulepart='.$modulepart.', preopened='.$preopened.' -->'."\n";
112 $userstatic = new User($db);
113 $form = new Form($db);
114 $ecmdirstatic = new EcmDirectory($db);
115 
116 // Load full tree of ECM module from database. We will use it to define nbofsubdir and nboffilesinsubdir
117 if (empty($sqltree)) $sqltree = $ecmdirstatic->get_full_arbo(0);
118 
119 // Try to find selected dir id into $sqltree and save it into $current_ecmdir_id
120 $current_ecmdir_id = -1;
121 foreach ($sqltree as $keycursor => $val)
122 {
123  //print $val['fullrelativename']." == ".$selecteddir;
124  if ($val['fullrelativename'] == $selecteddir)
125  {
126  $current_ecmdir_id = $keycursor;
127  }
128 }
129 
130 if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))
131 {
132  treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened);
133 
134  // TODO Find a solution to not output this code for each leaf we open
135  // Enable jquery handlers on new generated HTML objects (same code than into lib_footer.js.php)
136  // Because the content is reloaded by ajax call, we must also reenable some jquery hooks
137  print "\n<!-- JS CODE TO ENABLE Tooltips on all object with class classfortooltip (reload into ajaxdirtree) -->\n";
138  print '<script type="text/javascript">
139  jQuery(document).ready(function () {
140  jQuery(".classfortooltip").tooltip({
141  show: { collision: "flipfit", effect:\'toggle\', delay:50 },
142  hide: { delay: 50 }, /* If I enable effect:\'toggle\' here, a bug appears: the tooltip is shown when collpasing a new dir if it was shown before */
143  tooltipClass: "mytooltip",
144  content: function () {
145  return $(this).prop(\'title\'); /* To force to get title as is */
146  }
147  });
148  });
149  </script>';
150 
151  // This ajax service is called only when a directory $selecteddir is opened but not when closed.
152  //print '<script language="javascript">';
153  //print "loadandshowpreview('".dol_escape_js($selecteddir)."');";
154  //print '</script>';
155 }
156 
157 
158 if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_JS))
159 {
160  print '<ul class="ecmjqft">';
161 
162  // Load full tree from database. We will use it to define nbofsubdir and nboffilesinsubdir
163  if (empty($sqltree)) $sqltree = $ecmdirstatic->get_full_arbo(0); // Slow
164 
165  // ----- This section will show a tree from a fulltree array -----
166  // $section must also be defined
167  // ----------------------------------------------------------------
168 
169  // Define fullpathselected ( _x_y_z ) of $section parameter (!! not into ajaxdirtree)
170  $fullpathselected = '';
171  foreach ($sqltree as $key => $val)
172  {
173  //print $val['id']."-".$section."<br>";
174  if ($val['id'] == $section)
175  {
176  $fullpathselected = $val['fullpath'];
177  break;
178  }
179  }
180  //print "fullpathselected=".$fullpathselected."<br>";
181 
182  // Update expandedsectionarray in session
183  $expandedsectionarray = array();
184  if (isset($_SESSION['dol_ecmexpandedsectionarray'])) $expandedsectionarray = explode(',', $_SESSION['dol_ecmexpandedsectionarray']);
185 
186  if ($section && GETPOST('sectionexpand') == 'true')
187  {
188  // We add all sections that are parent of opened section
189  $pathtosection = explode('_', $fullpathselected);
190  foreach ($pathtosection as $idcursor)
191  {
192  if ($idcursor && !in_array($idcursor, $expandedsectionarray)) // Not already in array
193  {
194  $expandedsectionarray[] = $idcursor;
195  }
196  }
197  $_SESSION['dol_ecmexpandedsectionarray'] = join(',', $expandedsectionarray);
198  }
199  if ($section && GETPOST('sectionexpand') == 'false')
200  {
201  // We removed all expanded sections that are child of the closed section
202  $oldexpandedsectionarray = $expandedsectionarray;
203  $expandedsectionarray = array(); // Reset
204  foreach ($oldexpandedsectionarray as $sectioncursor)
205  {
206  // TODO is_in_subtree(fulltree,sectionparent,sectionchild) does nox exists. Enable or remove this...
207  //if ($sectioncursor && ! is_in_subtree($sqltree,$section,$sectioncursor)) $expandedsectionarray[]=$sectioncursor;
208  }
209  $_SESSION['dol_ecmexpandedsectionarray'] = join(',', $expandedsectionarray);
210  }
211  //print $_SESSION['dol_ecmexpandedsectionarray'].'<br>';
212 
213  $nbofentries = 0;
214  $oldvallevel = 0;
215  foreach ($sqltree as $key => $val)
216  {
217  $ecmdirstatic->id = $val['id'];
218  $ecmdirstatic->ref = $val['label'];
219 
220  // Refresh cache
221  if (preg_match('/refresh/i', $action))
222  {
223  $result = $ecmdirstatic->fetch($val['id']);
224  $ecmdirstatic->ref = $ecmdirstatic->label;
225 
226  $result = $ecmdirstatic->refreshcachenboffile(0);
227  $val['cachenbofdoc'] = $result;
228  }
229 
230  //$fullpathparent=preg_replace('/(_[^_]+)$/i','',$val['fullpath']);
231 
232  // Define showline
233  $showline = 0;
234 
235  // If directory is son of expanded directory, we show line
236  if (in_array($val['id_mere'], $expandedsectionarray)) $showline = 4;
237  // If directory is brother of selected directory, we show line
238  elseif ($val['id'] != $section && $val['id_mere'] == $ecmdirstatic->motherof[$section]) $showline = 3;
239  // If directory is parent of selected directory or is selected directory, we show line
240  elseif (preg_match('/'.$val['fullpath'].'_/i', $fullpathselected.'_')) $showline = 2;
241  // If we are level one we show line
242  elseif ($val['level'] < 2) $showline = 1;
243 
244  if ($showline)
245  {
246  if (in_array($val['id'], $expandedsectionarray)) $option = 'indexexpanded';
247  else $option = 'indexnotexpanded';
248  //print $option;
249 
250  print '<li class="directory collapsed">';
251 
252  // Show tree graph pictos
253  $cpt = 1;
254  while ($cpt < $sqltree[$key]['level'])
255  {
256  print ' &nbsp; &nbsp;';
257  $cpt++;
258  }
259  $resarray = tree_showpad($sqltree, $key, 1);
260  $a = $resarray[0];
261  $nbofsubdir = $resarray[1];
262  $nboffilesinsubdir = $resarray[2];
263 
264  // Show link
265  print $ecmdirstatic->getNomUrl(0, $option, 32, 'class="fmdirlia jqft ecmjqft"');
266 
267  print '<div class="ecmjqft">';
268 
269  // Nb of docs
270  print '<table class="nobordernopadding"><tr><td>';
271  print $val['cachenbofdoc'];
272  print '</td>';
273  print '<td class="left">';
274  if ($nbofsubdir && $nboffilesinsubdir) print '<font color="#AAAAAA">+'.$nboffilesinsubdir.'</font> ';
275  print '</td>';
276 
277  // Info
278  print '<td class="center">';
279  $userstatic->id = $val['fk_user_c'];
280  $userstatic->lastname = $val['login_c'];
281  $htmltooltip = '<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
282  $htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
283  $htmltooltip .= '<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1, '', false, 1).'<br>';
284  $htmltooltip .= '<b>'.$langs->trans("ECMCreationDate").'</b>: '.dol_print_date($val['date_c'], "dayhour").'<br>';
285  $htmltooltip .= '<b>'.$langs->trans("Description").'</b>: '.$val['description'].'<br>';
286  $htmltooltip .= '<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.$val['cachenbofdoc'].'<br>';
287  if ($nbofsubdir) $htmltooltip .= '<b>'.$langs->trans("ECMNbOfFilesInSubDir").'</b>: '.$nboffilesinsubdir;
288  else $htmltooltip .= '<b>'.$langs->trans("ECMNbOfSubDir").'</b>: '.$nbofsubdir.'<br>';
289  print $form->textwithpicto('', $htmltooltip, 1, 'info');
290  print "</td>";
291 
292  print '</tr></table>';
293 
294  print '</div>';
295 
296  print "</li>\n";
297  }
298 
299  $oldvallevel = $val['level'];
300  $nbofentries++;
301  }
302 
303  // If nothing to show
304  if ($nbofentries == 0)
305  {
306  print '<li class="directory collapsed">';
307  print '<div class="ecmjqft">';
308  print $langs->trans("ECMNoDirectoryYet");
309  print '</div>';
310  print "</li>\n";
311  }
312 
313  print '</ul>';
314 }
315 
316 
317 // Close db if mode is not noajax
318 if ((!isset($mode) || $mode != 'noajax') && is_object($db)) $db->close();
319 
320 
321 
336 function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth = 0)
337 {
338  global $conf, $db, $langs, $form;
339  global $dolibarr_main_data_root;
340 
341  $ecmdirstatic = new EcmDirectory($db);
342  $userstatic = new User($db);
343 
344  if (file_exists($fullpathselecteddir))
345  {
346  $files = @scandir($fullpathselecteddir);
347 
348  if (!empty($files))
349  {
350  natcasesort($files);
351  if (count($files) > 2) /* The 2 accounts for . and .. */
352  {
353  echo '<ul class="ecmjqft" style="display: none;">'."\n";
354 
355  // All dirs
356  foreach ($files as $file) // $file can be '.', '..', or 'My dir' or 'My file'
357  {
358  if ($file == 'temp') continue;
359 
360  $nbofsubdir = 0;
361  $nboffilesinsubdir = 0;
362 
363  $val = array();
364 
365  // Loop on all database entries (sqltree) to find the one matching the subdir found into dir to scan
366  foreach ($sqltree as $key => $tmpval)
367  {
368  //print "-- key=".$key." - ".$tmpval['fullrelativename']." vs ".(($selecteddir != '/'?$selecteddir.'/':'').$file)."<br>\n";
369  if ($tmpval['fullrelativename'] == (($selecteddir != '/' ? $selecteddir.'/' : '').$file)) // We found equivalent record into database
370  {
371  $val = $tmpval;
372  $resarray = tree_showpad($sqltree, $key, 1);
373 
374  // Refresh cache for this subdir
375  if (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] < 0) // Cache is not up to date, so we update it for this directory t
376  {
377  $result = $ecmdirstatic->fetch($val['id']);
378  $ecmdirstatic->ref = $ecmdirstatic->label;
379 
380  $result = $ecmdirstatic->refreshcachenboffile(0);
381  $val['cachenbofdoc'] = $result;
382  }
383 
384  $a = $resarray[0];
385  $nbofsubdir = $resarray[1];
386  $nboffilesinsubdir = $resarray[2];
387  break;
388  }
389  }
390 
391  //print 'modulepart='.$modulepart.' fullpathselecteddir='.$fullpathselecteddir.' - val[fullrelativename] (in database)='.$val['fullrelativename'].' - val[id]='.$val['id'].' - is_dir='.dol_is_dir($fullpathselecteddir . $file).' - file='.$file."\n";
392  if ($file != '.' && $file != '..' && ((!empty($val['fullrelativename']) && $val['id'] >= 0) || dol_is_dir($fullpathselecteddir.(preg_match('/\/$/', $fullpathselecteddir) ? '' : '/').$file)))
393  {
394  if (empty($val['fullrelativename'])) // If we did not find entry into database, but found a directory (dol_is_dir was ok at previous test)
395  {
396  $val['fullrelativename'] = (($selecteddir && $selecteddir != '/') ? $selecteddir.'/' : '').$file;
397  $val['id'] = 0;
398  $val['label'] = $file;
399  $val['description'] = '';
400  $nboffilesinsubdir = $langs->trans("Unknown");
401  }
402 
403  $collapsedorexpanded = 'collapsed';
404  if (preg_match('/^'.preg_quote($val['fullrelativename'].'/', '/').'/', $preopened)) $collapsedorexpanded = 'expanded';
405  print '<li class="directory '.$collapsedorexpanded.'">'; // collapsed is opposite if expanded
406 
407  print "<a class=\"fmdirlia jqft ecmjqft\" href=\"";
408  print "#";
409  print "\" rel=\"".dol_escape_htmltag($val['fullrelativename'].'/')."\" id=\"fmdirlia_id_".$val['id']."\"";
410  print " onClick=\"loadandshowpreview('".dol_escape_js($val['fullrelativename'])."',".$val['id'].")";
411  print "\">";
412  print dol_escape_htmltag($file);
413  print "</a>";
414 
415  print '<div class="ecmjqft">';
416 
417  print '<table class="nobordernopadding"><tr>';
418 
419  /*print '<td class="left">';
420  print dol_escape_htmltag($file);
421  print '</td>';*/
422 
423  // Nb of docs
424  print '<td class="right">';
425  print (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0) ? $val['cachenbofdoc'] : '&nbsp;';
426  print '</td>';
427  print '<td class="left">';
428  if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) print '<font class="opacitymedium">+'.$nboffilesinsubdir.'</font> ';
429  print '</td>';
430 
431  // Edit link
432  print '<td class="right" width="18"><a class="editfielda" href="';
433  print DOL_URL_ROOT.'/ecm/dir_card.php?module='.urlencode($modulepart).'&section='.$val['id'].'&relativedir='.urlencode($val['fullrelativename']);
434  print '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid);
435  print '">'.img_edit($langs->trans("Edit").' - '.$langs->trans("View"), 0, 'class="valignmiddle opacitymedium"').'</a></td>';
436 
437  // Add link
438  //print '<td class="right"><a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php?action=create&amp;catParent='.$val['id'].'">'.img_edit_add().'</a></td>';
439  //print '<td class="right" width="14">&nbsp;</td>';
440 
441  // Info
442  if ($modulepart == 'ecm')
443  {
444  print '<td class="right" width="18">';
445  $userstatic->id = isset($val['fk_user_c']) ? $val['fk_user_c'] : 0;
446  $userstatic->lastname = isset($val['login_c']) ? $val['login_c'] : 0;
447  $htmltooltip = '<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
448  $htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
449  $htmltooltip .= '<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1, '', false, 1).'<br>';
450  $htmltooltip .= '<b>'.$langs->trans("ECMCreationDate").'</b>: '.(isset($val['date_c']) ?dol_print_date($val['date_c'], "dayhour") : $langs->trans("NeedRefresh")).'<br>';
451  $htmltooltip .= '<b>'.$langs->trans("Description").'</b>: '.$val['description'].'<br>';
452  $htmltooltip .= '<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.((isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0) ? $val['cachenbofdoc'] : $langs->trans("NeedRefresh")).'<br>';
453  if ($nboffilesinsubdir > 0) $htmltooltip .= '<b>'.$langs->trans("ECMNbOfFilesInSubDir").'</b>: '.$nboffilesinsubdir;
454  else $htmltooltip .= '<b>'.$langs->trans("ECMNbOfSubDir").'</b>: '.($nbofsubdir >= 0 ? $nbofsubdir : $langs->trans("NeedRefresh")).'<br>';
455  print $form->textwithpicto('', $htmltooltip, 1, "info");
456  print "</td>";
457  }
458 
459  print "</tr></table>\n";
460  print '</div>';
461 
462  //print 'selecteddir='.$selecteddir.' preopened='.$preopened.' $val[\'fullrelativename\']='.$val['fullrelativename']."<br>\n";
463  if (preg_match('/^'.preg_quote($val['fullrelativename'].'/', '/').'/', $preopened))
464  {
465  //print 'modulepart='.$modulepart.' fullpathselecteddir='.$fullpathselecteddir.' - val[fullrelativename] (in database)='.$val['fullrelativename'].' - val[id]='.$val['id'].' - is_dir='.dol_is_dir($fullpathselecteddir . $file).' - file='.$file."\n";
466  $newselecteddir = $val['fullrelativename'];
467  $newfullpathselecteddir = '';
468  if ($modulepart == 'ecm')
469  {
470  $newfullpathselecteddir = $conf->ecm->dir_output.'/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : '');
471  } elseif ($modulepart == 'medias')
472  {
473  $newfullpathselecteddir = $dolibarr_main_data_root.'/medias/'.($val['fullrelativename'] != '/' ? $val['fullrelativename'] : '');
474  }
475 
476  if ($newfullpathselecteddir) treeOutputForAbsoluteDir($sqltree, $newselecteddir, $newfullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth + 1);
477  }
478 
479  print "</li>\n";
480  }
481  }
482 
483  echo "</ul>\n";
484  }
485  } else print "PermissionDenied";
486  }
487 }
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
tree_showpad(&$fulltree, $key, $silent=0)
Show indent and picto of a tree line.
Class to manage Dolibarr users.
Definition: user.class.php:44
dol_is_dir($folder)
Test if filename is a directory.
Definition: files.lib.php:432
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype= 'text/html', $forcenocache=0)
Show HTTP header.
Definition: main.inc.php:1214
Class to manage generation of HTML components Only common components must be here.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
jsUnEscape($source)
Same function than javascript unescape() function but in PHP.
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 ...
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
Definition: index.php:89
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth=0)
treeOutputForAbsoluteDir
Class to manage ECM directories.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...