From f243b5230f94e23cf18fd6d8e9d863a469380bd1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Dec 2015 20:24:12 +0100 Subject: [PATCH] Fix search filter disappear and clean filter button not visible. --- htdocs/product/price.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index e5b93d981af..9b63b91ece6 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -53,6 +53,8 @@ $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $eid = GETPOST('eid', 'int'); +$search_soc = GETPOST('search_soc'); + // Security check $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); $fieldtype = (! empty($ref) ? 'ref' : 'rowid'); @@ -84,6 +86,11 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { + if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers + { + $search_soc = ''; + } + if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) { $object->tva_tx = GETPOST('tva_tx'); @@ -1164,7 +1171,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) // Build filter to diplay only concerned lines $filter = array('t.fk_product' => $object->id); - $search_soc = GETPOST('search_soc'); if (! empty($search_soc)) { $filter['soc.nom'] = $search_soc; } @@ -1447,7 +1453,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print ' '; print ''; - if (count($prodcustprice->lines) > 0) + if (count($prodcustprice->lines) > 0 || $search_soc) { print ''; print ''; @@ -1455,9 +1461,14 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) // Print the search button print ''; print ''; + print ' '; + print ''; print ''; print ''; - + } + + if (count($prodcustprice->lines) > 0) + { $var = False; foreach ($prodcustprice->lines as $line)