mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
include review info in the in the recorded content review
This commit is contained in:
parent
d73a96fa8f
commit
e02991ef05
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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"),
|
||||
);
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user