';
if ($permtoadd) {
@@ -482,8 +482,8 @@ if ($action != 'edit' && $action != 'delete') {
}
// Confirm remove file
-if ($action == 'delete') {
- print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST("section", 'alpha').'&urlfile='.urlencode($_GET["urlfile"]).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
+if ($action == 'deletefile') {
+ print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST("section", 'alpha')).'&urlfile='.urlencode(GETPOST("urlfile")).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
}
// Confirm remove file
@@ -498,7 +498,7 @@ if ($action == 'delete_dir') {
);
}
- print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST('section', 'alpha').($module ? '&module='.$module : '').($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $relativepathwithoutslash), 'confirm_deletedir', $formquestion, 1, 1);
+ print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST('section', 'alpha')).($module ? '&module='.$module : '').($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $relativepathwithoutslash), 'confirm_deletedir', $formquestion, 1, 1);
}
diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php
index 44bc91e387e..e38c3caf3f3 100644
--- a/htdocs/ecm/file_card.php
+++ b/htdocs/ecm/file_card.php
@@ -411,8 +411,8 @@ if ($action == 'edit') {
}
-// Confirmation de la suppression d'une ligne categorie
-if ($action == 'delete_file') {
+// Confirm deletion of a file
+if ($action == 'deletefile') {
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($section), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile', $urlfile), 'confirm_deletefile', '', 1, 1);
}
@@ -426,7 +426,7 @@ if ($action != 'edit') {
/*
if ($user->rights->ecm->setup)
{
- print '
'.$langs->trans('Delete').'';
+ print '
'.$langs->trans('Delete').'';
}
else
{
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index d54dcf14d1e..f4df5a954a8 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -376,7 +376,7 @@ print dol_get_fiche_head($head, 'index_auto', '', -1, '');
// Confirm remove file (for non javascript users)
-if ($action == 'delete' && empty($conf->use_javascript_ajax)) {
+if ($action == 'deletefile' && empty($conf->use_javascript_ajax)) {
print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 1);
}
@@ -413,7 +413,7 @@ if ($action == 'delete_section') {
// End confirm
-if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'delete') {
+if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $action) || $action == 'deletefile') {
print '
'."\n";
print ''."\n";
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index aa792e0c9d7..9a6c20392a9 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -239,7 +239,7 @@ $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
$formfile = new FormFile($db);
-$param = '§ion='.$section;
+$param = '§ion='.urlencode($section);
$textifempty = ($section ? $langs->trans("NoFileFound") : $langs->trans("ECMSelectASection"));
$formfile->list_of_documents($filearray, '', 'ecm', $param, 1, $relativepath, $user->rights->ecm->upload, 1, $textifempty);
diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
index 197d995a808..6397a333fb0 100644
--- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
+++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
@@ -78,13 +78,14 @@ $(document).ready(function() {
$('#refreshbutton').click( function() {
console.log("Click on refreshbutton");
$.pleaseBePatient("trans('PleaseBePatient'); ?>");
- $.get( "", {
- action: "build",
- element: "ecm"
+ $.get("", {
+ action: 'build',
+ token: '',
+ element: 'ecm'
},
function(response) {
$.unblockUI();
- location.href="";
+ location.href='';
});
});
});
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 4e21887ff04..9139141c283 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -1231,7 +1231,7 @@ if ($action == 'confirm_deletesite' && $confirm == 'yes' && $permissiontodelete)
}
// Delete page (from website page menu)
-if (GETPOSTISSET('pageid') && $action == 'delete' && $permissiontodelete) {
+if (GETPOSTISSET('pageid') && $action == 'delete' && $permissiontodelete && !GETPOST('file_manager')) {
$error = 0;
$db->begin();