Add a selectbox for infolog type to addressbook's merge-to-email dialog

This commit is contained in:
nathangray 2017-01-20 08:37:08 -07:00
parent 74c48e0592
commit 383aeeba8c
4 changed files with 15 additions and 3 deletions

View File

@ -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 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']; 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 // dont show tid-selection if we have only one content_type
// be a bit more sophisticated about it // be a bit more sophisticated about it
$availabletypes = array_keys($this->content_types); $availabletypes = array_keys($this->content_types);

View File

@ -835,7 +835,7 @@ app.classes.addressbook = AppJS.extend(
var _action = jQuery.extend(true, {}, action); var _action = jQuery.extend(true, {}, action);
if(value.infolog) 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); nm_action(_action, selected, target);
} }
@ -845,7 +845,8 @@ app.classes.addressbook = AppJS.extend(
title: action.caption, title: action.caption,
buttons: et2_dialog.BUTTONS_OK_CANCEL, buttons: et2_dialog.BUTTONS_OK_CANCEL,
type: et2_dialog.QUESTION_MESSAGE, 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 else

View File

@ -13,7 +13,10 @@
<description value="Do you want to send the message to all selected entries, WITHOUT further editing?"/> <description value="Do you want to send the message to all selected entries, WITHOUT further editing?"/>
</row> </row>
<row> <row>
<hbox>
<checkbox id="infolog" label="Save as infolog"/> <checkbox id="infolog" label="Save as infolog"/>
<listbox id="info_type"/>
</hbox>
</row> </row>
</rows> </rows>
</grid> </grid>

View File

@ -3530,6 +3530,10 @@ class mail_compose
{ {
$bo = new infolog_bo(); $bo = new infolog_bo();
$entry = $bo->import_mail($data['addresses'],$data['subject'],$data['message'],$data['attachments'],$data['date']); $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); $bo->write($entry);
} }
} }