From 35ce67f62b95deb1aaf186ba6b4a7ee9c3bbe5a9 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 19 Jul 2013 15:13:01 +0000 Subject: [PATCH] Use readonly tag list for FROM as an example --- mail/inc/class.mail_ui.inc.php | 19 +++++++++++++++++++ mail/js/app.js | 8 ++++++++ mail/templates/default/display.xet | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 2593238d54..97d34ea175 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -1616,6 +1616,25 @@ unset($query['actions']); $content['mail_displaybccaddress'] = self::emailAddressToHTML($envelope['BCC'],'',false,true,false); } + // Set up data for taglist widget(s) + foreach(array('SENDER','FROM','TO','CC','BCC') as $field) + { + foreach($envelope[$field] as $field_data) + { + $content[$field][] = $field_data['EMAIL']; + $sel_options[$field][] = array( + // taglist requires these + 'id' => $field_data['EMAIL'], + 'label' => $field_data['PERSONAL_NAME'], + // Optional + 'title' => $field_data['RFC822_EMAIL'] + ) + // Add all other data, will be preserved & passed to js onclick + // Also available in widget.options.select_options + + $field_data; + } + } + if (empty($subject)) $subject = lang('no subject'); $content['msg'] = (is_array($error_msg)?implode("
",$error_msg):$error_msg); $content['mail_displaydate'] = mail_bo::_strtotime($headers['DATE'],'ts',true); diff --git a/mail/js/app.js b/mail/js/app.js index f6b77008f4..bc1efe4c5d 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -739,6 +739,14 @@ app.mail = AppJS.extend( //window.open(url,'_blank','dependent=yes,width=100,height=100,scrollbars=yes,status=yes'); document.location = url; }, + + /** + * User clicked an address (FROM, TO, etc) + */ + address_click: function(DOMNode, tag_info, widget) + { + console.log(this, arguments); + }, /** * Save a message to filemanager diff --git a/mail/templates/default/display.xet b/mail/templates/default/display.xet index c450f7bc28..ea47a39bfd 100644 --- a/mail/templates/default/display.xet +++ b/mail/templates/default/display.xet @@ -6,7 +6,7 @@ - +