Fix: Simplif du retour creation categorie

This commit is contained in:
Laurent Destailleur 2007-11-12 22:13:15 +00:00
parent 3ffe25a633
commit 001d4e99f6
3 changed files with 21 additions and 34 deletions

View File

@ -34,6 +34,8 @@ require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php");
$langs->load("categories");
$mesg=isset($_GET["mesg"])?'<div class="ok">'.$_GET["mesg"].'</div>':'';
if ($_REQUEST["socid"])
{
$type = 'societe';
@ -51,7 +53,6 @@ else
// Sécurité d'accès client et commerciaux
$objectid = restrictedArea($user, $type, $objectid);
$mesg = '';
/*

View File

@ -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 '<br>';
print '<table class="notopnoleft" width="100%">';
print '<tr><td valign="top" class="notopnoleft" width="30%">';
print '<div class="ok">'.$langs->trans("CategorySuccessfullyCreated",$categorie->label).'</div>';
print '<br>';
if ($idProdOrigin)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$idProdOrigin.'">'.$langs->trans("ReturnInProduct").'</a>';
}
if ($idSupplierOrigin || $idCompanyOrigin)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/categories/categorie.php?socid='.$idCompanyOrigin.'">'.$langs->trans("ReturnInCompany").'</a>';
}
print '</td></tr></table>';
}
}
if ($user->rights->categorie->creer)
{
/*

View File

@ -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