début restructuration du code des catégories
This commit is contained in:
parent
0d06037203
commit
d6454f3a07
@ -41,12 +41,10 @@ else
|
|||||||
$nbcats = 1;
|
$nbcats = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxHeader("","",$langs->trans("Categories"));
|
llxHeader("","",$langs->trans("Categories"));
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action création du produit
|
* Action création du produit
|
||||||
*/
|
*/
|
||||||
@ -69,12 +67,62 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
|
|||||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||||
print '<textarea name="description" rows="6" cols="50"';
|
print '<textarea name="description" rows="6" cols="50"';
|
||||||
print '</textarea></td></tr>';
|
print '</textarea></td></tr>';
|
||||||
print "<tr><td>";
|
print '<tr><td>';
|
||||||
print $langs->trans("AddIn").' ';
|
print $langs->trans("AddIn").' ';
|
||||||
print $langs->trans("Categories").' ';
|
print $html->select_nombre_sous_categorie($nbcats,"choix").' ';
|
||||||
print $html->select_nombre_sous_categorie($nbcats,"choix");
|
print $langs->trans("categories");
|
||||||
print '</td><td></td></tr>';
|
print '</td><td>';
|
||||||
|
print '<input type="submit" value="'.$langs->trans("modify").'" name="ok" />';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Affichage page accueil
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($_GET["action"] == 'confirmed' && $$user->rights->produit->creer)
|
||||||
|
{
|
||||||
|
print_titre($langs->trans("CatCreated"));
|
||||||
|
|
||||||
|
print '<table border="0" width="100%">';
|
||||||
|
print '<tr><td valign="top" width="30%">';
|
||||||
|
|
||||||
|
$categorie = new Categorie($db);
|
||||||
|
|
||||||
|
$categorie->label = $_REQUEST["nom"];
|
||||||
|
$categorie->description = $_REQUEST["description"];
|
||||||
|
|
||||||
|
$cats_meres = isset($_REQUEST['cats_meres']) ? $_REQUEST['cats_meres'] : array();
|
||||||
|
|
||||||
|
$res = $categorie->create();
|
||||||
|
|
||||||
|
if ($res < 0)
|
||||||
|
{
|
||||||
|
print '<p>'.$langs->trans("ImpossibleAddCat").' '.$categorie->label.'</p>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<p>'.$langs->trans("TheCategorie").' '.$categorie->label.' '.$langs->trans("WasAddedSuccessfully").'</p>';
|
||||||
|
|
||||||
|
foreach ($cats_meres as $id)
|
||||||
|
{
|
||||||
|
$mere = new Categorie($db, $id);
|
||||||
|
$res = $mere->add_fille($categorie);
|
||||||
|
|
||||||
|
if ($res < 0)
|
||||||
|
{
|
||||||
|
print '<p>'.$langs->trans("TheCategorie").' '.$mere->label.' ('.$res.').</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td></tr></table>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
/*
|
/*
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
# Dolibarr language file - en_US - categories
|
# Dolibarr language file - en_US - categories
|
||||||
Categorie=Category
|
Categorie=Category
|
||||||
Categories=categories
|
categories=categories
|
||||||
|
TheCategorie=The catégorie
|
||||||
In=In
|
In=In
|
||||||
AddIn=Add in
|
AddIn=Add in
|
||||||
modify=modify
|
modify=modify
|
||||||
@ -27,4 +28,7 @@ ErrSameCatSelected=You selected the same category several times
|
|||||||
ErrForgotCat=You forgot to choose the category
|
ErrForgotCat=You forgot to choose the category
|
||||||
ErrForgotField=You forgot to inform the fields
|
ErrForgotField=You forgot to inform the fields
|
||||||
ErrCatAlreadyExists=This name is already used
|
ErrCatAlreadyExists=This name is already used
|
||||||
AddProductToCat=Add this product to a category?
|
AddProductToCat=Add this product to a category?
|
||||||
|
ImpossibleAddCat=Impossible to add the category
|
||||||
|
ImpossibleAssociateCategory=Impossible to associate the category to
|
||||||
|
WasAddedSuccessfully=was added successfully.
|
||||||
@ -1,6 +1,7 @@
|
|||||||
# Dolibarr language file - fr_FR - categories
|
# Dolibarr language file - fr_FR - categories
|
||||||
Categorie=Catégorie
|
Categorie=Catégorie
|
||||||
Categories=catégorie(s)
|
categories=catégorie(s)
|
||||||
|
TheCategorie=La catégorie
|
||||||
In=Dans
|
In=Dans
|
||||||
AddIn=Ajouter dans
|
AddIn=Ajouter dans
|
||||||
modify=modifier
|
modify=modifier
|
||||||
@ -28,3 +29,6 @@ ErrForgotCat=Vous avez oubli
|
|||||||
ErrForgotField=Vous avez oublié de renseigner le champs
|
ErrForgotField=Vous avez oublié de renseigner le champs
|
||||||
ErrCatAlreadyExists=Ce nom est déjà utilisé
|
ErrCatAlreadyExists=Ce nom est déjà utilisé
|
||||||
AddProductToCat=Ajouter ce produit à une catégorie ?
|
AddProductToCat=Ajouter ce produit à une catégorie ?
|
||||||
|
ImpossibleAddCat=Impossible d'ajouter la catégorie
|
||||||
|
ImpossibleAssociateCategory=Impossible d'associer la catégorie ŕ
|
||||||
|
WasAddedSuccessfully=a été ajoutée avec succčs.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user