From 63663dda358946f58ad57a201920a610759a6f12 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 20 Feb 2006 15:26:18 +0000 Subject: [PATCH] =?UTF-8?q?gestion=20cat=E9gorie=20de=20produits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product/liste.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 2056c96b15a..d3c276a7003 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -29,6 +29,7 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/product.class.php'); +require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); $langs->load("products"); @@ -72,6 +73,12 @@ $title=$langs->trans("ProductsAndServices"); $sql = 'SELECT p.rowid, p.ref, p.label, p.price, p.fk_product_type, '.$db->pdate('p.tms').' as datem,'; $sql.= ' p.duration, p.envente as statut'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; + +if ($catid) +{ + $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; +} + if ($_GET["fourn_id"] > 0) { $fourn_id = $_GET["fourn_id"]; @@ -98,6 +105,11 @@ if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0) { $sql .= " AND p.envente = ".$_GET["envente"]; } +if($catid) +{ + $sql .= " AND cp.fk_product = p.rowid"; + $sql .= " AND cp.fk_categorie = ".$catid; +} if ($fourn_id > 0) { $sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id; @@ -147,6 +159,15 @@ if ($resql) { print_barre_liste($texte, $page, "liste.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num); } + + if (isset($catid)) + { + print "
"; + $c = new Categorie ($db, $catid); + $ways = $c->print_all_ways(' > ','product/liste.php'); + print " > ".$ways[0]."
\n"; + print "

"; + } print '';