elofgren: Make the status message shown after sending a newsletter always include the # of emails sent.

(merged from branches/gsoc)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42003 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-16 01:04:10 +00:00
parent b784ccc5e7
commit 170c5b1fba
2 changed files with 15 additions and 15 deletions

View File

@ -111,12 +111,12 @@ class NewsletterEmailProcess extends BatchProcess {
$this->newsletter->Status = 'Send'; $this->newsletter->Status = 'Send';
$this->newsletter->write(); $this->newsletter->write();
$message = "statusMessage('Sent " . count( $this->objects ) . " emails successfully','good');"; // Call the success message JS function with the Newsletter information
if( $resent ) {
if( $resent ) return "resent_ok( '{$this->nlType->ID}', '{$this->newsletter->ID}', '".count( $this->objects )."' )";
return $message."resent_ok( '{$this->nlType->ID}', '{$this->newsletter->ID}' )"; } else {
else return "draft_sent_ok( '{$this->nlType->ID}', '{$this->newsletter->ID}', '".count( $this->objects )."' )";
return $message."draft_sent_ok( '{$this->nlType->ID}', '{$this->newsletter->ID}' )"; }
} }
} }
?> ?>

View File

@ -213,7 +213,7 @@ SiteTreeNode.prototype.getPageFromServer = function() {
$('Form_EditForm').getPageFromServer(newPageID, type, otherID, openTabName); $('Form_EditForm').getPageFromServer(newPageID, type, otherID, openTabName);
}; };
function draft_sent_ok( newsletterID, draftID ) { function draft_sent_ok( newsletterID, draftID, numEmails ) {
var draftsListNode = $('drafts_' + newsletterID); var draftsListNode = $('drafts_' + newsletterID);
var sentListNode = $('sent_' + newsletterID); var sentListNode = $('sent_' + newsletterID);
var draftNode = $('draft_' + newsletterID + '_' + draftID ); var draftNode = $('draft_' + newsletterID + '_' + draftID );
@ -221,11 +221,11 @@ function draft_sent_ok( newsletterID, draftID ) {
draftsListNode.removeTreeNode( draftNode ); draftsListNode.removeTreeNode( draftNode );
draftNode.id = 'sent_' + newsletterID + '_' + draftID; draftNode.id = 'sent_' + newsletterID + '_' + draftID;
sentListNode.appendTreeNode( draftNode, null ); sentListNode.appendTreeNode( draftNode, null );
statusMessage('Sent email to mailing list', 'good'); statusMessage('Sent newsletter to mailing list. Sent ' + numEmails + ' emails successfully.', 'good');
} }
function resent_ok( newsletterID, sentID ) { function resent_ok( newsletterID, sentID, numEmails ) {
statusMessage('Resent email to mailing list', 'good'); statusMessage('Resent newsletter to mailing list. Sent ' + numEmails + ' emails successfully.', 'good');
} }
function reloadSiteTree() { function reloadSiteTree() {