Fix #11683 Correct links to create a new product or service from search results

This commit is contained in:
Jean Traullé 2019-08-15 22:21:31 +02:00
parent 6430c74793
commit 4bed1b9a3d
No known key found for this signature in database
GPG Key ID: 5315BC7C950D912A

View File

@ -458,6 +458,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);