From 383aeeba8c7b3eaaccbf9978ea67890bf5c1aff5 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 20 Jan 2017 08:37:08 -0700 Subject: [PATCH] Add a selectbox for infolog type to addressbook's merge-to-email dialog --- addressbook/inc/class.addressbook_ui.inc.php | 4 ++++ addressbook/js/app.js | 5 +++-- addressbook/templates/default/mail_merge_dialog.xet | 5 ++++- mail/inc/class.mail_compose.inc.php | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 52f1259009..0cb15d0103 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -314,6 +314,10 @@ class addressbook_ui extends addressbook_bo // if there is any export limit set, pass it on to the nextmatch, to be evaluated by the export if (isset($this->config['contact_export_limit']) && (int)$this->config['contact_export_limit']) $content['nm']['export_limit']=$this->config['contact_export_limit']; + // Merge to email dialog needs the infolog types + $infolog = new infolog_bo(); + $sel_options['info_type'] = $infolog->enums['type']; + // dont show tid-selection if we have only one content_type // be a bit more sophisticated about it $availabletypes = array_keys($this->content_types); diff --git a/addressbook/js/app.js b/addressbook/js/app.js index a98a6be50b..e0e268f531 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -835,7 +835,7 @@ app.classes.addressbook = AppJS.extend( var _action = jQuery.extend(true, {}, action); if(value.infolog) { - _action.data.menuaction += '&to_app=infolog'; + _action.data.menuaction += '&to_app=infolog&info_type='+value.info_type; } nm_action(_action, selected, target); } @@ -845,7 +845,8 @@ app.classes.addressbook = AppJS.extend( title: action.caption, buttons: et2_dialog.BUTTONS_OK_CANCEL, type: et2_dialog.QUESTION_MESSAGE, - template: egw.webserverUrl+'/addressbook/templates/default/mail_merge_dialog.xet' + template: egw.webserverUrl+'/addressbook/templates/default/mail_merge_dialog.xet', + value: {content: {info_type: 'email'}, sel_options: this.et2.getArrayMgr('sel_options').data} }); } else diff --git a/addressbook/templates/default/mail_merge_dialog.xet b/addressbook/templates/default/mail_merge_dialog.xet index 7be0540b40..2e152d0137 100644 --- a/addressbook/templates/default/mail_merge_dialog.xet +++ b/addressbook/templates/default/mail_merge_dialog.xet @@ -13,7 +13,10 @@ - + + + + diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 6dd1223d46..c852469b39 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -3530,6 +3530,10 @@ class mail_compose { $bo = new infolog_bo(); $entry = $bo->import_mail($data['addresses'],$data['subject'],$data['message'],$data['attachments'],$data['date']); + if($_REQUEST['info_type'] && isset($bo->enums['type'][$_REQUEST['info_type']])) + { + $entry['info_type'] = $_REQUEST['info_type']; + } $bo->write($entry); } }