Skip to content

Commit

Permalink
Fix filemanager
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 27, 2017
1 parent 6f107e3 commit 8388858
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/class/html.formfile.class.php
Expand Up @@ -1236,7 +1236,7 @@ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownlo
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';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/tpl/filemanager.tpl.php
Expand Up @@ -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;
}

Expand Down Expand Up @@ -204,7 +204,7 @@

$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
Expand Down
1 change: 1 addition & 0 deletions htdocs/ecm/dir_add_card.php
Expand Up @@ -111,6 +111,7 @@
$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;

Expand Down
18 changes: 15 additions & 3 deletions htdocs/ecm/dir_card.php
Expand Up @@ -139,11 +139,23 @@
// 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
Expand Down
2 changes: 1 addition & 1 deletion htdocs/ecm/tpl/enablefiletreeajax.tpl.php
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions htdocs/website/index.php
Expand Up @@ -2020,6 +2020,7 @@
include DOL_DOCUMENT_ROOT.'/core/tpl/filemanager.tpl.php';

print '</div>';

}

if ($action == 'editmenu')
Expand Down

0 comments on commit 8388858

Please sign in to comment.