diff options
Diffstat (limited to 'program/steps/addressbook/func.inc')
-rw-r--r-- | program/steps/addressbook/func.inc | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index d416cc14f..3db2409e8 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -551,22 +551,13 @@ function rcmail_contact_form($form, $record, $attrib = null) // iterate over possible subtypes and collect values with their subtype if (is_array($colprop['subtypes'])) { $values = $subtypes = array(); - foreach ($colprop['subtypes'] as $i => $st) { - $newval = false; - if ($record[$field.':'.$st]) { - $subtypes[count($values)] = $st; - $newval = $record[$field.':'.$st]; - } - else if ($i == 0 && $record[$field]) { - $subtypes[count($values)] = $st; - $newval = $record[$field]; - } - if ($newval !== false) { - if (is_array($newval) && isset($newval[0])) - $values = array_merge($values, $newval); - else - $values[] = $newval; + foreach (rcube_addressbook::get_col_values($field, $record) as $st => $vals) { + foreach((array)$vals as $value) { + $i = count($values); + $subtypes[$i] = $st; + $values[$i] = $value; } + // TODO: add $st to $select_subtype if missing ? } } else { |