From 00098feb5856a0a4b28b58ca859cc62b38e07d0e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 5 Dec 2007 14:11:44 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20retour=20sur=20la=20fiche=20cat=E9gorie?= =?UTF-8?q?=20apr=E8s=20sa=20cr=E9ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/categories/fiche.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 77de3fa32dc..9f4dc200a66 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -94,11 +94,11 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) if ($categorie->error =="") { - if ($categorie->create() > 0) + $result = $categorie->create(); + if ($result > 0) { $_GET["action"] = 'confirmed'; $_POST["addcat"] = ''; - } } } @@ -113,11 +113,16 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?id='.$idProdOrigin.'&mesg='.urlencode($langs->trans("CatCreated"))); exit; } - if ($idSupplierOrigin || $idCompanyOrigin) + else if ($idSupplierOrigin || $idCompanyOrigin) { header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?socid='.$idCompanyOrigin.'&mesg='.urlencode($langs->trans("CatCreated"))); exit; } + else + { + header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$result.'&type='.$_POST["type"]); + exit; + } } }