From 5303c3ba2fde1fc42b3fe21c333a4984c23cf8a2 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 16 Sep 2007 01:04:35 +0000 Subject: [PATCH] elofgren: BUGFIX: Make 'Sent Status Report' tab be reloaded after a Newsletter is sent 'to only people not previously sent to' (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42004 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/NewsletterAdmin_right.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/javascript/NewsletterAdmin_right.js b/javascript/NewsletterAdmin_right.js index bb789414..4775f47b 100755 --- a/javascript/NewsletterAdmin_right.js +++ b/javascript/NewsletterAdmin_right.js @@ -237,18 +237,28 @@ Behaviour.register({ return false; }, - // @TODO: See if this is used anymore + /** + * Called by AJAX when 'Send newsletter' button is clicked + * + */ send: function() { - if( $('SendTypeList').checked ) - return this.send_to_list(); - else + // If 'Send to the entire mailing list' option is chosen + if( $('SendTypeList').checked) { + return this.send_to_list('List'); + // If 'Send to only people not previously sent to' option is chosen + } else if ($('SendTypeUnsent').checked) { + return this.send_to_list('Unsent'); + } else { return this.send_test(); + } }, /** * Submit the option form and carry out the action + * + * @param sendType string 'List' if sending to entire list and 'Unsent' if only sending to people not previously sent to */ - send_to_list : function() { + send_to_list : function(sendType) { // Show a "submitting..." box /*if(!this.sendingText) { this.sendingText = document.createElement('div'); @@ -270,7 +280,7 @@ Behaviour.register({ // Send the request Ajax.SubmitForm( $('Form_EditForm'), 'action_sendnewsletter', { - extraData: '&SendType=List', + extraData: '&SendType=' + sendType, onSuccess: this.incrementProcess.bind(this), onFailure: function(response) { statusMessage(response.responseText);