2007-07-19 12:40:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class NewsletterList extends FormField {
|
|
|
|
function __construct($name, $mailtype, $status = "Draft") {
|
|
|
|
if(is_object($mailtype)) $this->mailType = $mailtype;
|
|
|
|
else $this->mailType = DataObject::get_by_id('NewsletterType',$mailtype);
|
|
|
|
$this->status = $status;
|
|
|
|
parent::__construct(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
function FieldHolder() {
|
|
|
|
return $this->renderWith("NewsletterList");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function setMailType($mailtype) {
|
|
|
|
$this->mailType = $mailtype;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setController($controller) {
|
|
|
|
$this->controller = $controller;
|
|
|
|
}
|
2007-09-14 19:29:08 +02:00
|
|
|
/* No longer used
|
2007-07-19 12:40:05 +02:00
|
|
|
function Newsletters() {
|
|
|
|
return DataObject::get( 'Newsletter', "`ParentID`='{$this->mailType->ID}' AND `Status`='{$this->status}'" );
|
|
|
|
}
|
2007-09-14 19:29:08 +02:00
|
|
|
*/
|
2007-07-19 12:40:05 +02:00
|
|
|
|
|
|
|
function DraftNewsletters() {
|
|
|
|
return $this->mailType->DraftNewsletters();
|
|
|
|
}
|
|
|
|
|
|
|
|
function SentNewsletters() {
|
|
|
|
return $this->mailType->SentNewsletters();
|
|
|
|
}
|
|
|
|
|
|
|
|
function Status() {
|
|
|
|
return $this->status;
|
|
|
|
}
|
2007-09-14 19:29:08 +02:00
|
|
|
function mailTypeID() {
|
|
|
|
return $this->mailType->ID;
|
|
|
|
}
|
2007-07-19 12:40:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|