diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index e616d99189..28762fa9b7 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -156,14 +156,16 @@ class mail_compose 'group' => ++$group, 'checkbox' => true, 'hint' => 'check to save as infolog on send', - 'toolbarDefault' => true + 'toolbarDefault' => true, + 'onExecute' => 'javaScript:app.mail.compose_setToggle' ), 'to_tracker' => array( 'caption' => 'Tracker', 'icon' => 'to_tracker', 'group' => $group, 'checkbox' => true, - 'hint' => 'check to save as trackerentry on send' + 'hint' => 'check to save as trackerentry on send', + 'onExecute' => 'javaScript:app.mail.compose_setToggle' ), 'disposition' => array( 'caption' => 'Notification', @@ -171,7 +173,8 @@ class mail_compose 'group' => ++$group, 'checkbox' => true, 'hint' => 'check to recieve a notification when the message is read (note: not all clients support this and/or the reciever may not authorize the notification)', - 'toolbarDefault' => true + 'toolbarDefault' => true, + 'onExecute' => 'javaScript:app.mail.compose_setToggle' ), 'prty' => array( 'caption' => 'Priority', diff --git a/mail/js/app.js b/mail/js/app.js index 05aa3bbee3..83bf8d38d9 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -4227,24 +4227,24 @@ app.classes.mail = AppJS.extend( */ compose_submitAction: function (_action) { - var action_widget = ['to_infolog','to_tracker','disposition']; - var toolbar = this.et2.getWidgetById('composeToolbar'); - for(var i=0;action_widget.length>i;i++) - { - var widget = this.et2.getWidgetById(action_widget[i]); - if (toolbar._actionManager) - { - var action_event = toolbar._actionManager.getActionById(action_widget[i]); - if (typeof action_event.checkbox != 'undefined' && action_event.checkbox) - { - widget.set_value(action_event.checked?"on":"off"); - } - } - } - this.et2._inst.submit(null,null,true); }, + /** + * Set the selected checkbox action + * + * @param {type} _action selected toolbar action with checkbox + * @returns {undefined} + */ + compose_setToggle: function (_action) + { + var widget = this.et2.getWidgetById (_action.id); + if (widget && typeof _action.checkbox != 'undefined' && _action.checkbox) + { + widget.set_value(_action.checked?"on":"off"); + } + }, + /** * Set the selected priority value * @param {type} _action selected action @@ -4258,6 +4258,7 @@ app.classes.mail = AppJS.extend( widget.set_value(_action.id); } }, + /** * Triger relative widget via its toolbar identical action * @param {type} _action toolbar action