New: Enhancement in category module

This commit is contained in:
Laurent Destailleur 2010-03-20 00:16:31 +00:00
parent 5a58b6b6ea
commit 7ba8f38348
2 changed files with 84 additions and 33 deletions

View File

@ -266,50 +266,101 @@ if ($_GET["socid"])
} }
else if ($_GET["id"] || $_GET["ref"]) else if ($_GET["id"] || $_GET["ref"])
{ {
/* if ($_GET["type"] == 0)
* Fiche categorie de produit {
*/ /*
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); * Fiche categorie de produit
require_once(DOL_DOCUMENT_ROOT."/product.class.php"); */
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
// Produit // Produit
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); 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); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
$picto=($product->type==1?'service':'product'); $picto=($product->type==1?'service':'product');
dol_fiche_head($head, 'category', $titre,0,$picto); dol_fiche_head($head, 'category', $titre,0,$picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print "<tr>"; print "<tr>";
// Reference // Reference
print '<td width="15%">'.$langs->trans("Ref").'</td><td>'; print '<td width="15%">'.$langs->trans("Ref").'</td><td>';
print $html->showrefnav($product,'ref','',1,'ref'); print $html->showrefnav($product,'ref','',1,'ref');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Libelle // Libelle
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>'; print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
print '</tr>'; print '</tr>';
// Statut // Statut
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">';
print $product->getLibStatut(2); print $product->getLibStatut(2);
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print '</div>'; print '</div>';
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 '<table class="border" width="100%">';
print "<tr>";
// Reference
print '<td width="15%">'.$langs->trans("Ref").'</td><td>';
print $html->showrefnav($member,'ref','',1,'ref');
print '</td>';
print '</tr>';
// Libelle
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$member->libelle.'</td>';
print '</tr>';
// Statut
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">';
print $member->getLibStatut(2);
print '</td></tr>';
print '</table>';
print '</div>';
if ($mesg) print($mesg);
formCategory($db,$member,3);
}
} }

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/lib/member.lib.php * \file htdocs/lib/member.lib.php
* \brief Ensemble de fonctions de base pour les adh<EFBFBD>rents * \brief Ensemble de fonctions de base pour les adherents
* \version $Id$ * \version $Id$
* *
* Ensemble de fonctions de base de dolibarr sous forme d'include * Ensemble de fonctions de base de dolibarr sous forme d'include