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