From b50dc80ee150178eca2266a906a5ad5807c61909 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 4 Jun 2013 21:24:17 +0000 Subject: [PATCH] Add in contact placeholders for custom fields of type select-account --- infolog/inc/class.infolog_merge.inc.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/infolog/inc/class.infolog_merge.inc.php b/infolog/inc/class.infolog_merge.inc.php index c33e8650cd..2ccaecd424 100644 --- a/infolog/inc/class.infolog_merge.inc.php +++ b/infolog/inc/class.infolog_merge.inc.php @@ -101,6 +101,17 @@ class infolog_merge extends bo_merge $this->cf_link_to_expand($record->get_record_array(), $content, $info); } + foreach($this->bo->customfields as $name => $field) + { + if ($field['type'] == 'select-account') + { + $record_name = '#'.$name; + $info += $this->contact_replacements( + array('account_id' => $record->$record_name), + ($prefix ? $prefix . '/' : '')."#$name" + ); + } + } importexport_export_csv::convert($record, $types, 'infolog', $selects); if($record->info_contact) { @@ -121,7 +132,10 @@ class infolog_merge extends bo_merge $array = $record->get_record_array(); foreach($this->bo->customfields as $name => $field) { - if(!$array['#'.$name]) $array['#'.$name] = ''; + if(!$array['#'.$name]) + { + $array['#'.$name] = ''; + } } // Links @@ -177,9 +191,15 @@ class infolog_merge extends bo_merge } echo '

'.lang('Custom fields').":

"; + $contact_custom = false; foreach($this->bo->customfields as $name => $field) { - echo '{{#'.$name.'}}'.$field['label']."\n"; + echo '{{#'.$name.'}}'.$field['label'].($field['type'] == 'select-account' ? '*':'')."\n"; + if($field['type'] == 'select-account') $contact_custom = true; + } + if($contact_custom) + { + echo '* '.lang('Addressbook placeholders available'). ''; } echo '

'.lang('Contact fields').':

';