Fix: meilleur visualisation des types de catégorie

This commit is contained in:
Regis Houssin 2007-11-10 12:51:57 +00:00
parent bc0b10f5a8
commit a1c9025602
6 changed files with 42 additions and 13 deletions

View File

@ -726,7 +726,7 @@ class Categorie
{ {
if ($url == '') 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."&amp;type=".$cat->type."'>".$cat->label."</a>";
} }
else else
{ {

View File

@ -28,7 +28,7 @@
\brief Page accueil espace categories \brief Page accueil espace categories
*/ */
require "./pre.inc.php"; require("./pre.inc.php");
$type=$_GET['type']; $type=$_GET['type'];

View File

@ -1,7 +1,8 @@
<?php <?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org> /* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net> * 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 * 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 * it under the terms of the GNU General Public License as published by
@ -25,7 +26,7 @@
\version $Revision$ \version $Revision$
*/ */
require "./pre.inc.php"; require("./pre.inc.php");
if ($_REQUEST['id'] == "") if ($_REQUEST['id'] == "")
{ {
@ -85,7 +86,11 @@ $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $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 else
{ {
print "<tr><td>".$langs->trans ("NoProd")."</td></tr>"; print "<tr><td>".$langs->trans("ThisCategoryHasNoProduct")."</td></tr>";
} }
print "</table>\n"; print "</table>\n";
} }
@ -257,7 +262,7 @@ if($c->type == 1)
} }
else else
{ {
print "<tr><td>".$langs->trans ("NoProd")."</td></tr>"; print "<tr><td>".$langs->trans ("ThisCategoryHasNoSupplier")."</td></tr>";
} }
print "</table>\n"; print "</table>\n";
} }
@ -274,7 +279,7 @@ if($c->type == 2)
{ {
print "<br>"; print "<br>";
print "<table class='noborder' width='100%'>\n"; 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) if (sizeof ($socs) > 0)
{ {
@ -294,7 +299,7 @@ if($c->type == 2)
} }
else else
{ {
print "<tr><td>".$langs->trans ("NoProd")."</td></tr>"; print "<tr><td>".$langs->trans("ThisCategoryHasNoCustomer")."</td></tr>";
} }
print "</table>\n"; print "</table>\n";
} }

View File

@ -232,10 +232,18 @@ class MenuLeft {
$newmenu->add_submenu(DOL_URL_ROOT."/contact/fiche.php?leftmenu=contacts&amp;action=create", $langs->trans("NewContact"), 1, $user->rights->societe->contact->creer); $newmenu->add_submenu(DOL_URL_ROOT."/contact/fiche.php?leftmenu=contacts&amp;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); $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) if ($conf->categorie->enabled)
{ {
$langs->load("categories"); $langs->load("categories");
$newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&amp;type=2", $langs->trans("Categories"), 0, $user->rights->categorie->lire); // Catégories fournisseurs
$newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&amp;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&amp;type=1", $langs->trans("NewCat"), 1, $user->rights->categorie->creer);
}
// Catégories clients
$newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&amp;type=2", $langs->trans("CustomersCategoriesShort"), 0, $user->rights->categorie->lire);
if ($user->societe_id == 0) if ($user->societe_id == 0)
{ {
$newmenu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&amp;type=2", $langs->trans("NewCat"), 1, $user->rights->categorie->creer); $newmenu->add_submenu(DOL_URL_ROOT."/categories/fiche.php?action=create&amp;type=2", $langs->trans("NewCat"), 1, $user->rights->categorie->creer);

View File

@ -27,7 +27,6 @@ CreateThisCat=Create this category
ValidateFields=Validate the fields ValidateFields=Validate the fields
NoSubCat=No subcategory. NoSubCat=No subcategory.
SubCatOf=Subcategory SubCatOf=Subcategory
NoProd=This category does not contain any product.
FoundCats=Found categories FoundCats=Found categories
FoundCatsForName=Categories found for the name : FoundCatsForName=Categories found for the name :
FoundSubCatsIn=Subcategories found in the category FoundSubCatsIn=Subcategories found in the category
@ -59,3 +58,12 @@ CategoriesTree=Categories tree
DeleteCategory=Delete category DeleteCategory=Delete category
ConfirmDeleteCategory=Are you sure you want to delete this category ? ConfirmDeleteCategory=Are you sure you want to delete this category ?
NoCategoriesDefined=No category defined 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.

View File

@ -27,7 +27,6 @@ CreateThisCat=Ajouter cette cat
ValidateFields=Valider les champs ValidateFields=Valider les champs
NoSubCat=Cette catégorie ne contient aucune sous-catégorie. NoSubCat=Cette catégorie ne contient aucune sous-catégorie.
SubCatOf=Sous-catégorie SubCatOf=Sous-catégorie
NoProd=Cette catégorie ne contient aucun produit.
FoundCats=Catégories trouvées FoundCats=Catégories trouvées
FoundCatsForName=Catégories trouvées pour le nom : FoundCatsForName=Catégories trouvées pour le nom :
FoundSubCatsIn=Sous-catégories trouvées dans la catégorie 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 CategoriesTree=Arbre des catégories
DeleteCategory=Supprimer categorie DeleteCategory=Supprimer categorie
ConfirmDeleteCategory=Etes vous sur de vouloir supprimer cette catégorie ? ConfirmDeleteCategory=Etes vous sur de vouloir supprimer cette catégorie ?
NoCategoriesDefined=Aucune catégorie définie 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.