';
- print '';
- print '| '.$langs->trans("Label").' | ';
- if ($_error == 1)
- {
- print $lang->trans("ErrCatAlreadyExists");
- }
- print' |
';
- print '| '.$langs->trans("Description").' | ';
- print ' |
';
- print '| ';
- print $langs->trans("AddIn").' ';
- print $html->select_nombre_sous_categorie($nbcats,"choix").' ';
- print $langs->trans("categories");
- print ' | ';
- print '';
- print ' |
';
- print $html->select_all_categories($nbcats);
- print '| ';
- print '';
- print ' |
';
-
- }
-
-
-/*
- * Action confirmation de création de la catégorie
- */
-
- if ($_GET["action"] == 'confirmed')
- {
- print_titre($langs->trans("CatCreated"));
-
- print '';
- print '| ';
-
- if ($_error == 3)
+ if ($_GET["action"] == 'create' || $_POST["addcat"] == 'addcat')
{
- print ' '.$langs->trans("ImpossibleAddCat").' '.$categorie->label.' ';
+ print ' |
';
/*
-
- 1 && sizeof (array_unique ($cats_meres)) != sizeof ($cats_meres))
- { // alors il y a des valeurs en double
- echo "".$langs->trans ("ErrSameCatSelected")."
";
- $OK = false;
- }
+ $cat_mere)
- {
- if ($cat_mere == -1)
- {
- echo "".$langs->trans ("ErrForgotCat")." ".($nb+1)."
";
- $OK = false;
- }
- }
-
- // si les champs de description sont mal renseignés
- if ($_POST["nom"] == '')
- {
- echo "".$langs->trans ("ErrForgotField")." \"".$langs->trans ("Label")."\"
";
- $OK = false;
- }
- else if ($categorie->already_exists($_POST["nom"],$cat_mere)) // on regarde si le nom n'existe pas déjà en tant que catégorie ou sous-catégorie
- {
- echo "".$langs->trans ("ErrCatAlreadyExists")."
";
- $OK = false;
- }
+$cats_meres = isset ($_REQUEST['catsMeres']) ? $_REQUEST['catsMeres'] : array ();
- if ($_POST["description"] == '')
- {
- echo "".$langs->trans ("ErrForgotField")." \"".$langs->trans ("Description")."\"
";
- $OK = false;
- }
-
- // vérification pour savoir si tous les champs sont corrects
- if ($OK)
- {
- $nom = htmlspecialchars(stripslashes($_REQUEST['nom']) ,ENT_QUOTES);
- $description = htmlspecialchars(stripslashes($_REQUEST['description']),ENT_QUOTES);
- // creation de champs caches pour etre appele dans la classe de traitement
- ?>
-
- $cat_mere)
+{
+if ($cat_mere == -1)
+{
+echo "".$langs->trans ("ErrForgotCat")." ".($nb+1)."
";
+$OK = false;
+}
+}
+
+// si les champs de description sont mal renseignés
+if ($_POST["nom"] == '')
+{
+echo "".$langs->trans ("ErrForgotField")." \"".$langs->trans ("Label")."\"
";
+$OK = false;
+}
+else if ($categorie->already_exists($_POST["nom"],$cat_mere)) // on regarde si le nom n'existe pas déjà en tant que catégorie ou sous-catégorie
+{
+echo "".$langs->trans ("ErrCatAlreadyExists")."
";
+$OK = false;
+}
+
+if ($_POST["description"] == '')
+{
+echo "".$langs->trans ("ErrForgotField")." \"".$langs->trans ("Description")."\"
";
+$OK = false;
+}
+
+// vérification pour savoir si tous les champs sont corrects
+if ($OK)
+{
+$nom = htmlspecialchars(stripslashes($_REQUEST['nom']) ,ENT_QUOTES);
+$description = htmlspecialchars(stripslashes($_REQUEST['description']),ENT_QUOTES);
+// creation de champs caches pour etre appele dans la classe de traitement
+?>
+
+close();
-llxFooter("Dernière modification $Date$ révision $Revision$");
+llxFooter('$Date$ - $Revision$');
?>
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index b5c051cb1ca..2df8463b82a 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -18,8 +18,6 @@
require "./pre.inc.php";
-llxHeader ("","",$langs->trans("Categories"));
-
if ($_REQUEST['id'] == "")
{
dolibarr_print_error ();
@@ -28,11 +26,17 @@ if ($_REQUEST['id'] == "")
$c = new Categorie ($db, $_REQUEST['id']);
-print_titre ($langs->trans("Categorie")." ".$c->label);
-?>
-
-
-trans("Categories"));
+
+print_fiche_titre($langs->trans("Categorie")." ".$c->label);
+
+print '';
+print '';
$ways = $c->print_all_ways ();
print "";
@@ -46,26 +50,31 @@ $cats = $c->get_filles ();
if ($cats < 0)
{
- dolibarr_print_error();
-}
-else if (sizeof ($cats) > 0)
-{
- print " \n";
- print "| ".$langs->trans("SubCats")." | \n";
-
- foreach ($cats as $cat)
- {
- $i++;
- print "\t\n";
- print "\t\t| ".$cat->label." | \n";
- print "\t\t".$cat->description." | \n";
- print "\t \n";
- }
- print " \n \n";
+ dolibarr_print_error();
}
else
{
- print " ".$langs->trans("NoSubCat")." ";
+ print " ";
+ print " \n";
+ print "| ".$langs->trans("SubCats")." | \n";
+ if (sizeof ($cats) > 0)
+ {
+ $var=true;
+ foreach ($cats as $cat)
+ {
+ $i++;
+ $var=!$var;
+ print "\t\n";
+ print "\t\t| ".$cat->label." | \n";
+ print "\t\t".$cat->description." | \n";
+ print "\t \n";
+ }
+ }
+ else
+ {
+ print "| ".$langs->trans("NoSubCat")." | ";
+ }
+ print " \n";
}
$i = 0;
@@ -76,33 +85,44 @@ if ($prods < 0)
{
dolibarr_print_error();
}
-else if (sizeof ($prods) > 0)
-{
- print " \n";
- print "| ".$langs->trans("Products")." | \n";
-
- foreach ($prods as $prod)
- {
- $i++;
- print "\t\n";
- print "\t\t| ".$prod->libelle." | \n";
- print "\t\t".$prod->description." | \n";
- print "\t \n";
- }
- print " \n";
-}
else
{
- print " ".$langs->trans ("NoProd")." ";
+ print " ";
+ print " \n";
+ print "| ".$langs->trans("ProductsAndServices")." | \n";
+
+ if (sizeof ($prods) > 0)
+ {
+ $var=true;
+ foreach ($prods as $prod)
+ {
+ $i++;
+ $var=!$var;
+ print "\t\n";
+ print "\t\t| ".$prod->libelle." | \n";
+ print "\t\t".$prod->description." | \n";
+ print "\t \n";
+ }
+ }
+ else
+ {
+ print "| ".$langs->trans ("NoProd")." | ";
+ }
+ print " \n";
}
+/*
+ * Boutons actions
+ */
print " ";
+
+
print ' | ';
$db->close();
-llxFooter("Dernière modification $Date$ révision $Revision$");
+llxFooter('$Date$ - $Revision$');
?>
diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang
index efd6b122df8..33f47b28c16 100644
--- a/htdocs/langs/en_US/categories.lang
+++ b/htdocs/langs/en_US/categories.lang
@@ -32,4 +32,5 @@ AddProductToCat=Add this product to a category?
ImpossibleAddCat=Impossible to add the category
ImpossibleAssociateCategory=Impossible to associate the category to
WasAddedSuccessfully=was added successfully.
-ProductIsInCategories=Product/Service is in following categories
\ No newline at end of file
+ProductIsInCategories=Product/Service is in following categories
+ClassifyInCategory=Classify in category
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang
index f9f654e626b..fba0b4ed409 100644
--- a/htdocs/langs/fr_FR/categories.lang
+++ b/htdocs/langs/fr_FR/categories.lang
@@ -33,3 +33,4 @@ ImpossibleAddCat=Impossible d'ajouter la cat
ImpossibleAssociateCategory=Impossible d'associer la catégorie à
WasAddedSuccessfully=a été ajoutée avec succès.
ProductIsInCategories=Ce produit/service est dans les catégorie suivantes
+ClassifyInCategory=Classer dans la catégorie
|