Commit 811f286d authored by Ingo Schommer's avatar Ingo Schommer

3.1 compat

parent 1b3177c5
......@@ -5,7 +5,6 @@ php:
- 5.3
env:
- DB=MYSQL CORE_RELEASE=3.0
- DB=MYSQL CORE_RELEASE=3.1
- DB=PGSQL CORE_RELEASE=master
......
......@@ -10,7 +10,7 @@ class UnsubscribeController extends Page_Controller {
static public $days_unsubscribe_link_alive = 30;
public static $allowed_actions = array(
private static $allowed_actions = array(
'index',
'done',
'undone',
......
......@@ -9,29 +9,29 @@
class MailingList extends DataObject {
/* the database fields */
static $db = array(
private static $db = array(
'Title' => "Varchar",
);
/* a mailing list could contains many newsletter recipients */
static $many_many = array(
private static $many_many = array(
'Recipients' => "Recipient",
);
static $belongs_many_many = array(
private static $belongs_many_many = array(
'Newsletters' => "Newsletter",
);
static $singular_name = 'Mailinglist';
private static $singular_name = 'Mailinglist';
static $plural_name = 'Mailinglists';
private static $plural_name = 'Mailinglists';
static $summary_fields = array(
private static $summary_fields = array(
'Title',
'ActiveRecipients.Count'
);
static $searchable_fields = array(
private static $searchable_fields = array(
'Title'
);
......
......@@ -8,7 +8,7 @@
*/
class Newsletter extends DataObject implements CMSPreviewable{
static $db = array(
private static $db = array(
"Status" => "Enum('Draft, Sending, Sent', 'Draft')",
"Subject" => "Varchar(255)",
"Content" => "HTMLText",
......@@ -18,27 +18,27 @@ class Newsletter extends DataObject implements CMSPreviewable{
"RenderTemplate" => "Varchar",
);
static $has_many = array(
private static $has_many = array(
"SendRecipientQueue" => "SendRecipientQueue",
"TrackedLinks" => "Newsletter_TrackedLink"
);
static $many_many = array(
private static $many_many = array(
"MailingLists" => "MailingList"
);
static $searchable_fields = array(
private static $searchable_fields = array(
"Subject",
"Content",
"SendFrom",
"SentDate"
);
static $default_sort = array(
private static $default_sort = array(
"LastEdited DESC"
);
static $summary_fields = array(
private static $summary_fields = array(
"Subject",
"SentDate",
"Status"
......@@ -444,17 +444,17 @@ class Newsletter extends DataObject implements CMSPreviewable{
*/
class Newsletter_TrackedLink extends DataObject {
static $db = array(
private static $db = array(
'Original' => 'Varchar(255)',
'Hash' => 'Varchar(100)',
'Visits' => 'Int'
);
static $has_one = array(
private static $has_one = array(
'Newsletter' => 'Newsletter'
);
static $summary_fields = array(
private static $summary_fields = array(
"Newsletter.Subject" => "Newsletter",
"Original" => "Link URL",
"Visits" => "Visit Counts"
......
......@@ -11,6 +11,6 @@
*/
class Newsletter_Sent extends Newsletter {
static $singular_name = "Sent Newsletters";
static $plural_name = "Sent Newsletters";
private static $singular_name = "Sent Newsletters";
private static $plural_name = "Sent Newsletters";
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
*/
class Recipient extends DataObject {
static $db = array(
private static $db = array(
'Email' => "Varchar(255)",
'FirstName' => "Varchar(255)",
'MiddleName' => "Varchar(255)",
......@@ -28,19 +28,19 @@ class Recipient extends DataObject {
);
// a newsletter recipient could belong to many mailing lists.
static $belongs_many_many = array(
private static $belongs_many_many = array(
'MailingLists' => 'MailingList',
);
static $has_many = array(
private static $has_many = array(
'SendRecipientQueue' => 'SendRecipientQueue',
);
static $indexes = array(
private static $indexes = array(
'Email' => true,
'ReceivedCount' => true,
);
static $default_sort = '"FirstName", "Surname"';
private static $default_sort = '"FirstName", "Surname"';
/**
*
......@@ -49,7 +49,7 @@ class Recipient extends DataObject {
* with definition for different searching algorithms
* (LIKE, FULLTEXT) and default FormFields to construct a searchform.
*/
static $searchable_fields = array(
private static $searchable_fields = array(
'FirstName',
'MiddleName',
'Surname',
......@@ -59,7 +59,7 @@ class Recipient extends DataObject {
'Verified',
);
static $summary_fields = array(
private static $summary_fields = array(
'FirstName' => 'First Name',
'Surname' => 'Last Name',
'Email' => 'Email',
......
......@@ -11,24 +11,24 @@ class SendRecipientQueue extends DataObject {
* Status has 4 possible values: "Sent", (mail() returned TRUE), "Failed" (mail() returned FALSE),
* "Bounced" ({@see $email_bouncehandler}), or "BlackListed" (sending to is disabled).
*/
static $db = array(
private static $db = array(
"Status" => "Enum('Scheduled, InProgress, Sent, Failed, Bounced, BlackListed', 'Scheduled')",
"RetryCount" => "Int(0)" //number of times this email got "stuck" in the queue
);
static $has_one = array(
private static $has_one = array(
"Newsletter" => "Newsletter",
"Recipient" => "Recipient"
);
static $summary_fields = array(
private static $summary_fields = array(
"Status",
"Recipient.Email",
"RetryCount",
"LastEdited",
);
static $default_sort = array(
private static $default_sort = array(
'LastEdited DESC'
);
......
......@@ -8,7 +8,7 @@
* unsubscribed from a {@link MailingList}.
*/
class UnsubscribeRecord extends DataObject {
static $has_one = array(
private static $has_one = array(
'MailingList' => 'MailingList',
'Recipient' => 'Recipient'
);
......
......@@ -9,7 +9,7 @@
class SubscriptionPage extends Page {
static $db = array(
private static $db = array(
'Fields' => 'Text',
'Required' => 'Text',
'CustomisedHeading' => 'Text',
......@@ -23,14 +23,14 @@ class SubscriptionPage extends Page {
"OnCompleteMessage" => "HTMLText",
);
static $defaults = array(
private static $defaults = array(
'Fields' => 'Email',
'SubmissionButtonText' => 'Submit'
);
static $singular_name = 'Newsletter Subscription Page';
private static $singular_name = 'Newsletter Subscription Page';
static $plural_name = 'Newsletter Subscription Pages';
private static $plural_name = 'Newsletter Subscription Pages';
static public $days_verification_link_alive = 2;
......@@ -200,7 +200,7 @@ class SubscriptionPage extends Page {
*/
class SubscriptionPage_Controller extends Page_Controller {
public static $allowed_actions = array(
private static $allowed_actions = array(
'index',
'subscribeverify',
'submitted',
......
......@@ -9,7 +9,7 @@
class UnsubscriptionPage extends Page {
static $defaults = array(
private static $defaults = array(
'Content' => 'Enter your email address and we will send you an email with an unsubscribe link'
);
}
......
......@@ -15,11 +15,10 @@
],
"require":
{
"silverstripe/framework": "3.*",
"composer/installers": "*",
"silverstripe/framework": "~3.1",
"silverstripe/messagequeue": "*",
"silverstripe/gridfieldajaxrefresh": "*",
"silverstripe/cms": "3.*"
"silverstripe/cms": "~3.1"
},
"autoload": {
"classmap": ["tests/behat/"]
......
......@@ -13,9 +13,9 @@ en:
PLURALNAME: Mailinglists
SINGULARNAME: Mailinglist
Newletter:
TemplateExplanation1: "You should make your own styled SilverStripe templates make sure your templates have a $Body coded so the newletter's content could be clearly located in your templates "
TemplateExplanation2: "Make sure your newsletter templates could be looked up in the dropdown list bellow by either placing them under your theme directory, e.g. themes/mytheme/templates/email/ "
TemplateExplanation3: "or under your project directory e.g. mysite/templates/email/ "
TemplateExplanation1: 'You should make your own styled SilverStripe templates make sure your templates have a$Body coded so the newletter''s content could be clearly located in your templates'
TemplateExplanation2: "Make sure your newsletter templates could be looked up in the dropdown list bellow by\n either placing them under your theme directory, e.g. themes/mytheme/templates/email/\n "
TemplateExplanation3: "or under your project directory e.g. mysite/templates/email/\n "
TemplateExplanationTitle: 'Select a styled template (.ss template) that this newsletter renders with'
Newsletter:
BlacklistedDesc: 'Excluded from emails, either by automated process or manually. An invalid address or undeliverable email will eventually result in blacklisting.'
......@@ -44,7 +44,7 @@ en:
FieldVerified: 'Verified?'
FormattingHelp: 'Formatting Help'
FromNotif: 'From Email Address for Notification Email'
GlobalUnsubscribeDescription: "Clicking any unsubscribe links in each newsletter will unsubscribe the recipient from all mailing lists if checked<br /> otherwise only unsubscribe the recipient from mailing lists that the newsletter related to"
GlobalUnsubscribeDescription: "Clicking any unsubscribe links in each newsletter will unsubscribe the recipient from all mailing lists \n if checked<br />\n otherwise only unsubscribe the recipient from mailing lists that the newsletter related to"
INVALIDLINK: 'Invalid Link'
INVALIDRESUBSCRIBE: 'Invalid resubscrible'
INVALIDRESUBSCRIBECONTENT: 'This resubscribe link is invalid'
......@@ -101,6 +101,12 @@ en:
VerifiedDesc: 'Has this user verified his subscription?'
VerifySubject: 'Thanks for subscribing to our mailing lists, please verify your email'
Yes: Yes
BadEmailMessage: 'Email address not found'
ConfirmUnsubscribeSubject: 'Confirmation of your unsubscribe request'
FieldContent: Content
GoodEmailMessage: 'You have been sent an email containing an unsubscribe link'
SendUnsubscribeLink: 'Send unsubscribe link'
UnsubscribeEmail: 'Your subscription email address'
Newsletter_Sent:
PLURALNAME: 'Sent Newsletters'
SINGULARNAME: 'Sent Newsletters'
......@@ -132,3 +138,9 @@ en:
SINGULARNAME: 'Unsubscribe Record'
newsletter:
UNSUBSCRIBEDTITLE: Unsubscribed
CMSMain_left.ss:
RESET: Reset
UnsubscriptionPage:
DESCRIPTION: 'Generic content page'
PLURALNAME: 'Unsubscription Pags'
SINGULARNAME: 'Unsubscription Page'
<?php
Class UnsubscribeTest extends SapphireTest{
class UnsubscribeTest extends SapphireTest{
static $fixture_file = 'newsletter/tests/unit/UnsubscribeTest.yml';
static $page;
function SetUp(){
parent::SetUp();
function setUp(){
parent::setUp();
self::$page = new UnsubscribeController();
ContentNegotiator::disable();
Config::inst()->update('ContentNegotiator', 'enabled', false);
}
function testIndexWithAutoLoginHashAndNewsletterType(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment