NEW 3.0 compatibility

This commit is contained in:
Ingo Schommer 2012-07-10 18:36:05 +02:00
parent b32da03dfc
commit 84a4ee477c

View File

@ -5,22 +5,19 @@
* *
* @package contentreview * @package contentreview
*/ */
class SiteTreeContentReview extends DataObjectDecorator implements PermissionProvider { class SiteTreeContentReview extends DataExtension implements PermissionProvider {
function extraStatics() { static $db = array(
return array( "ReviewPeriodDays" => "Int",
'db' => array( "NextReviewDate" => "Date",
"ReviewPeriodDays" => "Int", 'ReviewNotes' => 'Text',
"NextReviewDate" => "Date", 'LastEditedByName' => 'Varchar(255)',
'ReviewNotes' => 'Text', 'OwnerNames' => 'Varchar(255)'
'LastEditedByName' => 'Varchar(255)', );
'OwnerNames' => 'Varchar(255)'
), static $has_one = array(
'has_one' => array( 'Owner' => 'Member',
'Owner' => 'Member', );
),
);
}
function getOwnerName() { function getOwnerName() {
if($this->owner->OwnerID && $this->owner->Owner()) return $this->owner->Owner()->FirstName . ' ' . $this->owner->Owner()->Surname; if($this->owner->OwnerID && $this->owner->Owner()) return $this->owner->Owner()->FirstName . ' ' . $this->owner->Owner()->Surname;
@ -33,7 +30,7 @@ class SiteTreeContentReview extends DataObjectDecorator implements PermissionPro
return NULL; return NULL;
} }
public function updateCMSFields(&$fields) { public function updateCMSFields(FieldList $fields) {
if(Permission::check("EDIT_CONTENT_REVIEW_FIELDS")) { if(Permission::check("EDIT_CONTENT_REVIEW_FIELDS")) {
$cmsUsers = Permission::get_members_by_permission(array("CMS_ACCESS_CMSMain", "ADMIN")); $cmsUsers = Permission::get_members_by_permission(array("CMS_ACCESS_CMSMain", "ADMIN"));