8 @phan-var-force array $arrayfields;
12if (empty($conf) || !is_object($conf)) {
13 print
"Error, template page can't be called as URL";
17if (empty($extrafieldsobjectkey) && is_object(
$object)) {
18 $extrafieldsobjectkey =
$object->table_element;
22if (!empty($extrafieldsobjectkey)) {
23 if (isset($extrafields->attributes[$extrafieldsobjectkey][
'label']) && is_array($extrafields->attributes[$extrafieldsobjectkey][
'label']) && count($extrafields->attributes[$extrafieldsobjectkey][
'label']) > 0) {
24 if (empty($extrafieldsobjectprefix)) {
25 $extrafieldsobjectprefix =
'ef.';
27 foreach ($extrafields->attributes[$extrafieldsobjectkey][
'label'] as $key => $val) {
29 if (!empty($extrafields->attributes[$extrafieldsobjectkey][
'enabled'][$key])) {
31 $enabled =
dol_eval($extrafields->attributes[$extrafieldsobjectkey][
'enabled'][$key], 1);
33 if (!empty($extrafields->attributes[$extrafieldsobjectkey][
'list'][$key]) && $enabled ) {
34 $arrayfields[$extrafieldsobjectprefix.$key] = array(
35 'label' => $extrafields->attributes[$extrafieldsobjectkey][
'label'][$key],
36 'type' => $extrafields->attributes[$extrafieldsobjectkey][
'type'][$key],
37 'checked' => (((
int)
dol_eval($extrafields->attributes[$extrafieldsobjectkey][
'list'][$key], 1, 1,
'1') <= 0) ? 0 : 1),
38 'position' => $extrafields->attributes[$extrafieldsobjectkey][
'pos'][$key],
39 'enabled' => (abs((int)
dol_eval($extrafields->attributes[$extrafieldsobjectkey][
'list'][$key], 1)) != 3 && (int)
dol_eval($extrafields->attributes[$extrafieldsobjectkey][
'perms'][$key], 1, 1,
'1')),
40 'langfile' => $extrafields->attributes[$extrafieldsobjectkey][
'langfile'][$key],
41 'help' => $extrafields->attributes[$extrafieldsobjectkey][
'help'][$key],
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.