diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-10-30 16:33:09 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-10-30 16:33:09 +0000 |
| commit | 037f21fdf5d253a57afc49c8df5c706656713469 (patch) | |
| tree | 555596dcdbf174ca3479f147b114b7b1978da512 /roundcubemail/program/steps | |
| parent | fd068c05a7ff1498d947ceacbde6d8cf7f060ba9 (diff) | |
Also merge properties of child cols of composite address book fields + remove undefined fields from template
git-svn-id: https://svn.roundcube.net/trunk@5379 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
| -rw-r--r-- | roundcubemail/program/steps/addressbook/func.inc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/addressbook/func.inc b/roundcubemail/program/steps/addressbook/func.inc index 2082dbd1f..2b06e62cd 100644 --- a/roundcubemail/program/steps/addressbook/func.inc +++ b/roundcubemail/program/steps/addressbook/func.inc @@ -140,8 +140,13 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false) $CONTACT_COLTYPES = array_intersect_key($CONTACT_COLTYPES, $contact_cols); // add associative coltypes definition if (!$CONTACTS->coltypes[0]) { - foreach ($CONTACTS->coltypes as $col => $colprop) + foreach ($CONTACTS->coltypes as $col => $colprop) { + if (is_array($colprop['childs'])) { + foreach ($colprop['childs'] as $childcol => $childprop) + $colprop['childs'][$childcol] = array_merge((array)$CONTACT_COLTYPES[$col]['childs'][$childcol], $childprop); + } $CONTACT_COLTYPES[$col] = $CONTACT_COLTYPES[$col] ? array_merge($CONTACT_COLTYPES[$col], $colprop) : $colprop; + } } } @@ -597,7 +602,7 @@ function rcmail_contact_form($form, $record, $attrib = null) $coltypes[$field] += (array)$colprop; $coltypes[$field]['count']++; - $val = strtr($template, $composite); + $val = preg_replace('/\{\w+\}/', '', strtr($template, $composite)); } else if ($edit_mode) { // call callback to render/format value |
