index_auto.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. <?php
  2. /* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2008-2010 Regis Houssin <regis.houssin@capnetworks.com>
  4. * Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
  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 <http://www.gnu.org/licenses/>.
  18. */
  19. /**
  20. * \file htdocs/ecm/index_auto.php
  21. * \ingroup ecm
  22. * \brief Main page for ECM section area
  23. */
  24. if (! defined('REQUIRE_JQUERY_LAYOUT')) define('REQUIRE_JQUERY_LAYOUT','1');
  25. if (! defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1);
  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. // Load traductions files
  33. $langs->load("ecm");
  34. $langs->load("companies");
  35. $langs->load("other");
  36. $langs->load("users");
  37. $langs->load("orders");
  38. $langs->load("propal");
  39. $langs->load("bills");
  40. $langs->load("contracts");
  41. // Security check
  42. if ($user->societe_id) $socid=$user->societe_id;
  43. $result = restrictedArea($user, 'ecm', 0);
  44. // Get parameters
  45. $socid=GETPOST('socid','int');
  46. $action=GETPOST('action','aZ09');
  47. $section=GETPOST("section")?GETPOST("section","int"):GETPOST("section_id","int");
  48. $module=GETPOST("module");
  49. if (! $section) $section=0;
  50. $section_dir=GETPOST('section_dir');
  51. $sortfield = GETPOST("sortfield",'alpha');
  52. $sortorder = GETPOST("sortorder",'alpha');
  53. $page = GETPOST("page",'int');
  54. if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
  55. $offset = $conf->liste_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. $ecmdir = new EcmDirectory($db);
  62. if ($section)
  63. {
  64. $result=$ecmdir->fetch($section);
  65. if (! $result > 0)
  66. {
  67. dol_print_error($db,$ecmdir->error);
  68. exit;
  69. }
  70. }
  71. $form=new Form($db);
  72. $ecmdirstatic = new EcmDirectory($db);
  73. $userstatic = new User($db);
  74. $error=0;
  75. /*
  76. * Actions
  77. */
  78. // Upload file
  79. if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
  80. {
  81. // Define relativepath and upload_dir
  82. $relativepath='';
  83. if ($ecmdir->id) $relativepath=$ecmdir->getRelativePath();
  84. else $relativepath=$section_dir;
  85. $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
  86. if (empty($_FILES['userfile']['tmp_name']))
  87. {
  88. $error++;
  89. setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors');
  90. }
  91. if (! $error)
  92. {
  93. if (dol_mkdir($upload_dir) >= 0)
  94. {
  95. $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']);
  96. if (is_numeric($resupload) && $resupload > 0)
  97. {
  98. $result=$ecmdir->changeNbOfFiles('+');
  99. }
  100. else
  101. {
  102. $langs->load("errors");
  103. if ($resupload < 0) // Unknown error
  104. {
  105. setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
  106. }
  107. else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
  108. {
  109. setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
  110. }
  111. else // Known error
  112. {
  113. setEventMessages($langs->trans($resupload), null, 'errors');
  114. }
  115. }
  116. }
  117. else
  118. {
  119. $langs->load("errors");
  120. setEventMessages($langs->trans("ErrorFailToCreateDir",$upload_dir), null, 'errors');
  121. }
  122. }
  123. }
  124. // Add directory
  125. if ($action == 'add' && $user->rights->ecm->setup)
  126. {
  127. $ecmdir->ref = 'NOTUSEDYET';
  128. $ecmdir->label = GETPOST("label");
  129. $ecmdir->description = GETPOST("desc");
  130. $id = $ecmdir->create($user);
  131. if ($id > 0)
  132. {
  133. header("Location: ".$_SERVER["PHP_SELF"]);
  134. exit;
  135. }
  136. else
  137. {
  138. //TODO: Translate
  139. setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors');
  140. $action = "create";
  141. }
  142. clearstatcache();
  143. }
  144. // Remove file
  145. if ($action == 'confirm_deletefile')
  146. {
  147. if (GETPOST('confirm') == 'yes')
  148. {
  149. $langs->load("other");
  150. if ($section)
  151. {
  152. $result=$ecmdir->fetch($section);
  153. if (! ($result > 0))
  154. {
  155. dol_print_error($db,$ecmdir->error);
  156. exit;
  157. }
  158. $relativepath=$ecmdir->getRelativePath();
  159. }
  160. else $relativepath='';
  161. $upload_dir = $conf->ecm->dir_output.($relativepath?'/'.$relativepath:'');
  162. $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
  163. $ret=dol_delete_file($file);
  164. if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
  165. else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
  166. $result=$ecmdir->changeNbOfFiles('-');
  167. clearstatcache();
  168. }
  169. $action='file_manager';
  170. }
  171. // Remove directory
  172. if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
  173. {
  174. $result=$ecmdir->delete($user);
  175. setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs');
  176. clearstatcache();
  177. }
  178. // Refresh directory view
  179. if ($action == 'refreshmanual')
  180. {
  181. $ecmdirtmp = new EcmDirectory($db);
  182. // This part of code is same than into file ecm/ajax/ecmdatabase.php TODO Remove duplicate
  183. clearstatcache();
  184. $diroutputslash=str_replace('\\','/',$conf->ecm->dir_output);
  185. $diroutputslash.='/';
  186. // Scan directory tree on disk
  187. $disktree=dol_dir_list($conf->ecm->dir_output,'directories',1,'','^temp$','','',0);
  188. // Scan directory tree in database
  189. $sqltree=$ecmdirstatic->get_full_arbo(0);
  190. $adirwascreated=0;
  191. // Now we compare both trees to complete missing trees into database
  192. //var_dump($disktree);
  193. //var_dump($sqltree);
  194. foreach($disktree as $dirdesc) // Loop on tree onto disk
  195. {
  196. $dirisindatabase=0;
  197. foreach($sqltree as $dirsqldesc)
  198. {
  199. if ($conf->ecm->dir_output.'/'.$dirsqldesc['fullrelativename'] == $dirdesc['fullname'])
  200. {
  201. $dirisindatabase=1;
  202. break;
  203. }
  204. }
  205. if (! $dirisindatabase)
  206. {
  207. $txt="Directory found on disk ".$dirdesc['fullname'].", not found into database so we add it";
  208. dol_syslog($txt);
  209. //print $txt."<br>\n";
  210. // We must first find the fk_parent of directory to create $dirdesc['fullname']
  211. $fk_parent=-1;
  212. $relativepathmissing=str_replace($diroutputslash,'',$dirdesc['fullname']);
  213. $relativepathtosearchparent=$relativepathmissing;
  214. //dol_syslog("Try to find parent id for directory ".$relativepathtosearchparent);
  215. if (preg_match('/\//',$relativepathtosearchparent))
  216. //while (preg_match('/\//',$relativepathtosearchparent))
  217. {
  218. $relativepathtosearchparent=preg_replace('/\/[^\/]*$/','',$relativepathtosearchparent);
  219. $txt="Is relative parent path ".$relativepathtosearchparent." for ".$relativepathmissing." found in sql tree ?";
  220. dol_syslog($txt);
  221. //print $txt." -> ";
  222. $parentdirisindatabase=0;
  223. foreach($sqltree as $dirsqldesc)
  224. {
  225. if ($dirsqldesc['fullrelativename'] == $relativepathtosearchparent)
  226. {
  227. $parentdirisindatabase=$dirsqldesc['id'];
  228. break;
  229. }
  230. }
  231. if ($parentdirisindatabase > 0)
  232. {
  233. dol_syslog("Yes with id ".$parentdirisindatabase);
  234. //print "Yes with id ".$parentdirisindatabase."<br>\n";
  235. $fk_parent=$parentdirisindatabase;
  236. //break; // We found parent, we can stop the while loop
  237. }
  238. else
  239. {
  240. dol_syslog("No");
  241. //print "No<br>\n";
  242. }
  243. }
  244. else
  245. {
  246. dol_syslog("Parent is root");
  247. $fk_parent=0; // Parent is root
  248. }
  249. if ($fk_parent >= 0)
  250. {
  251. $ecmdirtmp->ref = 'NOTUSEDYET';
  252. $ecmdirtmp->label = dol_basename($dirdesc['fullname']);
  253. $ecmdirtmp->description = '';
  254. $ecmdirtmp->fk_parent = $fk_parent;
  255. $txt="We create directory ".$ecmdirtmp->label." with parent ".$fk_parent;
  256. dol_syslog($txt);
  257. //print $ecmdirtmp->cachenbofdoc."<br>\n";exit;
  258. $id = $ecmdirtmp->create($user);
  259. if ($id > 0)
  260. {
  261. $newdirsql=array('id'=>$id,
  262. 'id_mere'=>$ecmdirtmp->fk_parent,
  263. 'label'=>$ecmdirtmp->label,
  264. 'description'=>$ecmdirtmp->description,
  265. 'fullrelativename'=>$relativepathmissing);
  266. $sqltree[]=$newdirsql; // We complete fulltree for following loops
  267. //var_dump($sqltree);
  268. $adirwascreated=1;
  269. }
  270. else
  271. {
  272. dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR);
  273. }
  274. }
  275. else {
  276. $txt="Parent of ".$dirdesc['fullname']." not found";
  277. dol_syslog($txt);
  278. //print $txt."<br>\n";
  279. }
  280. }
  281. }
  282. // Loop now on each sql tree to check if dir exists
  283. foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
  284. {
  285. $dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
  286. if (! dol_is_dir($dirtotest))
  287. {
  288. $ecmdirtmp->id=$dirdesc['id'];
  289. $ecmdirtmp->delete($user,'databaseonly');
  290. //exit;
  291. }
  292. }
  293. $sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
  294. dol_syslog("sql = ".$sql);
  295. $db->query($sql);
  296. // If a directory was added, the fulltree array is not correctly completed and sorted, so we clean
  297. // it to be sure that fulltree array is not used without reloading it.
  298. if ($adirwascreated) $sqltree=null;
  299. }
  300. /*
  301. * View
  302. */
  303. // Define height of file area (depends on $_SESSION["dol_screenheight"])
  304. //print $_SESSION["dol_screenheight"];
  305. $maxheightwin=(isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 466)?($_SESSION["dol_screenheight"]-136):660; // Also into index.php file
  306. $morejs=array();
  307. if (empty($conf->global->MAIN_ECM_DISABLE_JS)) $morejs=array("/includes/jquery/plugins/jqueryFileTree/jqueryFileTree.js");
  308. llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECMArea"),'','','','',$morejs,'',0,0);
  309. // Add sections to manage
  310. $rowspan=0;
  311. $sectionauto=array();
  312. if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
  313. {
  314. 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")); }
  315. if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); }
  316. if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
  317. if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
  318. if (! empty($conf->commande->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
  319. if (! empty($conf->facture->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
  320. if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
  321. if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
  322. 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("ECMDocsBySocialContributions")); }
  323. if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); }
  324. 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("ECMDocsByInterventions")); }
  325. 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("ECMDocsByExpenseReports")); }
  326. $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsByUsers"));
  327. }
  328. //print load_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"));
  329. $helptext1=''; $helptext2='';
  330. $helptext1.=$langs->trans("ECMAreaDesc");
  331. $helptext1.=$langs->trans("ECMAreaDesc2");
  332. $helptext2.=$langs->trans("ECMAreaDesc");
  333. $helptext2.=$langs->trans("ECMAreaDesc2");
  334. // Confirm remove file (for non javascript users)
  335. if ($action == 'delete' && empty($conf->use_javascript_ajax))
  336. {
  337. print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
  338. }
  339. //if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden';
  340. //else $classviewhide='visible';
  341. $classviewhide='inline-block';
  342. $head = ecm_prepare_dasboard_head('');
  343. dol_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"), 1, '');
  344. // Start container of all panels
  345. ?>
  346. <!-- Begin div id="containerlayout" -->
  347. <div id="containerlayout">
  348. <div id="ecm-layout-north" class="toolbar largebutton">
  349. <?php
  350. // Start top panel, toolbar
  351. print '<div class="toolbarbutton">';
  352. // Toolbar
  353. $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:'')));
  354. print '<a href="'.$url.'" class="toolbarbutton" title="'.dol_escape_htmltag($langs->trans('Refresh')).'">';
  355. print '<img id="refreshbutton" class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/view-refresh.png">';
  356. print '</a>';
  357. print '</div>';
  358. // End top panel, toolbar
  359. ?>
  360. </div>
  361. <div id="ecm-layout-west" class="<?php echo $classviewhide; ?>">
  362. <?php
  363. // Start left area
  364. // Confirmation de la suppression d'une ligne categorie
  365. if ($action == 'delete_section')
  366. {
  367. print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
  368. }
  369. // End confirm
  370. if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete')
  371. {
  372. print '<table width="100%" class="liste noborderbottom">'."\n";
  373. print '<!-- Title for auto directories -->'."\n";
  374. print '<tr class="liste_titre">'."\n";
  375. print '<th class="liste_titre" align="left" colspan="6">';
  376. print '&nbsp;'.$langs->trans("ECMSections");
  377. print '</th></tr>';
  378. $showonrightsize='';
  379. // Auto section
  380. if (count($sectionauto))
  381. {
  382. $htmltooltip=$langs->trans("ECMAreaDesc2");
  383. $sectionauto=dol_sort_array($sectionauto,'label','ASC',true,false);
  384. print '<tr>';
  385. print '<td colspan="6">';
  386. print '<div id="filetreeauto" class="ecmfiletree"><ul class="ecmjqft">';
  387. $nbofentries=0;
  388. $oldvallevel=0;
  389. foreach ($sectionauto as $key => $val)
  390. {
  391. if (empty($val['test'])) continue; // If condition to show is ok
  392. $var=false;
  393. print '<li class="directory collapsed">';
  394. if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))
  395. {
  396. print '<a class="fmdirlia jqft ecmjqft" href="'.$_SERVER["PHP_SELF"].'?module='.$val['module'].'">';
  397. print $val['label'];
  398. print '</a>';
  399. }
  400. else
  401. {
  402. print '<a class="fmdirlia jqft ecmjqft" href="'.$_SERVER["PHP_SELF"].'?module='.$val['module'].'">';
  403. print $val['label'];
  404. print '</a>';
  405. }
  406. print '<div class="ecmjqft">';
  407. // Info
  408. $htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
  409. $htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionAuto").'<br>';
  410. $htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto").'<br>';
  411. $htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['desc'];
  412. print $form->textwithpicto('', $htmltooltip, 1, 'info');
  413. print '</div>';
  414. print '</li>';
  415. $nbofentries++;
  416. }
  417. print '</ul></div></td></tr>';
  418. }
  419. print "</table>";
  420. }
  421. // End left banner
  422. ?>
  423. </div>
  424. <div id="ecm-layout-center" class="<?php echo $classviewhide; ?>">
  425. <div class="pane-in ecm-in-layout-center">
  426. <div id="ecmfileview" class="ecmfileview">
  427. <?php
  428. // Start right panel
  429. $mode='noajax';
  430. $url=DOL_URL_ROOT.'/ecm/index_auto.php';
  431. include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php';
  432. // End right panel
  433. ?>
  434. </div>
  435. </div>
  436. </div>
  437. </div> <!-- End div id="containerlayout" -->
  438. <?php
  439. // End of page
  440. dol_fiche_end(1);
  441. if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) {
  442. include DOL_DOCUMENT_ROOT.'/ecm/tpl/enablefiletreeajax.tpl.php';
  443. }
  444. llxFooter();
  445. $db->close();