From 7ba8f383483c9f935e51b8af830afa3c3869c624 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Mar 2010 00:16:31 +0000 Subject: [PATCH] New: Enhancement in category module --- htdocs/categories/categorie.php | 115 +++++++++++++++++++++++--------- htdocs/lib/member.lib.php | 2 +- 2 files changed, 84 insertions(+), 33 deletions(-) diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index a7beeb47f7f..67af3432a17 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -266,50 +266,101 @@ if ($_GET["socid"]) } else if ($_GET["id"] || $_GET["ref"]) { - /* - * Fiche categorie de produit - */ - require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); - require_once(DOL_DOCUMENT_ROOT."/product.class.php"); + if ($_GET["type"] == 0) + { + /* + * Fiche categorie de produit + */ + require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); + require_once(DOL_DOCUMENT_ROOT."/product.class.php"); - // Produit - $product = new Product($db); - if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); - if ($_GET["id"]) $result = $product->fetch($_GET["id"]); + // Produit + $product = new Product($db); + if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); + if ($_GET["id"]) $result = $product->fetch($_GET["id"]); - llxHeader("","",$langs->trans("CardProduct".$product->type)); + llxHeader("","",$langs->trans("CardProduct".$product->type)); - $head=product_prepare_head($product, $user); - $titre=$langs->trans("CardProduct".$product->type); - $picto=($product->type==1?'service':'product'); - dol_fiche_head($head, 'category', $titre,0,$picto); + $head=product_prepare_head($product, $user); + $titre=$langs->trans("CardProduct".$product->type); + $picto=($product->type==1?'service':'product'); + dol_fiche_head($head, 'category', $titre,0,$picto); - print ''; - print ""; - // Reference - print ''; - print ''; + print '
'.$langs->trans("Ref").''; - print $html->showrefnav($product,'ref','',1,'ref'); - print '
'; + print ""; + // Reference + print ''; + print ''; - // Libelle - print ''; - print ''; + // Libelle + print ''; + print ''; - // Statut - print ''; + // Statut + print ''; - print '
'.$langs->trans("Ref").''; + print $html->showrefnav($product,'ref','',1,'ref'); + print '
'.$langs->trans("Label").''.$product->libelle.'
'.$langs->trans("Label").''.$product->libelle.'
'.$langs->trans("Status").''; - print $product->getLibStatut(2); - print '
'.$langs->trans("Status").''; + print $product->getLibStatut(2); + print '
'; + print ''; - print ''; + print ''; - if ($mesg) print($mesg); + if ($mesg) print($mesg); - formCategory($db,$product,0); + formCategory($db,$product,0); + } + + if ($_GET["type"] == 3) + { + /* + * Fiche categorie d'adherent + */ + require_once(DOL_DOCUMENT_ROOT."/lib/member.lib.php"); + require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); + + // Produit + $member = new Adherent($db); + if ($_GET["ref"]) $result = $member->fetch('',$_GET["ref"]); + if ($_GET["id"]) $result = $member->fetch($_GET["id"]); + + llxHeader("","",$langs->trans("CardMember")); + + + $head=member_prepare_head($product, $user); + $titre=$langs->trans("CardMember"); + $picto='member'; + dol_fiche_head($head, 'category', $titre,0,$picto); + + + print ''; + print ""; + // Reference + print ''; + print ''; + + // Libelle + print ''; + print ''; + + // Statut + print ''; + + print '
'.$langs->trans("Ref").''; + print $html->showrefnav($member,'ref','',1,'ref'); + print '
'.$langs->trans("Label").''.$member->libelle.'
'.$langs->trans("Status").''; + print $member->getLibStatut(2); + print '
'; + + print ''; + + if ($mesg) print($mesg); + + formCategory($db,$member,3); + } } diff --git a/htdocs/lib/member.lib.php b/htdocs/lib/member.lib.php index 22cc751584a..4e439011368 100644 --- a/htdocs/lib/member.lib.php +++ b/htdocs/lib/member.lib.php @@ -19,7 +19,7 @@ /** * \file htdocs/lib/member.lib.php - * \brief Ensemble de fonctions de base pour les adh�rents + * \brief Ensemble de fonctions de base pour les adherents * \version $Id$ * * Ensemble de fonctions de base de dolibarr sous forme d'include