dolibarr 20.0.5
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 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
6 * Copyright (C) 2025 Joachim Kueter <git-jk@bloxera.com>
7
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
29// Load Dolibarr environment
30require '../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
36
37// Load translation files required by the page
38$langs->loadLangs(array("ecm", "companies", "other", "users", "orders", "propal", "bills", "contracts"));
39
40// Get parameters
41$socid = GETPOSTINT('socid');
42$action = GETPOST('action', 'aZ09');
43$section = GETPOSTINT('section') ? GETPOSTINT('section') : GETPOSTINT('section_id');
44$module = GETPOST('module', 'alpha');
45if (!$section) {
46 $section = 0;
47}
48$section_dir = GETPOST('section_dir', 'alpha');
49
50$search_doc_ref = GETPOST('search_doc_ref', 'alpha');
51
52$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
53$sortfield = GETPOST('sortfield', 'aZ09comma');
54$sortorder = GETPOST('sortorder', 'aZ09comma');
55$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
56if (empty($page) || $page == -1) {
57 $page = 0;
58} // If $page is not defined, or '' or -1
59$offset = $limit * $page;
60$pageprev = $page - 1;
61$pagenext = $page + 1;
62if (!$sortorder) {
63 $sortorder = "ASC";
64}
65if (!$sortfield) {
66 $sortfield = "fullname";
67}
68if ($module == 'invoice_supplier' && $sortfield == "fullname") {
69 $sortfield = "level1name";
70}
71
72$ecmdir = new EcmDirectory($db);
73if ($section) {
74 $result = $ecmdir->fetch($section);
75 if (!($result > 0)) {
76 dol_print_error($db, $ecmdir->error);
77 exit;
78 }
79}
80
81$form = new Form($db);
82$ecmdirstatic = new EcmDirectory($db);
83$userstatic = new User($db);
84
85$error = 0;
86
87// Security check
88if ($user->socid) {
89 $socid = $user->socid;
90}
91$result = restrictedArea($user, 'ecm', 0);
92
93
94/*
95 * Actions
96 */
97
98// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
99$hookmanager->initHooks(array('ecmautocard', 'globalcard'));
100
101// Purge search criteria
102if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
103 $search_doc_ref = '';
104}
105
106
107
108
109// Add directory
110if ($action == 'add' && $user->hasRight('ecm', 'setup')) {
111 $ecmdir->ref = 'NOTUSEDYET';
112 $ecmdir->label = GETPOST("label");
113 $ecmdir->description = GETPOST("desc");
114
115 $id = $ecmdir->create($user);
116 if ($id > 0) {
117 header("Location: ".$_SERVER["PHP_SELF"]);
118 exit;
119 } else {
120 setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors');
121 $action = "create";
122 }
123
124 clearstatcache();
125}
126
127// Remove file
128if ($action == 'confirm_deletefile') {
129 if (GETPOST('confirm') == 'yes') {
130 $langs->load("other");
131 if ($section) {
132 $result = $ecmdir->fetch($section);
133 if (!($result > 0)) {
134 dol_print_error($db, $ecmdir->error);
135 exit;
136 }
137 $relativepath = $ecmdir->getRelativePath();
138 } else {
139 $relativepath = '';
140 }
141 $upload_dir = $conf->ecm->dir_output.($relativepath ? '/'.$relativepath : '');
142 $file = $upload_dir."/".GETPOST('urlfile');
143
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 clearstatcache();
154 }
155 $action = 'file_manager';
156}
157
158// Remove directory
159if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes') {
160 $result = $ecmdir->delete($user);
161 setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs');
162
163 clearstatcache();
164}
165
166// Refresh directory view
167// This refresh list of dirs, not list of files (for performance reason). List of files is refresh only if dir was not synchronized.
168// To refresh content of dir with cache, just open the dir in edit mode.
169if ($action == 'refreshmanual') {
170 $ecmdirtmp = new EcmDirectory($db);
171
172 // This part of code is same than into file ecm/ajax/ecmdatabase.php TODO Remove duplicate
173 clearstatcache();
174
175 $diroutputslash = str_replace('\\', '/', $conf->ecm->dir_output);
176 $diroutputslash .= '/';
177
178 // Scan directory tree on disk
179 $disktree = dol_dir_list($conf->ecm->dir_output, 'directories', 1, '', '^temp$', '', '', 0);
180
181 // Scan directory tree in database
182 $sqltree = $ecmdirstatic->get_full_arbo(0);
183
184 $adirwascreated = 0;
185
186 // Now we compare both trees to complete missing trees into database
187 //var_dump($disktree);
188 //var_dump($sqltree);
189 foreach ($disktree as $dirdesc) { // Loop on tree onto disk
190 $dirisindatabase = 0;
191 foreach ($sqltree as $dirsqldesc) {
192 if ($conf->ecm->dir_output.'/'.$dirsqldesc['fullrelativename'] == $dirdesc['fullname']) {
193 $dirisindatabase = 1;
194 break;
195 }
196 }
197
198 if (!$dirisindatabase) {
199 $txt = "Directory found on disk ".$dirdesc['fullname'].", not found into database so we add it";
200 dol_syslog($txt);
201 //print $txt."<br>\n";
202
203 // We must first find the fk_parent of directory to create $dirdesc['fullname']
204 $fk_parent = -1;
205 $relativepathmissing = str_replace($diroutputslash, '', $dirdesc['fullname']);
206 $relativepathtosearchparent = $relativepathmissing;
207 //dol_syslog("Try to find parent id for directory ".$relativepathtosearchparent);
208 if (preg_match('/\//', $relativepathtosearchparent)) {
209 //while (preg_match('/\//',$relativepathtosearchparent))
210 $relativepathtosearchparent = preg_replace('/\/[^\/]*$/', '', $relativepathtosearchparent);
211 $txt = "Is relative parent path ".$relativepathtosearchparent." for ".$relativepathmissing." found in sql tree ?";
212 dol_syslog($txt);
213 //print $txt." -> ";
214 $parentdirisindatabase = 0;
215 foreach ($sqltree as $dirsqldesc) {
216 if ($dirsqldesc['fullrelativename'] == $relativepathtosearchparent) {
217 $parentdirisindatabase = $dirsqldesc['id'];
218 break;
219 }
220 }
221 if ($parentdirisindatabase > 0) {
222 dol_syslog("Yes with id ".$parentdirisindatabase);
223 //print "Yes with id ".$parentdirisindatabase."<br>\n";
224 $fk_parent = $parentdirisindatabase;
225 //break; // We found parent, we can stop the while loop
226 } else {
227 dol_syslog("No");
228 //print "No<br>\n";
229 }
230 } else {
231 dol_syslog("Parent is root");
232 $fk_parent = 0; // Parent is root
233 }
234
235 if ($fk_parent >= 0) {
236 $ecmdirtmp->ref = 'NOTUSEDYET';
237 $ecmdirtmp->label = dol_basename($dirdesc['fullname']);
238 $ecmdirtmp->description = '';
239 $ecmdirtmp->fk_parent = $fk_parent;
240
241 $txt = "We create directory ".$ecmdirtmp->label." with parent ".$fk_parent;
242 dol_syslog($txt);
243 //print $ecmdirtmp->cachenbofdoc."<br>\n";exit;
244 $id = $ecmdirtmp->create($user);
245 if ($id > 0) {
246 $newdirsql = array('id' => $id,
247 'id_mere' => $ecmdirtmp->fk_parent,
248 'label' => $ecmdirtmp->label,
249 'description' => $ecmdirtmp->description,
250 'fullrelativename' => $relativepathmissing);
251 $sqltree[] = $newdirsql; // We complete fulltree for following loops
252 //var_dump($sqltree);
253 $adirwascreated = 1;
254 } else {
255 dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR);
256 }
257 } else {
258 $txt = "Parent of ".$dirdesc['fullname']." not found";
259 dol_syslog($txt);
260 //print $txt."<br>\n";
261 }
262 }
263 }
264
265 // Loop now on each sql tree to check if dir exists
266 foreach ($sqltree as $dirdesc) { // Loop on each sqltree to check dir is on disk
267 $dirtotest = $conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
268 if (!dol_is_dir($dirtotest)) {
269 $ecmdirtmp->id = $dirdesc['id'];
270 $ecmdirtmp->delete($user, 'databaseonly');
271 //exit;
272 }
273 }
274
275 $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cache counting, we set to value -1 = "unknown"
276 dol_syslog("sql = ".$sql);
277 $db->query($sql);
278
279 // If a directory was added, the fulltree array is not correctly completed and sorted, so we clean
280 // it to be sure that fulltree array is not used without reloading it.
281 if ($adirwascreated) {
282 $sqltree = null;
283 }
284}
285
286
287
288/*
289 * View
290 */
291
292// Define height of file area (depends on $_SESSION["dol_screenheight"])
293//print $_SESSION["dol_screenheight"];
294$maxheightwin = (isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 466) ? ($_SESSION["dol_screenheight"] - 136) : 660; // Also into index.php file
295
296$moreheadcss = '';
297$moreheadjs = '';
298
299//$morejs=array();
300$morejs = array('includes/jquery/plugins/blockUI/jquery.blockUI.js', 'core/js/blockUI.js'); // Used by ecm/tpl/enabledfiletreeajax.tpl.pgp
301if (!getDolGlobalString('MAIN_ECM_DISABLE_JS')) {
302 $morejs[] = "includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js";
303}
304
305$moreheadjs .= '<script type="text/javascript">'."\n";
306$moreheadjs .= 'var indicatorBlockUI = \''.DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif".'\';'."\n";
307$moreheadjs .= '</script>'."\n";
308
309llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $morejs, '', 0, 0);
310
311
312// Add sections to manage
313$rowspan = 0;
314$sectionauto = array();
315if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) {
316 if (isModEnabled("product") || isModEnabled("service")) {
317 $langs->load("products");
318 $rowspan++;
319 $sectionauto[] = array('position' => 10, 'level' => 1, 'module' => 'product', 'test' => (isModEnabled("product") || isModEnabled("service")), 'label' => $langs->trans("ProductsAndServices"), 'desc' => $langs->trans("ECMDocsByProducts"));
320 }
321 if (isModEnabled("societe")) {
322 $rowspan++;
323 $sectionauto[] = array('position' => 20, 'level' => 1, 'module' => 'company', 'test' => isModEnabled('societe'), 'label' => $langs->trans("ThirdParties"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
324 }
325 if (isModEnabled("propal")) {
326 $rowspan++;
327 $sectionauto[] = array('position' => 30, 'level' => 1, 'module' => 'propal', 'test' => isModEnabled('propal'), 'label' => $langs->trans("Proposals"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
328 }
329 if (isModEnabled('contract')) {
330 $rowspan++;
331 $sectionauto[] = array('position' => 40, 'level' => 1, 'module' => 'contract', 'test' => isModEnabled('contract'), 'label' => $langs->trans("Contracts"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
332 }
333 if (isModEnabled('order')) {
334 $rowspan++;
335 $sectionauto[] = array('position' => 50, 'level' => 1, 'module' => 'order', 'test' => isModEnabled('order'), 'label' => $langs->trans("CustomersOrders"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
336 }
337 if (isModEnabled('invoice')) {
338 $rowspan++;
339 $sectionauto[] = array('position' => 60, 'level' => 1, 'module' => 'invoice', 'test' => isModEnabled('invoice'), 'label' => $langs->trans("CustomersInvoices"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
340 }
341 if (isModEnabled('supplier_proposal')) {
342 $langs->load("supplier_proposal");
343 $rowspan++;
344 $sectionauto[] = array('position' => 70, 'level' => 1, 'module' => 'supplier_proposal', 'test' => isModEnabled('supplier_proposal'), 'label' => $langs->trans("SupplierProposals"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
345 }
346 if (isModEnabled("supplier_order")) {
347 $rowspan++;
348 $sectionauto[] = array('position' => 80, 'level' => 1, 'module' => 'order_supplier', 'test' => isModEnabled("supplier_order"), 'label' => $langs->trans("SuppliersOrders"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("PurchaseOrders")));
349 }
350 if (isModEnabled("supplier_invoice")) {
351 $rowspan++;
352 $sectionauto[] = array('position' => 90, 'level' => 1, 'module' => 'invoice_supplier', 'test' => isModEnabled("supplier_invoice"), 'label' => $langs->trans("SuppliersInvoices"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
353 }
354 if (isModEnabled('tax')) {
355 $langs->load("compta");
356 $rowspan++;
357 $sectionauto[] = array('position' => 100, 'level' => 1, 'module' => 'tax', 'test' => isModEnabled('tax'), 'label' => $langs->trans("SocialContributions"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
358 $rowspan++;
359 $sectionauto[] = array('position' => 110, 'level' => 1, 'module' => 'tax-vat', 'test' => isModEnabled('tax'), 'label' => $langs->trans("VAT"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT")));
360 }
361 if (isModEnabled('salaries')) {
362 $langs->load("compta");
363 $rowspan++;
364 $sectionauto[] = array('position' => 120, 'level' => 1, 'module' => 'salaries', 'test' => isModEnabled('salaries'), 'label' => $langs->trans("Salaries"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries")));
365 }
366 if (isModEnabled('project')) {
367 $rowspan++;
368 $sectionauto[] = array('position' => 130, 'level' => 1, 'module' => 'project', 'test' => isModEnabled('project'), 'label' => $langs->trans("Projects"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
369 $rowspan++;
370 $sectionauto[] = array('position' => 140, 'level' => 1, 'module' => 'project_task', 'test' => isModEnabled('project'), 'label' => $langs->trans("Tasks"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
371 }
372 if (isModEnabled('intervention')) {
373 $langs->load("interventions");
374 $rowspan++;
375 $sectionauto[] = array('position' => 150, 'level' => 1, 'module' => 'fichinter', 'test' => isModEnabled('intervention'), 'label' => $langs->trans("Interventions"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
376 }
377 if (isModEnabled('expensereport')) {
378 $langs->load("trips");
379 $rowspan++;
380 $sectionauto[] = array('position' => 160, 'level' => 1, 'module' => 'expensereport', 'test' => isModEnabled('expensereport'), 'label' => $langs->trans("ExpenseReports"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
381 }
382 if (isModEnabled('holiday')) {
383 $langs->load("holiday");
384 $rowspan++;
385 $sectionauto[] = array('position' => 170, 'level' => 1, 'module' => 'holiday', 'test' => isModEnabled('holiday'), 'label' => $langs->trans("Holidays"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
386 }
387 if (isModEnabled("bank")) {
388 $langs->load("banks");
389 $rowspan++;
390 $sectionauto[] = array('position' => 180, 'level' => 1, 'module' => 'banque', 'test' => isModEnabled('bank'), 'label' => $langs->trans("BankAccount"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
391 $rowspan++;
392 $sectionauto[] = array('position' => 190, 'level' => 1, 'module' => 'chequereceipt', 'test' => isModEnabled('bank'), 'label' => $langs->trans("CheckReceipt"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt")));
393 }
394 if (isModEnabled('mrp')) {
395 $langs->load("mrp");
396 $rowspan++;
397 $sectionauto[] = array('position' => 200, 'level' => 1, 'module' => 'mrp-mo', 'test' => isModEnabled('mrp'), 'label' => $langs->trans("MOs"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
398 }
399 if (isModEnabled('recruitment')) {
400 $langs->load("recruitment");
401 $rowspan++;
402 $sectionauto[] = array('position' => 210, 'level' => 1, 'module' => 'recruitment-recruitmentcandidature', 'test' => isModEnabled('recruitment'), 'label' => $langs->trans("Candidatures"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
403 }
404 $rowspan++;
405 $sectionauto[] = array('position' => 220, 'level' => 1, 'module' => 'user', 'test' => 1, 'label' => $langs->trans("Users"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Users")));
406
407 $parameters = array();
408 $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
409 if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
410 $res = $hookmanager->resArray[0];
411 if (is_array($hookmanager->resArray[0])) {
412 $sectionauto = array_merge($sectionauto, $hookmanager->resArray);
413 $rowspan += count($hookmanager->resArray);
414 } else {
415 $sectionauto[] = $hookmanager->resArray;
416 $rowspan++;
417 }
418 }
419}
420
421$head = ecm_prepare_dasboard_head(null);
422print dol_get_fiche_head($head, 'index_auto', '', -1, '');
423
424
425
426// Confirm remove file (for non javascript users)
427if ($action == 'deletefile' && empty($conf->use_javascript_ajax)) {
428 print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 1);
429}
430
431// Start container of all panels
432?>
433<!-- Begin div id="containerlayout" -->
434<div id="containerlayout">
435<div id="ecm-layout-north" class="toolbar largebutton">
436<?php
437
438// Start top panel, toolbar
439print '<div class="inline-block toolbarbutton centpercent">';
440
441// Toolbar
442$url = ((!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_ECM_DISABLE_JS')) ? '#' : ($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module ? '&amp;module='.$module : '').($section ? '&amp;section='.$section : '')));
443print '<a href="'.$url.'" class="inline-block valignmiddle toolbarbutton paddingtop" title="'.dol_escape_htmltag($langs->trans('Refresh')).'">';
444print img_picto('', 'refresh', 'id="refreshbutton"', false, 0, 0, '', 'size15x marginrightonly');
445print '</a>';
446
447print '</div>';
448// End top panel, toolbar
449
450?>
451</div>
452<div id="ecm-layout-west" class="inline-block">
453<?php
454// Start left area
455
456
457// Confirmation de la suppression d'une ligne categorie
458if ($action == 'delete_section') {
459 print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $ecmdir->label), 'confirm_deletesection', '', '', 1);
460}
461// End confirm
462
463
464if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'deletefile') {
465 print '<table class="liste centpercent">'."\n";
466
467 print '<!-- Title for auto directories -->'."\n";
468 print '<tr class="liste_titre">'."\n";
469 print '<th class="liste_titre" align="left" colspan="6">';
470 print '&nbsp;'.$langs->trans("ECMSections");
471 print '</th></tr>';
472
473 $showonrightsize = '';
474 // Auto section
475 if (count($sectionauto)) {
476 $htmltooltip = $langs->trans("ECMAreaDesc2");
477 $htmltooltip .= '<br>'.$langs->trans("ECMAreaDesc2b");
478
479 $sectionauto = dol_sort_array($sectionauto, 'label', 'ASC', true, false);
480
481 print '<tr>';
482 print '<td colspan="6">';
483 print '<div id="filetreeauto" class="ecmfiletree"><ul class="ecmjqft">';
484
485 $nbofentries = 0;
486 $oldvallevel = 0;
487 foreach ($sectionauto as $key => $val) {
488 if (empty($val['test'])) {
489 continue; // If condition to show the ECM auto directory is ok
490 }
491
492 print '<li class="directory collapsed">';
493 print '<a class="fmdirlia jqft ecmjqft" href="'.$_SERVER["PHP_SELF"].'?module='.urlencode($val['module']).'">';
494 print $val['label'];
495 print '</a>';
496
497 print '<div class="ecmjqft">';
498 // Info
499 $htmltooltip = '<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
500 $htmltooltip .= '<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionAuto").'<br>';
501 $htmltooltip .= '<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto").'<br>';
502 $htmltooltip .= '<b>'.$langs->trans("Description").'</b>: '.$val['desc'];
503 print $form->textwithpicto('', $htmltooltip, 1, 'info');
504 print '</div>';
505
506 print '</li>';
507
508 $nbofentries++;
509 }
510
511 print '</ul></div></td></tr>';
512 }
513
514 print "</table>";
515}
516
517
518// End left panel
519?>
520</div>
521<div id="ecm-layout-center" class="inline-block">
522<div class="pane-in ecm-in-layout-center">
523<div id="ecmfileview" class="ecmfileview">
524<?php
525// Start right panel
526
527$mode = 'noajax';
528$url = DOL_URL_ROOT.'/ecm/index_auto.php';
529include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php';
530
531
532// End right panel
533?>
534</div>
535</div>
536
537</div>
538</div> <!-- End div id="containerlayout" -->
539<?php
540// End of page
541
542if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_ECM_DISABLE_JS')) {
543 include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php';
544}
545
546
547print dol_get_fiche_end();
548
549llxFooter();
550
551$db->close();
llxFooter()
Empty footer.
Definition wrapper.php:69
print $object position
Definition edit.php:195
Class to manage ECM directories.
Class to manage generation of HTML components Only common components must be here.
Class to manage Dolibarr users.
dol_basename($pathfile)
Make a basename working with all page code (default PHP basenamed fails with cyrillic).
Definition files.lib.php:38
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_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:63
dol_is_dir($folder)
Test if filename is a directory.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
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_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db user
Active Directory does not allow anonymous connections.
Definition repair.php:141
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.