diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php
index 120cee81bb7..e128a495712 100644
--- a/htdocs/product/fiche.php
+++ b/htdocs/product/fiche.php
@@ -236,23 +236,21 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer)
/*
* Suppression d'un produit/service pas encore affect
*/
-if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes' && $user->rights->produit->supprimer)
+if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes' && $user->rights->produit->supprimer)
{
$product = new Product($db);
- $product->fetch($_GET["id"]);
- $result = $product->delete($_GET["id"]);
+ $product->fetch($_GET['id']);
+ $result = $product->delete($_GET['id']);
if ($result == 0)
{
- llxHeader();
- print '
'.$langs->trans("ProductDeleted",$product->ref).'
';
- llxFooter();
- exit ;
+ Header('Location: '.DOL_URL_ROOT.'/product/liste.php?delprod='.$product->ref);
+ exit;
}
else
{
$reload = 0;
- $_GET["action"]='';
+ $_GET['action']='';
}
}
diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php
index 807ca5e3341..a630523ace4 100644
--- a/htdocs/product/liste.php
+++ b/htdocs/product/liste.php
@@ -171,6 +171,12 @@ if ($resql)
llxHeader("","",$texte);
+ // Displays product removal confirmation
+ if (!empty($_GET['delprod']))
+ {
+ print ''.$langs->trans("ProductDeleted",$_GET['delprod']).'
';
+ }
+
$param="&sref=".$sref."&snom=".$snom."&sall=".$sall."&envente=".$_POST["envente"];
$param.="&fourn_id=".$fourn_id;
$param.=isset($type)?"&type=".$type:"";