From 8246e1de5c2df9a5cb202a60b205cbcab414a78a Mon Sep 17 00:00:00 2001 From: ywarnier Date: Sat, 31 May 2008 17:44:38 +0000 Subject: [PATCH] Minor - improve coherence of delete messages in products/services (same as companies) --- htdocs/product/fiche.php | 14 ++++++-------- htdocs/product/liste.php | 6 ++++++ 2 files changed, 12 insertions(+), 8 deletions(-) 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:"";