Fix filemanager

This commit is contained in:
Laurent Destailleur 2017-12-27 20:17:08 +01:00
parent 6f107e3fee
commit 8388858715
6 changed files with 21 additions and 7 deletions

View File

@ -1236,7 +1236,7 @@ class FormFile
print "</table>";
print '</div>';
if (! $editline && $nboflines > 1) {
if (! $editline && $nboflines > 1 && is_object($object)) {
if (! empty($conf->use_javascript_ajax) && $permtoeditline) {
$table_element_line = 'ecm_files';
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';

View File

@ -21,7 +21,7 @@
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
print "Error, template page filemanager.tpl.php can't be called as URL";
exit;
}
@ -204,7 +204,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg
$mode='noajax';
if (empty($url)) $url=DOL_URL_ROOT.'/ecm/index.php';
include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php';
include DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php';
// End right panel

View File

@ -111,6 +111,7 @@ if ($action == 'add' && $user->rights->ecm->setup)
$label = trim(GETPOST("label", 'alpha'));
$desc = trim(GETPOST("desc", 'alpha'));
$catParent = GETPOST("catParent", 'alpha'); // Can be an int (with ECM) or a string (with generic filemanager)
if ($catParent == '-1') $catParent=0;
$error=0;

View File

@ -139,11 +139,23 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
// Remove dir
if ($action == 'confirm_deletedir' && $confirm == 'yes')
{
// Fetch was already done
$result=$ecmdir->delete($user);
$backtourl = DOL_URL_ROOT."/ecm/index.php";
if ($module == 'medias') $backtourl = DOL_URL_ROOT."/website/index.php?file_manager=1";
if ($module == 'ecm')
{
// Fetch was already done
$result=$ecmdir->delete($user);
}
else
{
$resbool = dol_delete_dir($upload_dir);
if ($resbool) $result = 1;
else $result = 0;
}
if ($result > 0)
{
header("Location: ".DOL_URL_ROOT."/ecm/index.php");
header("Location: ".$backtourl);
exit;
}
else

View File

@ -20,7 +20,7 @@
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
print "Error, template enablefiletreeajax.tpl.php can't be called as URL";
exit;
}

View File

@ -2020,6 +2020,7 @@ if ($action == 'editfile' || $action == 'file_manager')
include DOL_DOCUMENT_ROOT.'/core/tpl/filemanager.tpl.php';
print '</div>';
}
if ($action == 'editmenu')