From 0ef9a8843a83ff8e4a8f2ed0d07208d9b0db6ddd Mon Sep 17 00:00:00 2001 From: ATM john Date: Thu, 13 Jun 2019 21:57:30 +0200 Subject: [PATCH 1/2] Fix empty test --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 19b39fd776d..d726c84e2ae 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8123,7 +8123,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = $attr['href'] = ''; } - if(empty($id)){ + if(!empty($id)){ $attr['id'] = $id; } From e7d81a68f063b15df8e9f4e4104a6a9e566c3329 Mon Sep 17 00:00:00 2001 From: ATM john Date: Thu, 13 Jun 2019 22:11:47 +0200 Subject: [PATCH 2/2] Fix Override Attribute --- htdocs/core/lib/functions.lib.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d726c84e2ae..31442cd7364 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8130,7 +8130,15 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = // Override attr if(!empty($params['attr']) && is_array($params['attr'])){ foreach($params['attr'] as $key => $value){ - $attr[$key] = $value; + if($key == 'class'){ + $attr['class'].= ' '.$value; + } + elseif($key == 'classOverride'){ + $attr['class'] = $value; + } + else{ + $attr[$key] = $value; + } } } @@ -8202,10 +8210,10 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u $attr['href'] = ''; - if($status == -1){ // Not enough permissions + if($status == -1){ // disable $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("FeatureDisabled")); } - elseif($status == 0){ // disable + elseif($status == 0){ // Not enough permissions $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")); } }