diff --git a/htdocs/categories/categorie.class.php b/htdocs/categories/categorie.class.php index 34dd1b16d350f2043f8e017e4b69e3a61f01d68f..81e1de175e8fdd9e1b277bfc6db222b91e2f9668 100644 --- a/htdocs/categories/categorie.class.php +++ b/htdocs/categories/categorie.class.php @@ -726,7 +726,7 @@ class Categorie { if ($url == '') { - $w[] = "<a href='".DOL_URL_ROOT."/categories/viewcat.php?id=".$cat->id."'>".$cat->label."</a>"; + $w[] = "<a href='".DOL_URL_ROOT."/categories/viewcat.php?id=".$cat->id."&type=".$cat->type."'>".$cat->label."</a>"; } else { diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 599b0f6b1c55ffbdc9ae948abd65d94fc71b3647..a5bef2cbf418f55dcc4a18aa60c454303535a97c 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -28,7 +28,7 @@ \brief Page accueil espace categories */ -require "./pre.inc.php"; +require("./pre.inc.php"); $type=$_GET['type']; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 4488971eb62f55a7a68f663e4a327b3854d9b7b9..c537acacd6b51e5e1fb3b35b13ccfce7494a292c 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -1,7 +1,8 @@ <?php /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> * Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> + * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> + * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +26,7 @@ \version $Revision$ */ -require "./pre.inc.php"; +require("./pre.inc.php"); if ($_REQUEST['id'] == "") { @@ -85,7 +86,11 @@ $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; -dolibarr_fiche_head($head, 'card', $langs->trans("Category")); +if ($type == 0) $title=$langs->trans("ProductsCategoryShort"); +if ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); +if ($type == 2) $title=$langs->trans("CustomersCategoryShort"); + +dolibarr_fiche_head($head, 'card', $title); /* @@ -220,7 +225,7 @@ if($c->type == 0) } else { - print "<tr><td>".$langs->trans ("NoProd")."</td></tr>"; + print "<tr><td>".$langs->trans("ThisCategoryHasNoProduct")."</td></tr>"; } print "</table>\n"; } @@ -257,7 +262,7 @@ if($c->type == 1) } else { - print "<tr><td>".$langs->trans ("NoProd")."</td></tr>"; + print "<tr><td>".$langs->trans ("ThisCategoryHasNoSupplier")."</td></tr>"; } print "</table>\n"; } @@ -274,7 +279,7 @@ if($c->type == 2) { print "<br>"; print "<table class='noborder' width='100%'>\n"; - print "<tr class='liste_titre'><td>".$langs->trans("Commercial")."</td></tr>\n"; + print "<tr class='liste_titre'><td>".$langs->trans("Customers")."</td></tr>\n"; if (sizeof ($socs) > 0) { @@ -294,7 +299,7 @@ if($c->type == 2) } else { - print "<tr><td>".$langs->trans ("NoProd")."</td></tr>"; + print "<tr><td>".$langs->trans("ThisCategoryHasNoCustomer")."</td></tr>"; } print "</table>\n"; } diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index f1e7b02b84e50a57fbb1af02c0ec1612f3e1a172..4d36cb1bda9f465916374b9b4c495f743bc6de75 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -232,10 +232,18 @@ class MenuLeft { $newmenu->add_submenu(DOL_URL_ROOT."/contact/fiche.php?leftmenu=contacts&action=create", $langs->trans("NewContact"), 1, $user->rights->societe->contact->creer); $newmenu->add_submenu(DOL_URL_ROOT."/contact/index.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); + // Cat�gories if ($conf->categorie->enabled) { $langs->load("categories"); - $newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&type=2", $langs->trans("Categories"), 0, $user->rights->categorie->lire); + // Cat�gories fournisseurs + $newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire); + if ($user->societe_id == 0) + { + $newmenu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&type=1", $langs->trans("NewCat"), 1, $user->rights->categorie->creer); + } + // Cat�gories clients + $newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&type=2", $langs->trans("CustomersCategoriesShort"), 0, $user->rights->categorie->lire); if ($user->societe_id == 0) { $newmenu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&type=2", $langs->trans("NewCat"), 1, $user->rights->categorie->creer); diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 27227106bf29273c8ffca1315b340a681811fb48..c9bc28bc8bf15438667a62a2bc199a51779c43fd 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -27,7 +27,6 @@ CreateThisCat=Create this category ValidateFields=Validate the fields NoSubCat=No subcategory. SubCatOf=Subcategory -NoProd=This category does not contain any product. FoundCats=Found categories FoundCatsForName=Categories found for the name : FoundSubCatsIn=Subcategories found in the category @@ -59,3 +58,12 @@ CategoriesTree=Categories tree DeleteCategory=Delete category ConfirmDeleteCategory=Are you sure you want to delete this category ? NoCategoriesDefined=No category defined +SuppliersCategoryShort=Suppliers category +CustomersCategoryShort=Customers category +ProductsCategoryShort=Products category +SuppliersCategoriesShort=Suppliers categories +CustomersCategoriesShort=Customers categories +ProductsCategoriesShort=Products categories +ThisCategoryHasNoProduct=This category does not contain any product. +ThisCategoryHasNoSupplier=This category does not contain any supplier. +ThisCategoryHasNoCustomer=This category does not contain any customer. \ No newline at end of file diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 241742b34f9a6b1b9b1f8a89ed84221a946bde8d..600000a0811d0d3e8e5dceedd89df11dc23fa1f6 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -27,7 +27,6 @@ CreateThisCat=Ajouter cette cat ValidateFields=Valider les champs NoSubCat=Cette cat�gorie ne contient aucune sous-cat�gorie. SubCatOf=Sous-cat�gorie -NoProd=Cette cat�gorie ne contient aucun produit. FoundCats=Cat�gories trouv�es FoundCatsForName=Cat�gories trouv�es pour le nom : FoundSubCatsIn=Sous-cat�gories trouv�es dans la cat�gorie @@ -58,4 +57,13 @@ ContentsNotVisibleByAllShort=Contenu non visible par tous CategoriesTree=Arbre des cat�gories DeleteCategory=Supprimer categorie ConfirmDeleteCategory=Etes vous sur de vouloir supprimer cette cat�gorie ? -NoCategoriesDefined=Aucune cat�gorie d�finie \ No newline at end of file +NoCategoriesDefined=Aucune cat�gorie d�finie +SuppliersCategoryShort=Cat�gorie fournisseurs +CustomersCategoryShort=Cat�gorie clients +ProductsCategoryShort=Cat�gorie produits +SuppliersCategoriesShort=Cat�gories fournisseurs +CustomersCategoriesShort=Cat�gories clients +ProductsCategoriesShort=Cat�gories produits +ThisCategoryHasNoProduct=Cette cat�gorie ne contient aucun produit. +ThisCategoryHasNoSupplier=Cette cat�gorie ne contient aucun fournisseur. +ThisCategoryHasNoCustomer=Cette cat�gorie ne contient aucun client. \ No newline at end of file