include review info in the in the recorded content review

This commit is contained in:
Julian 2016-08-29 19:13:23 +12:00
parent d73a96fa8f
commit e02991ef05
3 changed files with 10 additions and 6 deletions

View File

@ -31,9 +31,8 @@ class ContentReviewCMSExtension extends LeftAndMainExtension
}
$notes = (!empty($data["ReviewNotes"]) ? $data["ReviewNotes"] : _t("ContentReview.NOCOMMENTS", "(no comments)"));
$page->addReviewNote(Member::currentUser(), $notes);
$page->addReviewNote(Member::currentUser(), $notes, $page->ReviewInfo);
$page->advanceReviewDate();
$this->owner->getResponse()->addHeader("X-Status", _t("ContentReview.REVIEWSUCCESSFUL", "Content reviewed successfully"));
return $this->owner->redirectBack();
}

View File

@ -418,11 +418,14 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
* @param Member $reviewer
* @param string $message
*/
public function addReviewNote(Member $reviewer, $message)
public function addReviewNote(Member $reviewer, $message, $reviewInfo = null)
{
$reviewLog = ContentReviewLog::create();
$reviewLog->Note = $message;
$reviewLog->ReviewerID = $reviewer->ID;
if ($reviewInfo) {
$reviewLog->ReviewInfo = $reviewInfo;
}
$this->owner->ReviewLogs()->add($reviewLog);
}

View File

@ -7,6 +7,7 @@ class ContentReviewLog extends DataObject
*/
private static $db = array(
"Note" => "Text",
"ReviewInfo" => "Text"
);
/**
@ -21,9 +22,10 @@ class ContentReviewLog extends DataObject
* @var array
*/
private static $summary_fields = array(
"Note" => array("title" => "Note"),
"Created" => array("title" => "Reviewed at"),
"Reviewer.Title" => array("title" => "Reviewed by"),
"ReviewInfo" => array("title" => "Review Information"),
"Note" => array("title" => "Note"),
"Created" => array("title" => "Reviewed at"),
"Reviewer.Title" => array("title" => "Reviewed by"),
);
/**