From c84f1baf175ad13c0e33600fe07a3c02385a6a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traulle=CC=81?= Date: Sat, 31 Aug 2019 00:18:53 +0200 Subject: [PATCH] Fix #11683 Correct links to create a new product or service from search results --- htdocs/product/list.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7677e82e1b4..43188c5fe7c 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -450,6 +450,10 @@ if ($resql) if($type == Product::TYPE_SERVICE) $rightskey='service'; if($user->rights->{$rightskey}->creer) { + 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; + } $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);