From 88db3da002e3f2c1a2f2c50f14ffe8675473acde Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 5 Dec 2012 19:51:25 +0100 Subject: [PATCH 1/2] allowing product search by supplier ref --- htdocs/fourn/product/liste.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php index 943afb272a9..5661e136b6f 100644 --- a/htdocs/fourn/product/liste.php +++ b/htdocs/fourn/product/liste.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel * * 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 @@ -99,6 +100,10 @@ if ($_POST["mode"] == 'search') { $sql .= " AND (p.ref LIKE '%".$_POST["sall"]."%'"; $sql .= " OR p.label LIKE '%".$_POST["sall"]."%')"; + if ($sRefSupplier) + { + $sql .= " AND ppf.ref_fourn LIKE '%".$sRefSupplier."%'"; + } } else { From bbc470b3ae870b4ac05ec401bf163eb565b16777 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 5 Dec 2012 19:56:23 +0100 Subject: [PATCH 2/2] add search box to find product by supplier ref --- htdocs/main.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a0b28c7ff25..f5ab6d7d718 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -8,6 +8,7 @@ * Copyright (C) 2011 Philippe Grand * Copyright (C) 2008 Matteli * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel * * 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 @@ -1419,6 +1420,13 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me $searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall'); } + if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) + && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) + { + $langs->load("products"); + $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/liste.php', DOL_URL_ROOT.'/fourn/product/liste.php', img_object('','product').' '.$langs->trans("SupplierRef"), 'products', 'srefsupplier'); + } + if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) { $langs->load("members");