Fix: best practice

This commit is contained in:
Regis Houssin 2012-09-09 16:17:19 +02:00
parent 1450ee1978
commit 9058439015
2 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2007-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setfk_barcode_type">';
print '<input type="hidden" name="action" value="set'.$htmlname.'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
$this->select_barcode_type($selected, $htmlname, 1);

View File

@ -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))