2
0
forked from Wavyzz/dolibarr

Fix: stock message in session and reload the page for avoid url problem

with jQuery fileupload
This commit is contained in:
Regis Houssin
2012-05-31 17:48:03 +02:00
parent 7ed980fab5
commit 4deeb20dd8
8 changed files with 80 additions and 11 deletions

View File

@@ -41,6 +41,13 @@ $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'];
@@ -119,7 +126,9 @@ 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);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}