Minor - improve coherence of delete messages in products/services (same as companies)

This commit is contained in:
ywarnier 2008-05-31 17:44:38 +00:00
parent 433be914bf
commit 8246e1de5c
2 changed files with 12 additions and 8 deletions

View File

@ -236,23 +236,21 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer)
/* /*
* Suppression d'un produit/service pas encore affect * 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 = new Product($db);
$product->fetch($_GET["id"]); $product->fetch($_GET['id']);
$result = $product->delete($_GET["id"]); $result = $product->delete($_GET['id']);
if ($result == 0) if ($result == 0)
{ {
llxHeader(); Header('Location: '.DOL_URL_ROOT.'/product/liste.php?delprod='.$product->ref);
print '<div class="ok">'.$langs->trans("ProductDeleted",$product->ref).'</div>'; exit;
llxFooter();
exit ;
} }
else else
{ {
$reload = 0; $reload = 0;
$_GET["action"]=''; $_GET['action']='';
} }
} }

View File

@ -171,6 +171,12 @@ if ($resql)
llxHeader("","",$texte); llxHeader("","",$texte);
// Displays product removal confirmation
if (!empty($_GET['delprod']))
{
print '<div class="warning">'.$langs->trans("ProductDeleted",$_GET['delprod']).'</div><br />';
}
$param="&amp;sref=".$sref."&amp;snom=".$snom."&amp;sall=".$sall."&amp;envente=".$_POST["envente"]; $param="&amp;sref=".$sref."&amp;snom=".$snom."&amp;sall=".$sall."&amp;envente=".$_POST["envente"];
$param.="&amp;fourn_id=".$fourn_id; $param.="&amp;fourn_id=".$fourn_id;
$param.=isset($type)?"&amp;type=".$type:""; $param.=isset($type)?"&amp;type=".$type:"";