From 3a0d2596c9dc84980818ed73c05ccb7b5cf3ec91 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 16 Sep 2007 01:36:04 +0000 Subject: [PATCH] elofgren: Make class BouncedList? extend TableListField? so that checkboxes and red 'X' icon links will show. @TODO Make it possible to disable sending to bounced emails by unchecking a box and delete the email from the mailing list by clicking the red X @TODO Try to find way to show Firstname and Surname under a 'Username' heading (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42012 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/Newsletter/BouncedList.php | 21 ++++++++++++++++++--- code/NewsletterAdmin.php | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/code/Newsletter/BouncedList.php b/code/Newsletter/BouncedList.php index 7c88b3fe..38da33e9 100755 --- a/code/Newsletter/BouncedList.php +++ b/code/Newsletter/BouncedList.php @@ -1,10 +1,14 @@ "Email address", "Created" => "Last bounce at", "BounceMessage" => "Reason:"), "", "Created"); + $this->Markable = true; + $this->IsReadOnly = false; + $this->setPermissions(array('edit', 'delete', 'add')); if( is_object( $newsletterType ) ) $this->nlType = $newsletterType; @@ -12,10 +16,20 @@ class BouncedList extends FormField { $this->nlType = DataObject::get_by_id( 'NewsletterType', $newsletterType ); } + + function sourceItems() { + $id = $this->nlType->GroupID; + // @TODO Try to find way to show Firstname and Surname under a 'Username' heading + return DataObject::get( 'Email_BounceRecord', "`GroupID`='$id'", null, "INNER JOIN `Group_Members` USING(`MemberID`)" ); + } + function setController($controller) { $this->controller = $controller; } - + + // Not needed now that we are extending TableListField instead of FormField + // @TODO Remove NewsletterAdmin_BouncedList.ss after copying out any needed bits + /* function FieldHolder() { return $this->renderWith( 'NewsletterAdmin_BouncedList' ); } @@ -42,5 +56,6 @@ class BouncedList extends FormField { return new DataObjectSet( $bouncedUsers ); } + */ } ?> diff --git a/code/NewsletterAdmin.php b/code/NewsletterAdmin.php index 3e4d4a2a..705102f2 100755 --- a/code/NewsletterAdmin.php +++ b/code/NewsletterAdmin.php @@ -291,6 +291,7 @@ class NewsletterAdmin extends LeftAndMain { $unsubscribedList = new UnsubscribedList("Unsubscribed", $mailType) ), new Tab("Bounced", + new LiteralField('Instructions', '

Instructions:

'), $bouncedList = new BouncedList("Bounced", $mailType ) ) )