mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
Merge remote-tracking branch 'matt/pulls/reporting-url-fix' into cwp-support
This commit is contained in:
commit
2b98e7b7d9
@ -43,12 +43,15 @@ class PagesDueForReviewReport extends SS_Report {
|
|||||||
*/
|
*/
|
||||||
public function columns() {
|
public function columns() {
|
||||||
|
|
||||||
$linkBase = singleton('CMSPageEditController')->Link('show') . '/';
|
$linkBase = singleton('CMSPageEditController')->Link('show');
|
||||||
|
$linkPath = parse_url($linkBase, PHP_URL_PATH);
|
||||||
|
$linkQuery = parse_url($linkBase, PHP_URL_QUERY);
|
||||||
|
|
||||||
|
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'Title' => array(
|
'Title' => array(
|
||||||
'title' => 'Page name',
|
'title' => 'Page name',
|
||||||
'formatting' => '<a href=\"' . $linkBase . '/$ID\" title=\"Edit page\">$value</a>'
|
'formatting' => sprintf('<a href=\"%s/$ID?%s\" title=\"Edit page\">$value</a>', $linkPath, $linkQuery)
|
||||||
),
|
),
|
||||||
'NextReviewDate' => array(
|
'NextReviewDate' => array(
|
||||||
'title' => 'Review Date',
|
'title' => 'Review Date',
|
||||||
@ -85,13 +88,19 @@ class PagesDueForReviewReport extends SS_Report {
|
|||||||
),
|
),
|
||||||
'ContentReviewType' => array(
|
'ContentReviewType' => array(
|
||||||
'title' => 'Settings are',
|
'title' => 'Settings are',
|
||||||
'formatting' => function($value, $item) use($linkBase) {
|
'formatting' => function($value, $item) use($linkPath, $linkQuery) {
|
||||||
if($item->ContentReviewType == 'Inherit') {
|
if($item->ContentReviewType == 'Inherit') {
|
||||||
$options = $item->getOptions();
|
$options = $item->getOptions();
|
||||||
if($options && $options instanceof SiteConfig) {
|
if($options && $options instanceof SiteConfig) {
|
||||||
return 'Inherited from <a href="admin/settings">Settings</a>';
|
return 'Inherited from <a href="admin/settings">Settings</a>';
|
||||||
} elseif($options) {
|
} elseif($options) {
|
||||||
return 'Inherited from <a href="'.$linkBase.$options->ID.'">'.$options->Title.'</a>';
|
return sprintf(
|
||||||
|
'Inherited from <a href="%s/%d?%s">%s</a>',
|
||||||
|
$linkPath,
|
||||||
|
$options->ID,
|
||||||
|
$linkQuery,
|
||||||
|
$options->Title
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
|
@ -31,11 +31,14 @@ class PagesWithoutReviewScheduleReport extends SS_Report {
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function columns() {
|
public function columns() {
|
||||||
$linkBase = singleton('CMSPageEditController')->Link('show') . '/';
|
$linkBase = singleton('CMSPageEditController')->Link('show');
|
||||||
|
$linkPath = parse_url($linkBase, PHP_URL_PATH);
|
||||||
|
$linkQuery = parse_url($linkBase, PHP_URL_QUERY);
|
||||||
|
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'Title' => array(
|
'Title' => array(
|
||||||
'title' => 'Page name',
|
'title' => 'Page name',
|
||||||
'formatting' => '<a href=\"' . $linkBase . '/$ID\" title=\"Edit page\">$value</a>'
|
'formatting' => sprintf('<a href=\"%s/$ID?%s\" title=\"Edit page\">$value</a>', $linkPath, $linkQuery)
|
||||||
),
|
),
|
||||||
'NextReviewDate' => array(
|
'NextReviewDate' => array(
|
||||||
'title' => 'Review Date',
|
'title' => 'Review Date',
|
||||||
@ -59,13 +62,19 @@ class PagesWithoutReviewScheduleReport extends SS_Report {
|
|||||||
),
|
),
|
||||||
'ContentReviewType' => array(
|
'ContentReviewType' => array(
|
||||||
'title' => 'Settings are',
|
'title' => 'Settings are',
|
||||||
'formatting' => function($value, $item) use($linkBase) {
|
'formatting' => function($value, $item) use($linkPath, $linkQuery) {
|
||||||
if($item->ContentReviewType == 'Inherit') {
|
if($item->ContentReviewType == 'Inherit') {
|
||||||
$options = $item->getOptions();
|
$options = $item->getOptions();
|
||||||
if($options && $options instanceof SiteConfig) {
|
if($options && $options instanceof SiteConfig) {
|
||||||
return 'Inherited from <a href="admin/settings">Settings</a>';
|
return 'Inherited from <a href="admin/settings">Settings</a>';
|
||||||
} elseif($options) {
|
} elseif($options) {
|
||||||
return 'Inherited from <a href="'.$linkBase.$options->ID.'">'.$options->Title.'</a>';
|
return sprintf(
|
||||||
|
'Inherited from <a href="%s/%d?%s">%s</a>',
|
||||||
|
$linkPath,
|
||||||
|
$options->ID,
|
||||||
|
$linkQuery,
|
||||||
|
$options->Title
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
|
Loading…
Reference in New Issue
Block a user