From 90584390152699f119fc7eb299ada2fc2f2ded2e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 9 Sep 2012 16:17:19 +0200 Subject: [PATCH] Fix: best practice --- htdocs/core/class/html.formbarcode.class.php | 6 +++--- htdocs/product/liste.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 9964657c3a3..5a9ab8b6ee8 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2008-2012 Laurent Destailleur +/* Copyright (C) 2007-2012 Regis Houssin + * Copyright (C) 2008-2012 Laurent Destailleur * * 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 @@ -169,7 +169,7 @@ class FormBarCode { print '
'; print ''; - print ''; + print ''; print ''; print '
'; $this->select_barcode_type($selected, $htmlname, 1); diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index b6d26f82682..e750faa0357 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -132,12 +132,12 @@ else $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; if ($sall) { - $sql .= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%'"; - if (! empty($conf->global->MAIN_MODULE_BARCODE)) + $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%'"; + if (! empty($conf->barcode->enabled)) { - $sql .= " OR p.barcode LIKE '%".$db->escape($sall)."%'"; + $sql.= " OR p.barcode LIKE '%".$db->escape($sall)."%'"; } - $sql .= ')'; + $sql.= ')'; } // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($type))