mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
add a new field for Review Info, and display it when it has data on the quick review panel, as well as in the main cms screen
This commit is contained in:
parent
4f287bb508
commit
1e4880998d
@ -25,6 +25,7 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
|
|||||||
"NextReviewDate" => "Date",
|
"NextReviewDate" => "Date",
|
||||||
"LastEditedByName" => "Varchar(255)",
|
"LastEditedByName" => "Varchar(255)",
|
||||||
"OwnerNames" => "Varchar(255)",
|
"OwnerNames" => "Varchar(255)",
|
||||||
|
"ReviewInfo" => "Text"
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -126,13 +127,22 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
|
|||||||
"<label class=\"left\" for=\"Form_EditForm_ReviewNotes\">" . _t("ContentReview.CONTENTREVIEW", "Content due for review") . "</label>"
|
"<label class=\"left\" for=\"Form_EditForm_ReviewNotes\">" . _t("ContentReview.CONTENTREVIEW", "Content due for review") . "</label>"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (strlen($this->owner->ReviewInfo) > 0) {
|
||||||
|
$reviewInfo = LiteralField::create(
|
||||||
|
"ReviewContentInfo",
|
||||||
|
"<p class=\"quick-info\">" . $this->owner->ReviewInfo . "</p>"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$reviewInfo = '';
|
||||||
|
}
|
||||||
|
|
||||||
$ReviewNotes = LiteralField::create("ReviewNotes", "<textarea class=\"no-change-track\" id=\"Form_EditForm_ReviewNotes\" name=\"ReviewNotes\" placeholder=\"" . _t("ContentReview.COMMENTS", "(optional) Add comments...") . "\" class=\"text\"></textarea>");
|
$ReviewNotes = LiteralField::create("ReviewNotes", "<textarea class=\"no-change-track\" id=\"Form_EditForm_ReviewNotes\" name=\"ReviewNotes\" placeholder=\"" . _t("ContentReview.COMMENTS", "(optional) Add comments...") . "\" class=\"text\"></textarea>");
|
||||||
|
|
||||||
$quickReviewAction = FormAction::create("savereview", _t("ContentReview.MARKREVIEWED", "Mark as reviewed"))
|
$quickReviewAction = FormAction::create("savereview", _t("ContentReview.MARKREVIEWED", "Mark as reviewed"))
|
||||||
->setAttribute("data-icon", "pencil")
|
->setAttribute("data-icon", "pencil")
|
||||||
->setAttribute("data-text-alternate", _t("ContentReview.MARKREVIEWED", "Mark as reviewed"));
|
->setAttribute("data-text-alternate", _t("ContentReview.MARKREVIEWED", "Mark as reviewed"));
|
||||||
|
|
||||||
$allFields = CompositeField::create($reviewTitle, $ReviewNotes, $quickReviewAction)
|
$allFields = CompositeField::create($reviewTitle, $reviewInfo, $ReviewNotes, $quickReviewAction)
|
||||||
->addExtraClass('review-notes field');
|
->addExtraClass('review-notes field');
|
||||||
|
|
||||||
$reviewTab = Tab::create('ReviewContent', $allFields);
|
$reviewTab = Tab::create('ReviewContent', $allFields);
|
||||||
@ -383,6 +393,8 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
|
|||||||
->addExtraClass('custom-setting')
|
->addExtraClass('custom-setting')
|
||||||
->setDescription(_t("ContentReview.REVIEWFREQUENCYDESCRIPTION", "The review date will be set to this far in the future whenever the page is published"));
|
->setDescription(_t("ContentReview.REVIEWFREQUENCYDESCRIPTION", "The review date will be set to this far in the future whenever the page is published"));
|
||||||
|
|
||||||
|
$reviewInfoField = TextareaField::create("ReviewInfo", _t("ContentReview.REVIEWINFO", "Review information"));
|
||||||
|
|
||||||
$notesField = GridField::create("ReviewNotes", "Review Notes", $this->owner->ReviewLogs(), GridFieldConfig_RecordEditor::create());
|
$notesField = GridField::create("ReviewNotes", "Review Notes", $this->owner->ReviewLogs(), GridFieldConfig_RecordEditor::create());
|
||||||
|
|
||||||
$fields->addFieldsToTab("Root.ContentReview", array(
|
$fields->addFieldsToTab("Root.ContentReview", array(
|
||||||
@ -395,6 +407,7 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
|
|||||||
$reviewFrequency
|
$reviewFrequency
|
||||||
)->addExtraClass("review-settings"),
|
)->addExtraClass("review-settings"),
|
||||||
ReadonlyField::create("ROContentOwners", _t("ContentReview.CONTENTOWNERS", "Content Owners"), $this->getOwnerNames()),
|
ReadonlyField::create("ROContentOwners", _t("ContentReview.CONTENTOWNERS", "Content Owners"), $this->getOwnerNames()),
|
||||||
|
$reviewInfoField,
|
||||||
$notesField,
|
$notesField,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user