diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index b838294770b..cc7a4cda3b7 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -39,13 +39,7 @@ $langs->load('other'); $id=GETPOST('id','int'); $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); - -$mesg=''; -if (isset($_SESSION['DolMessage'])) -{ - $mesg=$_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} +$mesg = ""; // Security check if ($user->societe_id > 0) @@ -120,9 +114,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $langs->load("other"); $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). dol_delete_file($file); - $_SESSION['DolMessage'] = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; } diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index f908f92bd89..f14d9670b38 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -39,13 +39,6 @@ $confirm = GETPOST('confirm'); $id = GETPOST('id','int'); $ref = GETPOST('ref'); -$mesg=''; -if (isset($_SESSION['DolMessage'])) -{ - $mesg=$_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} - // Security check if ($user->societe_id) { @@ -127,9 +120,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). dol_delete_file($file,0,0,0,$object); - $_SESSION['DolMessage'] = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; } } diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 0002771ee7d..f9497759637 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -40,13 +40,6 @@ $confirm = GETPOST('confirm'); $id = GETPOST('id','int'); $ref = GETPOST('ref'); -$mesg=''; -if (isset($_SESSION['DolMessage'])) -{ - $mesg=$_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} - // Security check if ($user->societe_id) { @@ -66,6 +59,7 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; + $object = new Commande($db); @@ -129,9 +123,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). dol_delete_file($file,0,0,0,$object); - $_SESSION['DolMessage'] = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; } } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index b191b2f3fe6..0dc0bb17ab9 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -43,13 +43,6 @@ $confirm = GETPOST('confirm'); $id = GETPOST('facid','int'); $ref = GETPOST('ref'); -$mesg=''; -if (isset($_SESSION['DolMessage'])) -{ - $mesg=$_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} - // Security check if ($user->societe_id) { @@ -132,9 +125,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). dol_delete_file($file,0,0,0,$object); - $_SESSION['DolMessage'] = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; } } diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 07f0f2e354d..d5fe4ac022a 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -41,13 +41,6 @@ $langs->load('deliveries'); $langs->load('products'); $langs->load('stocks'); -$mesg=''; -if (isset($_SESSION['DolMessage'])) -{ - $mesg=$_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} - // Security check $id=empty($_GET['id']) ? 0 : intVal($_GET['id']); $action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action']) : $_GET['action']; @@ -126,9 +119,7 @@ if ($action=='delete') $upload_dir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($commande->ref); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). dol_delete_file($file); - $_SESSION['DolMessage'] = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index aa70351fdde..39ae5148024 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -38,13 +38,6 @@ $mine = $_REQUEST['mode']=='mine' ? 1 : 0; $id = GETPOST('id','int'); $ref= GETPOST('ref'); -$mesg=''; -if (isset($_SESSION['DolMessage'])) -{ - $mesg=$_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} - $project = new Project($db); if (! $project->fetch($id,$ref) > 0) { @@ -122,9 +115,7 @@ if ($action == 'confirm_delete' && $_REQUEST['confirm'] == 'yes' && $user->right $upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($project->ref); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). dol_delete_file($file); - $_SESSION['DolMessage'] = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 1cb227795de..03a56cf6d73 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -44,13 +44,6 @@ $ref= GETPOST('ref','alpha'); $withproject=GETPOST('withproject','int'); $project_ref = GETPOST('project_ref','alpha'); -$mesg=''; -if (isset($_SESSION['DolMessage'])) -{ - $mesg=$_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} - // Security check $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; @@ -123,9 +116,7 @@ if ($action=='delete') $langs->load("other"); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). dol_delete_file($file); - $_SESSION['DolMessage'] = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; } // Retreive First Task ID of Project if withprojet is on to allow project prev next to work diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index a0a10011946..d37ced68e01 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -33,19 +33,13 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load("companies"); $langs->load('other'); +$mesg=''; $action=GETPOST('action'); $confirm=GETPOST('confirm'); $id=(GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int')); $ref = GETPOST('ref', 'alpha'); -$mesg=''; -if (isset($_SESSION['DolMessage'])) -{ - $mesg=$_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); -} - // Security check if ($user->societe_id > 0) { @@ -131,9 +125,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). dol_delete_file($file,0,0,0,$object); - $_SESSION['DolMessage'] = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); - exit; + $mesg = '
'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'
'; } }