From 2a5c9a759075eebfe359f787681c76f4219144f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Oct 2008 08:10:59 +0000 Subject: [PATCH] Patch sladame --- htdocs/product/sousproduits/fiche.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/product/sousproduits/fiche.php b/htdocs/product/sousproduits/fiche.php index 8fb1cf32505..f211a5c77d6 100644 --- a/htdocs/product/sousproduits/fiche.php +++ b/htdocs/product/sousproduits/fiche.php @@ -1,8 +1,8 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2007 Régis Houssin + * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * * This program is free software; you can redistribute it and/or modify @@ -94,25 +94,22 @@ if ($action == 'add_prod' && } } } -// action recherche des produits par mot-clé et/ou par catégorie +// action recherche des produits par mot-cle et/ou par categorie if($action == 'search' ) { #$sql = 'SELECT p.rowid, p.ref, p.label, p.price, p.fk_product_type'; $sql = 'SELECT p.rowid, p.ref, p.label, p.price'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; - if($conf->categorie->enabled && $catMere != -1) - { - $sql .= ', '.MAIN_DB_PREFIX.'categorie_product as cp'; - } - $sql .= " WHERE 1=1"; + $sql.= ' left join '.MAIN_DB_PREFIX.'categorie_product as cp on p.rowid=cp.fk_product'; + $sql.= " WHERE 1=1"; if($key != "") { $sql .= " AND (p.ref like '%".$key."%'"; $sql .= " OR p.label like '%".$key."%')"; } - if($conf->categorie->enabled && $catMere != -1) + if ($conf->categorie->enabled && $catMere != -1 and $catMere) { - $sql .= " AND p.rowid=cp.fk_product AND cp.fk_categorie ='".$catMere."'"; + $sql .= "AND cp.fk_categorie ='".$catMere."'"; } $sql .= " ORDER BY p.ref ASC "; // $sql .= $db->plimit($limit + 1 ,$offset); @@ -126,6 +123,11 @@ if ($cancel == $langs->trans("Cancel")) exit; } + +/* + * View + */ + llxHeader("","",$langs->trans("CardProduct".$product->type)); $html = new Form($db); @@ -233,7 +235,7 @@ if ($id || $ref) // Libelle print ''.$langs->trans("Label").''.$product->libelle.''; print ''; - // Nombre de sousproduits associés + // Nombre de sousproduits associ�s $product->get_sousproduits_arbo (); print ''.$langs->trans("AssociatedProductsNumber").''.sizeof($product->get_arbo_each_prod()).''; print '';