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
*/
class SiteTreeContentReview extends DataObjectDecorator implements PermissionProvider {
class SiteTreeContentReview extends DataExtension implements PermissionProvider {
function extraStatics() {
return array(
'db' => array(
static $db = array(
"ReviewPeriodDays" => "Int",
"NextReviewDate" => "Date",
'ReviewNotes' => 'Text',
'LastEditedByName' => 'Varchar(255)',
'OwnerNames' => 'Varchar(255)'
),
'has_one' => array(
'Owner' => 'Member',
),
);
}
static $has_one = array(
'Owner' => 'Member',
);
function getOwnerName() {
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;
}
public function updateCMSFields(&$fields) {
public function updateCMSFields(FieldList $fields) {
if(Permission::check("EDIT_CONTENT_REVIEW_FIELDS")) {
$cmsUsers = Permission::get_members_by_permission(array("CMS_ACCESS_CMSMain", "ADMIN"));