diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 208300601e3..9651c3a5f99 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -34,6 +34,8 @@ require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); $langs->load("categories"); +$mesg=isset($_GET["mesg"])?'
'.$_GET["mesg"].'
':''; + if ($_REQUEST["socid"]) { $type = 'societe'; @@ -51,7 +53,6 @@ else // Sécurité d'accès client et commerciaux $objectid = restrictedArea($user, $type, $objectid); -$mesg = ''; /* diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 3cdacf1e212..77de3fa32dc 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -70,7 +70,6 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?socid='.$idCompanyOrigin); exit; } - } $categorie = new Categorie($db); @@ -104,42 +103,29 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) } } +if ($_POST["action"] == 'add' && $user->rights->categorie->creer) +{ + // Action confirmation de création de la catégorie + if ($_GET["action"] == 'confirmed') + { + if ($idProdOrigin) + { + header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?id='.$idProdOrigin.'&mesg='.urlencode($langs->trans("CatCreated"))); + exit; + } + if ($idSupplierOrigin || $idCompanyOrigin) + { + header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?socid='.$idCompanyOrigin.'&mesg='.urlencode($langs->trans("CatCreated"))); + exit; + } + } +} + llxHeader("","",$langs->trans("Categories")); $html = new Form($db); -if ($_POST["action"] == 'add' && $user->rights->categorie->creer) -{ - /* - * Action confirmation de création de la catégorie - */ - - if ($_GET["action"] == 'confirmed') - { - print_titre($langs->trans("NewCategory")); - print '
'; - - print ''; - print '
'; - - print '
'.$langs->trans("CategorySuccessfullyCreated",$categorie->label).'
'; - print '
'; - - if ($idProdOrigin) - { - print ''.$langs->trans("ReturnInProduct").''; - } - if ($idSupplierOrigin || $idCompanyOrigin) - { - print ''.$langs->trans("ReturnInCompany").''; - } - - print '
'; - } -} - - if ($user->rights->categorie->creer) { /* diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 19e4749f681..ac019da69d4 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -21,7 +21,7 @@ ViewCat=Visualisation de la cat NewCat=Nouvelle catégorie NewCategory=Nouvelle catégorie ModifCat=Modifier une catégorie -CatCreated=Catégorie ajoutée +CatCreated=Catégorie créée CreateCat=Ajouter une catégorie CreateThisCat=Ajouter cette catégorie ValidateFields=Valider les champs