2
0
forked from Wavyzz/dolibarr

Clean code

This commit is contained in:
Laurent Destailleur
2018-04-13 16:18:33 +02:00
parent 7811796491
commit 4251748aca
2 changed files with 11 additions and 5 deletions

View File

@@ -5964,11 +5964,14 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
// Create dynamic tags for __EXTRAFIELD_FIELD__
if ($object->table_element && $object->id > 0)
{
$extrafieldstmp = new ExtraFields($db);
if (! is_object($extrafields)) $extrafieldstmp = new ExtraFields($db);
$extralabels = $extrafieldstmp->fetch_name_optionals_label($object->table_element, true);
$object->fetch_optionals();
foreach ($extrafieldstmp->attributes[$object->table_element]['label'] as $key => $label) {
$substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key];
if (is_array($extrafieldstmp->attributes[$object->table_element]['label']) && count($extrafieldstmp->attributes[$object->table_element]['label']) > 0)
{
foreach ($extrafieldstmp->attributes[$object->table_element]['label'] as $key => $label) {
$substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key];
}
}
}