From 44ced0cbeb95f2a934c85569906931e261ec5bee Mon Sep 17 00:00:00 2001 From: gauthier Date: Tue, 22 Oct 2019 16:11:59 +0200 Subject: [PATCH] FIX : if we search something with global search, and after with form fields, we want to stay on Products AND Services list --- htdocs/product/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 43188c5fe7c..6e870c05740 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -450,6 +450,7 @@ if ($resql) if($type == Product::TYPE_SERVICE) $rightskey='service'; if($user->rights->{$rightskey}->creer) { + $oldtype=$type; if ($type === "") { $newcardbutton.= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0'); $type = Product::TYPE_SERVICE; @@ -457,6 +458,7 @@ if ($resql) $label='NewProduct'; if($type == Product::TYPE_SERVICE) $label='NewService'; $newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type); + $type=$oldtype; } print '
';