diff --git a/ChangeLog b/ChangeLog index 82c2b13c337..a7e647fcc99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,10 +43,11 @@ For users: - New: [ task #498 ] Improvement of the block to add products/services lines. - New: ECM autodir works also for files joined to products and services. - New: Add a selection module for emailing to enter a recipient from gui. +- New: Allow to search product from barcodes directly from the permanent mini search left box +- New: Allow to search product from barcodes directly from invoices, proposals... through AJAX New experimental modules: - New: Add margin and commissions management module. - New: Add holiday module. -- New: Allow to search product from barcodes directly from the permanent mini search left box - Fix: [ bug #499 ]: Supplier order input method not translated - Fix: No images into product description lines as PDF generation does diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1901ff59652..81fb49bdd60 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -12,6 +12,7 @@ * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2010 Philippe Grand * Copyright (C) 2011 Herve Prot + * Copyright (C) 2012 Marcos GarcĂ­a * * 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 @@ -1196,6 +1197,11 @@ class Form if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '%".$filterkey."%'"; $sql.=")"; } + + if (! empty($conf->global->MAIN_MODULE_BARCODE)) + { + $sql .= " OR p.barcode LIKE '".$filterkey."'"; + } } $sql.= $db->order("p.ref"); $sql.= $db->plimit($limit); @@ -1441,6 +1447,11 @@ class Form { $sql.=" AND (pfp.ref_fourn LIKE '%".$filterkey."%' OR p.ref LIKE '%".$filterkey."%' OR p.label LIKE '%".$filterkey."%')"; } + + if (! empty($conf->global->MAIN_MODULE_BARCODE)) + { + $sql .= " OR p.barcode LIKE '".$filterkey."'"; + } } $sql.= " ORDER BY pfp.ref_fourn DESC";