Merge pull request #12202 from atm-gauthier/10.0_fix_search_on_product_and_service

FIX : if we search something with global search, and after with form …
This commit is contained in:
Laurent Destailleur 2019-10-22 20:06:10 +02:00 committed by GitHub
commit 2f0b791cfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';