diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 9107b604e80..90e5bc1521f 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -268,7 +268,7 @@ if ($type == 'directory')
if ($module == 'medias')
{
- $useinecm = 0;
+ $useinecm = 2;
$modulepart='medias';
$perm=($user->rights->website->write || $user->rights->emailing->creer);
$title='none';
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 2a514f65f1f..bc162abd170 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -917,6 +917,7 @@ class FormFile
* @param int $useinecm Change output for use in ecm module:
* 0: Add a previw link. Show also rename and crop file
* 1: Add link to edit ECM entry
+ * 2: Add rename and crop file
* @param string $textifempty Text to show if filearray is empty ('NoFileFound' if not defined)
* @param int $maxlength Maximum length of file name shown.
* @param string $title Title before list. Use 'none' to disable title.
@@ -1128,11 +1129,11 @@ class FormFile
// Delete or view link
// ($param must start with &)
print '
';
- if ($useinecm)
+ if ($useinecm == 1)
{
print ''.img_view('default', 0, 'class="paddingrightonly"').'';
}
- else
+ if (! $useinecm || $useinecm == 2)
{
$newmodulepart=$modulepart;
if (in_array($modulepart, array('product','produit','service'))) $newmodulepart='produit|service';
@@ -1151,7 +1152,7 @@ class FormFile
if ($permtoeditline)
{
- print ''.img_edit('default',0,'class="paddingrightonly"').'';
+ print ''.img_edit('default',0,'class="paddingrightonly"').'';
}
}
if ($permonobject)
diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php
index c133e0014f1..d3b3db60ef8 100644
--- a/htdocs/core/js/lib_foot.js.php
+++ b/htdocs/core/js/lib_foot.js.php
@@ -58,7 +58,11 @@ if (empty($conf->dol_no_mouse_hover))
return $(this).prop(\'title\'); /* To force to get title as is */
}
});
- jQuery(".classfortooltiponclicktext").dialog({ closeOnEscape: true, classes: { "ui-dialog": "highlight" }, maxHeight: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? 400 : 700).', autoOpen: false }).css("z-index: 5000");
+ jQuery(".classfortooltiponclicktext").dialog(
+ { closeOnEscape: true, classes: { "ui-dialog": "highlight" },
+ maxHeight: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? 400 : 700).',
+ modal: true,
+ autoOpen: false }).css("z-index: 5000");
jQuery(".classfortooltiponclick").click(function () {
console.log("We click on tooltip for element with dolid="+$(this).attr(\'dolid\'));
if ($(this).attr(\'dolid\'))
diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php
index b3b9fa528e0..2fa84f8b96d 100644
--- a/htdocs/ecm/docdir.php
+++ b/htdocs/ecm/docdir.php
@@ -42,8 +42,10 @@ $langs->load("categories");
if (! $user->rights->ecm->setup) accessforbidden();
// Get parameters
-$socid = GETPOST('socid','int');
-$action=GETPOST('action','alpha');
+$socid = GETPOST('socid','int');
+$action = GETPOST('action','alpha');
+$cancel = GETPOST('cancel', 'aZ09');
+$backtopage = GETPOST('backtopage', 'alpha');
$confirm=GETPOST('confirm','alpha');
// Security check
@@ -86,11 +88,20 @@ if (! empty($section))
// Action ajout d'un produit ou service
if ($action == 'add' && $user->rights->ecm->setup)
{
- if (! empty($_POST["cancel"]))
+ if ($cancel)
{
- header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager');
- exit;
+ if (! empty($backtopage))
+ {
+ header("Location: ".$backtopage);
+ exit;
+ }
+ else
+ {
+ header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager');
+ exit;
+ }
}
+
$ecmdir->ref = trim($_POST["ref"]);
$ecmdir->label = trim($_POST["label"]);
$ecmdir->description = trim($_POST["desc"]);
@@ -150,10 +161,11 @@ if ($action == 'create')
print ' |