dolibarr  13.0.2
index_auto.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2008-2010 Regis Houssin <regis.houssin@inodbox.com>
4  * Copyright (C) 2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
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 
26 require '../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
32 
33 // Load translation files required by the page
34 $langs->loadLangs(array("ecm", "companies", "other", "users", "orders", "propal", "bills", "contracts"));
35 
36 // Security check
37 if ($user->socid) $socid = $user->socid;
38 $result = restrictedArea($user, 'ecm', 0);
39 
40 // Get parameters
41 $socid = GETPOST('socid', 'int');
42 $action = GETPOST('action', 'aZ09');
43 $section = GETPOST('section', 'int') ?GETPOST('section', 'int') : GETPOST('section_id', 'int');
44 $module = GETPOST('module', 'alpha');
45 if (!$section) $section = 0;
46 $section_dir = GETPOST('section_dir', 'alpha');
47 
48 $search_doc_ref = GETPOST('search_doc_ref', 'alpha');
49 
50 $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
51 $sortfield = GETPOST("sortfield", 'alpha');
52 $sortorder = GETPOST("sortorder", 'alpha');
53 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
54 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
55 $offset = $limit * $page;
56 $pageprev = $page - 1;
57 $pagenext = $page + 1;
58 if (!$sortorder) $sortorder = "ASC";
59 if (!$sortfield) $sortfield = "fullname";
60 if ($module == 'invoice_supplier' && $sortfield == "fullname") $sortfield = "level1name";
61 
62 $ecmdir = new EcmDirectory($db);
63 if ($section)
64 {
65  $result = $ecmdir->fetch($section);
66  if (!$result > 0)
67  {
68  dol_print_error($db, $ecmdir->error);
69  exit;
70  }
71 }
72 
73 $form = new Form($db);
74 $ecmdirstatic = new EcmDirectory($db);
75 $userstatic = new User($db);
76 
77 $error = 0;
78 
79 
80 /*
81  * Actions
82  */
83 
84 // Purge search criteria
85 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
86 {
87  $search_doc_ref = '';
88 }
89 
90 
91 
92 
93 // Add directory
94 if ($action == 'add' && $user->rights->ecm->setup)
95 {
96  $ecmdir->ref = 'NOTUSEDYET';
97  $ecmdir->label = GETPOST("label");
98  $ecmdir->description = GETPOST("desc");
99 
100  $id = $ecmdir->create($user);
101  if ($id > 0)
102  {
103  header("Location: ".$_SERVER["PHP_SELF"]);
104  exit;
105  } else {
106  setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors');
107  $action = "create";
108  }
109 
110  clearstatcache();
111 }
112 
113 // Remove file
114 if ($action == 'confirm_deletefile')
115 {
116  if (GETPOST('confirm') == 'yes')
117  {
118  $langs->load("other");
119  if ($section)
120  {
121  $result = $ecmdir->fetch($section);
122  if (!($result > 0))
123  {
124  dol_print_error($db, $ecmdir->error);
125  exit;
126  }
127  $relativepath = $ecmdir->getRelativePath();
128  } else $relativepath = '';
129  $upload_dir = $conf->ecm->dir_output.($relativepath ? '/'.$relativepath : '');
130  $file = $upload_dir."/".GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
131 
132  $ret = dol_delete_file($file);
133  if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
134  else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
135 
136  $result = $ecmdir->changeNbOfFiles('-');
137 
138  clearstatcache();
139  }
140  $action = 'file_manager';
141 }
142 
143 // Remove directory
144 if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
145 {
146  $result = $ecmdir->delete($user);
147  setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs');
148 
149  clearstatcache();
150 }
151 
152 // Refresh directory view
153 // This refresh list of dirs, not list of files (for preformance reason). List of files is refresh only if dir was not synchronized.
154 // To refresh content of dir with cache, just open the dir in edit mode.
155 if ($action == 'refreshmanual')
156 {
157  $ecmdirtmp = new EcmDirectory($db);
158 
159  // This part of code is same than into file ecm/ajax/ecmdatabase.php TODO Remove duplicate
160  clearstatcache();
161 
162  $diroutputslash = str_replace('\\', '/', $conf->ecm->dir_output);
163  $diroutputslash .= '/';
164 
165  // Scan directory tree on disk
166  $disktree = dol_dir_list($conf->ecm->dir_output, 'directories', 1, '', '^temp$', '', '', 0);
167 
168  // Scan directory tree in database
169  $sqltree = $ecmdirstatic->get_full_arbo(0);
170 
171  $adirwascreated = 0;
172 
173  // Now we compare both trees to complete missing trees into database
174  //var_dump($disktree);
175  //var_dump($sqltree);
176  foreach ($disktree as $dirdesc) // Loop on tree onto disk
177  {
178  $dirisindatabase = 0;
179  foreach ($sqltree as $dirsqldesc)
180  {
181  if ($conf->ecm->dir_output.'/'.$dirsqldesc['fullrelativename'] == $dirdesc['fullname'])
182  {
183  $dirisindatabase = 1;
184  break;
185  }
186  }
187 
188  if (!$dirisindatabase)
189  {
190  $txt = "Directory found on disk ".$dirdesc['fullname'].", not found into database so we add it";
191  dol_syslog($txt);
192  //print $txt."<br>\n";
193 
194  // We must first find the fk_parent of directory to create $dirdesc['fullname']
195  $fk_parent = -1;
196  $relativepathmissing = str_replace($diroutputslash, '', $dirdesc['fullname']);
197  $relativepathtosearchparent = $relativepathmissing;
198  //dol_syslog("Try to find parent id for directory ".$relativepathtosearchparent);
199  if (preg_match('/\//', $relativepathtosearchparent))
200  //while (preg_match('/\//',$relativepathtosearchparent))
201  {
202  $relativepathtosearchparent = preg_replace('/\/[^\/]*$/', '', $relativepathtosearchparent);
203  $txt = "Is relative parent path ".$relativepathtosearchparent." for ".$relativepathmissing." found in sql tree ?";
204  dol_syslog($txt);
205  //print $txt." -> ";
206  $parentdirisindatabase = 0;
207  foreach ($sqltree as $dirsqldesc)
208  {
209  if ($dirsqldesc['fullrelativename'] == $relativepathtosearchparent)
210  {
211  $parentdirisindatabase = $dirsqldesc['id'];
212  break;
213  }
214  }
215  if ($parentdirisindatabase > 0)
216  {
217  dol_syslog("Yes with id ".$parentdirisindatabase);
218  //print "Yes with id ".$parentdirisindatabase."<br>\n";
219  $fk_parent = $parentdirisindatabase;
220  //break; // We found parent, we can stop the while loop
221  } else {
222  dol_syslog("No");
223  //print "No<br>\n";
224  }
225  } else {
226  dol_syslog("Parent is root");
227  $fk_parent = 0; // Parent is root
228  }
229 
230  if ($fk_parent >= 0)
231  {
232  $ecmdirtmp->ref = 'NOTUSEDYET';
233  $ecmdirtmp->label = dol_basename($dirdesc['fullname']);
234  $ecmdirtmp->description = '';
235  $ecmdirtmp->fk_parent = $fk_parent;
236 
237  $txt = "We create directory ".$ecmdirtmp->label." with parent ".$fk_parent;
238  dol_syslog($txt);
239  //print $ecmdirtmp->cachenbofdoc."<br>\n";exit;
240  $id = $ecmdirtmp->create($user);
241  if ($id > 0)
242  {
243  $newdirsql = array('id'=>$id,
244  'id_mere'=>$ecmdirtmp->fk_parent,
245  'label'=>$ecmdirtmp->label,
246  'description'=>$ecmdirtmp->description,
247  'fullrelativename'=>$relativepathmissing);
248  $sqltree[] = $newdirsql; // We complete fulltree for following loops
249  //var_dump($sqltree);
250  $adirwascreated = 1;
251  } else {
252  dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR);
253  }
254  } else {
255  $txt = "Parent of ".$dirdesc['fullname']." not found";
256  dol_syslog($txt);
257  //print $txt."<br>\n";
258  }
259  }
260  }
261 
262  // Loop now on each sql tree to check if dir exists
263  foreach ($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
264  {
265  $dirtotest = $conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
266  if (!dol_is_dir($dirtotest))
267  {
268  $ecmdirtmp->id = $dirdesc['id'];
269  $ecmdirtmp->delete($user, 'databaseonly');
270  //exit;
271  }
272  }
273 
274  $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
275  dol_syslog("sql = ".$sql);
276  $db->query($sql);
277 
278  // If a directory was added, the fulltree array is not correctly completed and sorted, so we clean
279  // it to be sure that fulltree array is not used without reloading it.
280  if ($adirwascreated) $sqltree = null;
281 }
282 
283 
284 
285 /*
286  * View
287  */
288 
289 // Define height of file area (depends on $_SESSION["dol_screenheight"])
290 //print $_SESSION["dol_screenheight"];
291 $maxheightwin = (isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 466) ? ($_SESSION["dol_screenheight"] - 136) : 660; // Also into index.php file
292 
293 $moreheadcss = '';
294 $moreheadjs = '';
295 
296 //$morejs=array();
297 $morejs = array('includes/jquery/plugins/blockUI/jquery.blockUI.js', 'core/js/blockUI.js'); // Used by ecm/tpl/enabledfiletreeajax.tpl.pgp
298 if (empty($conf->global->MAIN_ECM_DISABLE_JS)) $morejs[] = "includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js";
299 
300 $moreheadjs .= '<script type="text/javascript">'."\n";
301 $moreheadjs .= 'var indicatorBlockUI = \''.DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif".'\';'."\n";
302 $moreheadjs .= '</script>'."\n";
303 
304 llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $morejs, '', 0, 0);
305 
306 
307 // Add sections to manage
308 $rowspan = 0;
309 $sectionauto = array();
310 if (!empty($conf->global->ECM_AUTO_TREE_ENABLED))
311 {
312  if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { $langs->load("products"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'product', 'test'=>(!empty($conf->product->enabled) || !empty($conf->service->enabled)), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
313  if (!empty($conf->societe->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties"))); }
314  if (!empty($conf->propal->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); }
315  if (!empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); }
316  if (!empty($conf->commande->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); }
317  if (!empty($conf->facture->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); }
318  if (!empty($conf->supplier_proposal->enabled)) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); }
319  if (!empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders"))); }
320  if (!empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); }
321  if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); }
322  if (!empty($conf->projet->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); }
323  if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); }
324  if (!empty($conf->expensereport->enabled)) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); }
325  if (!empty($conf->holiday->enabled)) { $langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); }
326  if (!empty($conf->banque->enabled)) { $langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); }
327  if (!empty($conf->mrp->enabled)) { $langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders"))); }
328  if (!empty($conf->recruitment->enabled)) { $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications"))); }
329  $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Users")));
330 }
331 
332 $head = ecm_prepare_dasboard_head('');
333 print dol_get_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"), -1, '');
334 
335 
336 
337 // Confirm remove file (for non javascript users)
338 if ($action == 'delete' && empty($conf->use_javascript_ajax))
339 {
340  print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 1);
341 }
342 
343 // Start container of all panels
344 ?>
345 <!-- Begin div id="containerlayout" -->
346 <div id="containerlayout">
347 <div id="ecm-layout-north" class="toolbar largebutton">
348 <?php
349 
350 // Start top panel, toolbar
351 print '<div class="inline-block toolbarbutton centpercent">';
352 
353 // Toolbar
354 $url = ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) ? '#' : ($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module ? '&amp;module='.$module : '').($section ? '&amp;section='.$section : '')));
355 print '<a href="'.$url.'" class="inline-block valignmiddle toolbarbutton paddingtop" title="'.dol_escape_htmltag($langs->trans('Refresh')).'">';
356 print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">';
357 print '</a>';
358 
359 print '</div>';
360 // End top panel, toolbar
361 
362 ?>
363 </div>
364 <div id="ecm-layout-west" class="inline-block">
365 <?php
366 // Start left area
367 
368 
369 // Confirmation de la suppression d'une ligne categorie
370 if ($action == 'delete_section')
371 {
372  print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $ecmdir->label), 'confirm_deletesection', '', '', 1);
373 }
374 // End confirm
375 
376 
377 if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'delete')
378 {
379  print '<table width="100%" class="liste noborderbottom">'."\n";
380 
381  print '<!-- Title for auto directories -->'."\n";
382  print '<tr class="liste_titre">'."\n";
383  print '<th class="liste_titre" align="left" colspan="6">';
384  print '&nbsp;'.$langs->trans("ECMSections");
385  print '</th></tr>';
386 
387  $showonrightsize = '';
388  // Auto section
389  if (count($sectionauto))
390  {
391  $htmltooltip = $langs->trans("ECMAreaDesc2");
392 
393  $sectionauto = dol_sort_array($sectionauto, 'label', 'ASC', true, false);
394 
395  print '<tr>';
396  print '<td colspan="6">';
397  print '<div id="filetreeauto" class="ecmfiletree"><ul class="ecmjqft">';
398 
399  $nbofentries = 0;
400  $oldvallevel = 0;
401  foreach ($sectionauto as $key => $val)
402  {
403  if (empty($val['test'])) continue; // If condition to show is ok
404 
405  $var = false;
406 
407  print '<li class="directory collapsed">';
408  if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))
409  {
410  print '<a class="fmdirlia jqft ecmjqft" href="'.$_SERVER["PHP_SELF"].'?module='.$val['module'].'">';
411  print $val['label'];
412  print '</a>';
413  } else {
414  print '<a class="fmdirlia jqft ecmjqft" href="'.$_SERVER["PHP_SELF"].'?module='.$val['module'].'">';
415  print $val['label'];
416  print '</a>';
417  }
418 
419  print '<div class="ecmjqft">';
420  // Info
421  $htmltooltip = '<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
422  $htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionAuto").'<br>';
423  $htmltooltip .= '<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto").'<br>';
424  $htmltooltip .= '<b>'.$langs->trans("Description").'</b>: '.$val['desc'];
425  print $form->textwithpicto('', $htmltooltip, 1, 'info');
426  print '</div>';
427  print '</li>';
428 
429  $nbofentries++;
430  }
431 
432  print '</ul></div></td></tr>';
433  }
434 
435  print "</table>";
436 }
437 
438 
439 // End left panel
440 ?>
441 </div>
442 <div id="ecm-layout-center" class="inline-block">
443 <div class="pane-in ecm-in-layout-center">
444 <div id="ecmfileview" class="ecmfileview">
445 <?php
446 // Start right panel
447 
448 
449 $mode = 'noajax';
450 $url = DOL_URL_ROOT.'/ecm/index_auto.php';
451 include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php';
452 
453 
454 // End right panel
455 ?>
456 </div>
457 </div>
458 
459 </div>
460 </div> <!-- End div id="containerlayout" -->
461 <?php
462 // End of page
463 
464 if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) {
465  include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php';
466 }
467 
468 
470 
471 llxFooter();
472 
473 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage generation of HTML components Only common components must be here.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
$conf db user
Definition: repair.php:109
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
dol_basename($pathfile)
Make a basename working with all page code (default PHP basenamed fails with cyrillic).
Definition: files.lib.php:36
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1)
Remove a file or several files with a mask.
Definition: files.lib.php:1144
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
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
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_sort_array(&$array, $index, $order= 'asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print
Draft customers invoices.
Definition: index.php:89
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.
llxFooter()
Empty footer.
Definition: wrapper.php:59
Class to manage ECM directories.