mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
NEW 3.0 compatibility
This commit is contained in:
parent
b32da03dfc
commit
84a4ee477c
@ -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(
|
|
||||||
'db' => array(
|
|
||||||
"ReviewPeriodDays" => "Int",
|
"ReviewPeriodDays" => "Int",
|
||||||
"NextReviewDate" => "Date",
|
"NextReviewDate" => "Date",
|
||||||
'ReviewNotes' => 'Text',
|
'ReviewNotes' => 'Text',
|
||||||
'LastEditedByName' => 'Varchar(255)',
|
'LastEditedByName' => 'Varchar(255)',
|
||||||
'OwnerNames' => 'Varchar(255)'
|
'OwnerNames' => 'Varchar(255)'
|
||||||
),
|
|
||||||
'has_one' => array(
|
|
||||||
'Owner' => 'Member',
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
static $has_one = array(
|
||||||
|
'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"));
|
||||||
|
Loading…
Reference in New Issue
Block a user