From 437b796928b86ddc6e5563bb499b2aa20fc56988 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Aug 2016 20:34:55 +0200 Subject: [PATCH] Fix search on product ref --- htdocs/product/stock/productlot_list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 1318ef9ac73..49f9a443460 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -62,7 +62,7 @@ $myparam = GETPOST('myparam','alpha'); $search_entity=GETPOST('search_entity','int'); -$search_fk_product=GETPOST('search_fk_product','int'); +$search_product=GETPOST('search_product','alpha'); $search_batch=GETPOST('search_batch','alpha'); $search_fk_user_creat=GETPOST('search_fk_user_creat','int'); $search_fk_user_modif=GETPOST('search_fk_user_modif','int'); @@ -157,7 +157,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $search_entity=''; - $search_fk_product=''; + $search_product=''; $search_batch=''; $search_fk_user_creat=''; $search_fk_user_modif=''; @@ -242,7 +242,7 @@ $sql.= " WHERE p.rowid = t.fk_product"; //$sql.= " WHERE u.entity IN (".getEntity('mytable',1).")"; if ($search_entity) $sql.= natural_search("entity",$search_entity); -if ($search_fk_product) $sql.= natural_search("fk_product",$search_fk_product); +if ($search_product) $sql.= natural_search("p.ref",$search_product); if ($search_batch) $sql.= natural_search("batch",$search_batch); if ($search_fk_user_creat) $sql.= natural_search("fk_user_creat",$search_fk_user_creat); if ($search_fk_user_modif) $sql.= natural_search("fk_user_modif",$search_fk_user_modif); @@ -293,7 +293,7 @@ if ($resql) if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($search_entity != '') $params.= '&search_entity='.urlencode($search_entity); - if ($search_fk_product != '') $params.= '&search_fk_product='.urlencode($search_fk_product); + if ($search_product != '') $params.= '&search_product='.urlencode($search_product); if ($search_batch != '') $params.= '&search_batch='.urlencode($search_batch); if ($search_fk_user_creat != '') $params.= '&search_fk_user_creat='.urlencode($search_fk_user_creat); if ($search_fk_user_modif != '') $params.= '&search_fk_user_modif='.urlencode($search_fk_user_modif); @@ -387,9 +387,9 @@ if ($resql) // Fields title search print ''; - if (! empty($arrayfields['t.entity']['checked'])) print ''; - if (! empty($arrayfields['t.fk_product']['checked'])) print ''; - if (! empty($arrayfields['t.batch']['checked'])) print ''; + if (! empty($arrayfields['t.entity']['checked'])) print ''; + if (! empty($arrayfields['t.fk_product']['checked'])) print ''; + if (! empty($arrayfields['t.batch']['checked'])) print ''; if (! empty($arrayfields['t.eatby']['checked'])) print ''; if (! empty($arrayfields['t.sellby']['checked'])) print ''; if (! empty($arrayfields['t.fk_user_creat']['checked'])) print '';