Fix warning

This commit is contained in:
Laurent Destailleur 2021-01-02 13:26:50 +01:00
parent eb3b0ad672
commit 791a509c6c

View File

@ -370,9 +370,11 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '')
{ {
foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label) foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label)
{ {
if (isset($thirdparty->array_options['options_'.$key])) {
$thirdparty_result_fields = array_merge($thirdparty_result_fields, array('options_'.$key => $thirdparty->array_options['options_'.$key])); $thirdparty_result_fields = array_merge($thirdparty_result_fields, array('options_'.$key => $thirdparty->array_options['options_'.$key]));
} }
} }
}
// Create // Create
$objectresp = array( $objectresp = array(
@ -623,9 +625,11 @@ function updateThirdParty($authentication, $thirdparty)
foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label) foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label)
{ {
$key = 'options_'.$key; $key = 'options_'.$key;
if (isset($thirdparty[$key])) {
$object->array_options[$key] = $thirdparty[$key]; $object->array_options[$key] = $thirdparty[$key];
} }
} }
}
$db->begin(); $db->begin();
@ -728,9 +732,11 @@ function getListOfThirdParties($authentication, $filterthirdparty)
{ {
foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label) foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label)
{ {
if (isset($obj->{$key})) {
$extrafieldsOptions['options_'.$key] = $obj->{$key}; $extrafieldsOptions['options_'.$key] = $obj->{$key};
} }
} }
}
$arraythirdparties[] = array('id'=>$obj->socRowid, $arraythirdparties[] = array('id'=>$obj->socRowid,
'ref'=>$obj->ref, 'ref'=>$obj->ref,