mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
Merge 3ed6eb0971
into cd1b9ed9f2
This commit is contained in:
commit
aee13af0c2
@ -194,7 +194,7 @@ class SiteTreeContentReview extends Extension implements PermissionProvider
|
|||||||
*
|
*
|
||||||
* @param SiteTree $page
|
* @param SiteTree $page
|
||||||
*
|
*
|
||||||
* @return bool|DBDate
|
* @return null|DBDate
|
||||||
*/
|
*/
|
||||||
public function getReviewDate(SiteTree $page = null)
|
public function getReviewDate(SiteTree $page = null)
|
||||||
{
|
{
|
||||||
@ -209,11 +209,11 @@ class SiteTreeContentReview extends Extension implements PermissionProvider
|
|||||||
$options = $this->owner->getOptions();
|
$options = $this->owner->getOptions();
|
||||||
|
|
||||||
if (!$options) {
|
if (!$options) {
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$options->ReviewPeriodDays) {
|
if (!$options->ReviewPeriodDays) {
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Failover to check on ReviewPeriodDays + LastEdited
|
// Failover to check on ReviewPeriodDays + LastEdited
|
||||||
@ -509,6 +509,9 @@ class SiteTreeContentReview extends Extension implements PermissionProvider
|
|||||||
DBDatetime::now()->getTimestamp()
|
DBDatetime::now()->getTimestamp()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$x=DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE);
|
||||||
|
;
|
||||||
|
|
||||||
$this->owner->NextReviewDate = DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE);
|
$this->owner->NextReviewDate = DBDate::create()->setValue($nextDateTimestamp)->Format(DBDate::ISO_DATE);
|
||||||
$this->owner->write();
|
$this->owner->write();
|
||||||
}
|
}
|
||||||
@ -662,6 +665,8 @@ class SiteTreeContentReview extends Extension implements PermissionProvider
|
|||||||
|
|
||||||
if (is_object($nextDate)) {
|
if (is_object($nextDate)) {
|
||||||
$this->owner->NextReviewDate = $nextDate->getValue();
|
$this->owner->NextReviewDate = $nextDate->getValue();
|
||||||
|
} elseif ($nextDate === false) {
|
||||||
|
$this->owner->NextReviewDate = null;
|
||||||
} else {
|
} else {
|
||||||
$this->owner->NextReviewDate = $nextDate;
|
$this->owner->NextReviewDate = $nextDate;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user