mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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
This commit is contained in:
parent
170c5b1fba
commit
5303c3ba2f
@ -237,18 +237,28 @@ Behaviour.register({
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// @TODO: See if this is used anymore
|
/**
|
||||||
|
* Called by AJAX when 'Send newsletter' button is clicked
|
||||||
|
*
|
||||||
|
*/
|
||||||
send: function() {
|
send: function() {
|
||||||
if( $('SendTypeList').checked )
|
// If 'Send to the entire mailing list' option is chosen
|
||||||
return this.send_to_list();
|
if( $('SendTypeList').checked) {
|
||||||
else
|
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();
|
return this.send_test();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submit the option form and carry out the action
|
* 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
|
// Show a "submitting..." box
|
||||||
/*if(!this.sendingText) {
|
/*if(!this.sendingText) {
|
||||||
this.sendingText = document.createElement('div');
|
this.sendingText = document.createElement('div');
|
||||||
@ -270,7 +280,7 @@ Behaviour.register({
|
|||||||
|
|
||||||
// Send the request
|
// Send the request
|
||||||
Ajax.SubmitForm( $('Form_EditForm'), 'action_sendnewsletter', {
|
Ajax.SubmitForm( $('Form_EditForm'), 'action_sendnewsletter', {
|
||||||
extraData: '&SendType=List',
|
extraData: '&SendType=' + sendType,
|
||||||
onSuccess: this.incrementProcess.bind(this),
|
onSuccess: this.incrementProcess.bind(this),
|
||||||
onFailure: function(response) {
|
onFailure: function(response) {
|
||||||
statusMessage(response.responseText);
|
statusMessage(response.responseText);
|
||||||
|
Loading…
Reference in New Issue
Block a user