Fix Override Attribute
This commit is contained in:
parent
0ef9a8843a
commit
e7d81a68f0
@ -8130,9 +8130,17 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
|||||||
// Override attr
|
// Override attr
|
||||||
if(!empty($params['attr']) && is_array($params['attr'])){
|
if(!empty($params['attr']) && is_array($params['attr'])){
|
||||||
foreach($params['attr'] as $key => $value){
|
foreach($params['attr'] as $key => $value){
|
||||||
|
if($key == 'class'){
|
||||||
|
$attr['class'].= ' '.$value;
|
||||||
|
}
|
||||||
|
elseif($key == 'classOverride'){
|
||||||
|
$attr['class'] = $value;
|
||||||
|
}
|
||||||
|
else{
|
||||||
$attr[$key] = $value;
|
$attr[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($attr['href']) && empty($attr['href'])){
|
if(isset($attr['href']) && empty($attr['href'])){
|
||||||
unset($attr['href']);
|
unset($attr['href']);
|
||||||
@ -8202,10 +8210,10 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
|
|||||||
|
|
||||||
$attr['href'] = '';
|
$attr['href'] = '';
|
||||||
|
|
||||||
if($status == -1){ // Not enough permissions
|
if($status == -1){ // disable
|
||||||
$attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("FeatureDisabled"));
|
$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"));
|
$attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user