Fix: Simplif du retour creation categorie
This commit is contained in:
parent
3ffe25a633
commit
001d4e99f6
@ -34,6 +34,8 @@ require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php");
|
|||||||
|
|
||||||
$langs->load("categories");
|
$langs->load("categories");
|
||||||
|
|
||||||
|
$mesg=isset($_GET["mesg"])?'<div class="ok">'.$_GET["mesg"].'</div>':'';
|
||||||
|
|
||||||
if ($_REQUEST["socid"])
|
if ($_REQUEST["socid"])
|
||||||
{
|
{
|
||||||
$type = 'societe';
|
$type = 'societe';
|
||||||
@ -51,7 +53,6 @@ else
|
|||||||
// Sécurité d'accès client et commerciaux
|
// Sécurité d'accès client et commerciaux
|
||||||
$objectid = restrictedArea($user, $type, $objectid);
|
$objectid = restrictedArea($user, $type, $objectid);
|
||||||
|
|
||||||
$mesg = '';
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -70,7 +70,6 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
|
|||||||
header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?socid='.$idCompanyOrigin);
|
header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?socid='.$idCompanyOrigin);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$categorie = new Categorie($db);
|
$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"));
|
llxHeader("","",$langs->trans("Categories"));
|
||||||
$html = new Form($db);
|
$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)
|
if ($user->rights->categorie->creer)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -21,7 +21,7 @@ ViewCat=Visualisation de la cat
|
|||||||
NewCat=Nouvelle catégorie
|
NewCat=Nouvelle catégorie
|
||||||
NewCategory=Nouvelle catégorie
|
NewCategory=Nouvelle catégorie
|
||||||
ModifCat=Modifier une catégorie
|
ModifCat=Modifier une catégorie
|
||||||
CatCreated=Catégorie ajoutée
|
CatCreated=Catégorie créée
|
||||||
CreateCat=Ajouter une catégorie
|
CreateCat=Ajouter une catégorie
|
||||||
CreateThisCat=Ajouter cette catégorie
|
CreateThisCat=Ajouter cette catégorie
|
||||||
ValidateFields=Valider les champs
|
ValidateFields=Valider les champs
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user