Skip to content

Commit

Permalink
Fix bug #933: Ajax error
Browse files Browse the repository at this point in the history
Caused by commit 7e53f98
  • Loading branch information
marcosgdf committed Jun 8, 2013
1 parent c8a634f commit f045492
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -1307,9 +1307,8 @@ function select_produits_list($selected='',$htmlname='productid',$filtertype='',
}
if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype;
// Add criteria on ref/label
if ($filterkey && $filterkey != '')
if ($filterkey != '')
{
$sql.=" AND (";
if (! empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) // Can use index
{
$sql.=" AND (p.ref LIKE '".$filterkey."%' OR p.label LIKE '".$filterkey."%'";
Expand All @@ -1331,7 +1330,6 @@ function select_produits_list($selected='',$htmlname='productid',$filtertype='',
{
$sql .= " OR p.barcode LIKE '".$filterkey."'";
}
$sql.=")";
}
$sql.= $db->order("p.ref");
$sql.= $db->plimit($limit);
Expand Down
4 changes: 2 additions & 2 deletions htdocs/product/ajax/products.php
Expand Up @@ -157,11 +157,11 @@
$form = new Form($db);
if (empty($mode) || $mode == 1)
{
$arrayresult=$form->select_produits_do("",$htmlname,$type,"",$price_level,$searchkey,$status,2,$outjson);
$arrayresult=$form->select_produits_list("",$htmlname,$type,"",$price_level,$searchkey,$status,2,$outjson);
}
elseif ($mode == 2)
{
$arrayresult=$form->select_produits_fournisseurs_do($socid,"",$htmlname,$type,"",$searchkey,$status,$outjson);
$arrayresult=$form->select_produits_fournisseurs_list($socid,"",$htmlname,$type,"",$searchkey,$status,$outjson);
}

$db->close();
Expand Down

0 comments on commit f045492

Please sign in to comment.