diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index b0f5c89f66d..9bdf51d701e 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -93,34 +93,12 @@ if (preg_match('/\.\./',$upload_dir) || preg_match('/[<>|]/',$upload_dir)) } - /* * Action */ -/* - if ($action == 'remove_file') // Remove a file -{ -clearstatcache(); +// None -dol_syslog(__FILE__." remove $original_file $urlsource", LOG_DEBUG); - -// This test should be useless. We keep it to find bug more easily -if (! file_exists($original_file_osencoded)) -{ -dol_print_error(0,$langs->trans("ErrorFileDoesNotExists",$_GET["file"])); -exit; -} - -dol_delete_file($original_file); - -dol_syslog(__FILE__." back to ".urldecode($urlsource), LOG_DEBUG); - -header("Location: ".urldecode($urlsource)); - -return; -} -*/ /* @@ -260,6 +238,7 @@ if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE if ($section) { require_once(DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'); + $useglobalvars=1; $form = new Form($db); $formquestion=array('urlfile'=>array('type'=>'hidden','value'=>'','name'=>'urlfile')); print $form->formconfirm(DOL_URL_ROOT.'/ecm/index.php'.($param?'?':'').(preg_replace('/^&/','',$param)),$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",'deletefile'); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 72f3c809d2d..d0f621fd09b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2143,6 +2143,7 @@ class Form function formconfirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500) { global $langs,$conf; + global $useglobalvars; $more=''; $formconfirm=''; @@ -2241,13 +2242,13 @@ class Form } } - // New code using jQuery only + // Show JQuery confirm box. Note that global var $useglobalvars is used inside this template include(DOL_DOCUMENT_ROOT.'/core/tpl/ajax/formconfirm.tpl.php'); } else { $formconfirm.= "\n\n"; - + $formconfirm.= '
\n"; $formconfirm.= '