Try a more complete fix than #14821

This commit is contained in:
Laurent Destailleur 2020-09-27 17:21:49 +02:00
parent cb6e4d131f
commit c659379307
3 changed files with 18 additions and 3 deletions

View File

@ -132,6 +132,19 @@ class ExtraFields
*/
public $attribute_list;
/**
* @var array Array to store if field is summable
* @deprecated
*/
public $attribute_totalizable;
/**
* @var array Array to store entity id of extrafield
* @deprecated
*/
public $attribute_entityid;
/**
* @var array New array to store extrafields definition
*/

View File

@ -134,7 +134,8 @@ foreach ($object->fields as $key => $val)
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'position'=>$val['position']
'position'=>$val['position'],
'help'=>$val['help']
);
}
}
@ -149,7 +150,8 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
'position'=>$extrafields->attributes[$object->table_element]['pos'][$key],
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]),
'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key]
'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key],
'help'=>$extrafields->attributes[$object->table_element]['help'][$key]
);
}
}

View File

@ -884,7 +884,7 @@ SCRIPT;
// Show field if not hidden
if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
$extratitle = $langs->trans($value);
$arrayfields['ef.'.$key] = array('label'=>$extratitle, 'checked'=>0, 'position'=>(end($arrayfields)['position']+1));
$arrayfields['ef.'.$key] = array('label'=>$extratitle, 'checked'=>0, 'position'=>(end($arrayfields)['position']+1), 'langfile'=>$extrafields->attributes["product_fournisseur_price"]['langfile'][$key], 'help'=>$extrafields->attributes["product_fournisseur_price"]['help'][$key]);
}
}
}