mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
API CHANGE: Removed SideReport class, use SSReport as the base-class for them instead.
API CHANGE: Use SSReport::register(SideReport) to explicitly register reports on the LHS of the content view. BUGFIX: Updated all cms side reports to use SSReport as the base class. (from r95884) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@98176 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1b32326b9e
commit
a5753ad5ef
@ -50,5 +50,13 @@ HtmlEditorConfig::get('cms')->insertButtonsAfter ('advcode', 'fullscreen', 'sepa
|
|||||||
HtmlEditorConfig::get('cms')->removeButtons('tablecontrols');
|
HtmlEditorConfig::get('cms')->removeButtons('tablecontrols');
|
||||||
HtmlEditorConfig::get('cms')->addButtonsToLine(3, 'tablecontrols');
|
HtmlEditorConfig::get('cms')->addButtonsToLine(3, 'tablecontrols');
|
||||||
|
|
||||||
|
// Register default side reports
|
||||||
|
SSReport::register("SideReport", "SideReport_ToDo");
|
||||||
|
SSReport::register("SideReport", "SideReport_BrokenRedirectorPages");
|
||||||
|
SSReport::register("SideReport", "SideReport_BrokenVirtualPages");
|
||||||
|
SSReport::register("SideReport", "SideReport_BrokenFiles");
|
||||||
|
SSReport::register("SideReport", "SideReport_BrokenLinks");
|
||||||
|
SSReport::register("SideReport", "SideReport_RecentlyEdited");
|
||||||
|
SSReport::register("SideReport", "SideReport_EmptyPages");
|
||||||
|
|
||||||
?>
|
?>
|
@ -661,17 +661,17 @@ JS;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function SideReports() {
|
||||||
|
return SSReport::get_reports('SideReport');
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return a dropdown for selecting reports
|
* Return a dropdown for selecting reports
|
||||||
*/
|
*/
|
||||||
function ReportSelector() {
|
function ReportSelector() {
|
||||||
$reports = ClassInfo::subclassesFor("SideReport");
|
|
||||||
|
|
||||||
// $options[""] = _t('CMSMain.CHOOSEREPORT',"(Choose a report)");
|
// $options[""] = _t('CMSMain.CHOOSEREPORT',"(Choose a report)");
|
||||||
foreach($reports as $report) {
|
foreach($this->SideReports() as $report) {
|
||||||
if($report != 'SideReport' && singleton($report)->canView()) {
|
if($report->canView()) $options[$report->ID()] = $report->title();
|
||||||
$options[singleton($report)->group()][singleton($report)->sort()][$report] = singleton($report)->title();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$finalOptions = array();
|
$finalOptions = array();
|
||||||
@ -687,17 +687,15 @@ JS;
|
|||||||
return new GroupedDropdownField("ReportSelector", _t('CMSMain.REPORT', 'Report'),$finalOptions);
|
return new GroupedDropdownField("ReportSelector", _t('CMSMain.REPORT', 'Report'),$finalOptions);
|
||||||
}
|
}
|
||||||
function ReportFormParameters() {
|
function ReportFormParameters() {
|
||||||
$reports = ClassInfo::subclassesFor("SideReport");
|
|
||||||
|
|
||||||
$forms = array();
|
$forms = array();
|
||||||
foreach($reports as $report) {
|
foreach($this->SideReports() as $report) {
|
||||||
if ($report != 'SideReport' && singleton($report)->canView()) {
|
if ($report->canView()) {
|
||||||
if ($fieldset = singleton($report)->getParameterFields()) {
|
if ($fieldset = $report->parameterFields()) {
|
||||||
$formHtml = '';
|
$formHtml = '';
|
||||||
foreach($fieldset as $field) {
|
foreach($fieldset as $field) {
|
||||||
$formHtml .= $field->FieldHolder();
|
$formHtml .= $field->FieldHolder();
|
||||||
}
|
}
|
||||||
$forms[$report] = $formHtml;
|
$forms[$report->ID()] = $formHtml;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -713,10 +711,20 @@ JS;
|
|||||||
*/
|
*/
|
||||||
function sidereport() {
|
function sidereport() {
|
||||||
$reportClass = $this->urlParams['ID'];
|
$reportClass = $this->urlParams['ID'];
|
||||||
$report = ClassInfo::exists($reportClass) ? new $reportClass() : false;
|
$reports = $this->SideReports();
|
||||||
$report->setParams($this->request->requestVars());
|
if(isset($reports[$reportClass])) {
|
||||||
return $report ? $report->getHTML() : false;
|
$report = $reports[$reportClass];
|
||||||
|
if($report) {
|
||||||
|
$view = new SideReportView($this, $report);
|
||||||
|
$view->setParameters($this->request->requestVars());
|
||||||
|
return $view->forTemplate();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the versions of the current page
|
* Get the versions of the current page
|
||||||
*/
|
*/
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* Base class for the small reports that appear in the left hand site of the Site Content section of the CMS.
|
|
||||||
* Create subclasses of this class to build new reports.
|
|
||||||
* @package cms
|
|
||||||
* @subpackage content
|
|
||||||
*/
|
|
||||||
abstract class SideReport extends Object {
|
|
||||||
protected $params = array();
|
|
||||||
|
|
||||||
abstract function records();
|
/**
|
||||||
abstract function fieldsToShow();
|
* Renderer for showing SideReports in CMSMain
|
||||||
abstract function title();
|
*/
|
||||||
|
class SideReportView extends ViewableData {
|
||||||
|
protected $controller, $report;
|
||||||
|
protected $parameters;
|
||||||
|
|
||||||
|
function __construct($controller, $report) {
|
||||||
|
$this->controller = $controller;
|
||||||
|
$this->report = $report;
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
function group() {
|
function group() {
|
||||||
return 'Other';
|
return 'Other';
|
||||||
@ -20,47 +21,22 @@ abstract class SideReport extends Object {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHTML() {
|
function setParameters($parameters) {
|
||||||
$records = $this->records();
|
$this->parameters = $parameters;
|
||||||
$fieldsToShow = $this->fieldsToShow();
|
}
|
||||||
|
|
||||||
if($records && count($records)) {
|
function forTemplate() {
|
||||||
|
$records = $this->report->records($this->parameters);
|
||||||
|
$columns = $this->report->columns();
|
||||||
|
|
||||||
|
if($records && $records->Count()) {
|
||||||
$result = "<ul class=\"$this->class\">\n";
|
$result = "<ul class=\"$this->class\">\n";
|
||||||
|
|
||||||
foreach($records as $record) {
|
foreach($records as $record) {
|
||||||
$result .= "<li>\n";
|
$result .= "<li>\n";
|
||||||
foreach($fieldsToShow as $fieldTitle => $fieldInfo) {
|
foreach($columns as $source => $info) {
|
||||||
if(isset($fieldInfo['source'])) {
|
if(is_string($info)) $info = array('title' => $info);
|
||||||
$fieldSource = $fieldInfo['source'];
|
$result .= $this->formatValue($record, $source, $info);
|
||||||
|
|
||||||
// Legacy format for the input data
|
|
||||||
} else {
|
|
||||||
$fieldSource = $fieldInfo;
|
|
||||||
$fieldInfo = array(
|
|
||||||
'link' => true,
|
|
||||||
'newline' => false,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$val = isset($fieldInfo['prefix']) ? $fieldInfo['prefix'] : '';
|
|
||||||
|
|
||||||
$fieldName = ereg_replace('[^A-Za-z0-9]+','',$fieldTitle);
|
|
||||||
if(is_string($fieldSource)) {
|
|
||||||
$val .= Convert::raw2xml($record->$fieldSource);
|
|
||||||
} else {
|
|
||||||
$val .= $record->XML_val($fieldSource[0], $fieldSource[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($fieldInfo['newline']) && $fieldInfo['newline']) $result .= "<br>";
|
|
||||||
|
|
||||||
if(isset($fieldInfo['link']) && $fieldInfo['link']) {
|
|
||||||
$link = ($fieldInfo['link'] === true) ? "admin/show/$record->ID" : $fieldInfo['link'];
|
|
||||||
$result .= "<a class=\"$fieldName\" href=\"$link\">$val</a>";
|
|
||||||
} else {
|
|
||||||
$result .= "<span class=\"$fieldName\">$val</span>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$val .= isset($fieldInfo['suffix']) ? $fieldInfo['suffix'] : '';
|
|
||||||
}
|
}
|
||||||
$result .= "\n</li>\n";
|
$result .= "\n</li>\n";
|
||||||
}
|
}
|
||||||
@ -69,48 +45,70 @@ abstract class SideReport extends Object {
|
|||||||
$result = "<p class=\"message notice\">" .
|
$result = "<p class=\"message notice\">" .
|
||||||
sprintf(
|
sprintf(
|
||||||
_t('SideReport.REPEMPTY','The %s report is empty.',PR_MEDIUM,'%s is a report title'),
|
_t('SideReport.REPEMPTY','The %s report is empty.',PR_MEDIUM,'%s is a report title'),
|
||||||
$this->title()
|
$this->report->title()
|
||||||
)
|
)
|
||||||
. "</p>";
|
. "</p>";
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setParams($params) {
|
protected function formatValue($record, $source, $info) {
|
||||||
$this->params = $params;
|
// Field sources
|
||||||
}
|
//if(is_string($source)) {
|
||||||
|
$val = Convert::raw2xml($record->$source);
|
||||||
|
//} else {
|
||||||
|
// $val = $record->val($source[0], $source[1]);
|
||||||
|
//}
|
||||||
|
|
||||||
// if your batchaction has parameters, return a fieldset here
|
// Formatting, a la TableListField
|
||||||
function getParameterFields() {
|
if(!empty($info['formatting'])) {
|
||||||
return false;
|
$format = str_replace('$value', "__VAL__", $info['formatting']);
|
||||||
}
|
$format = preg_replace('/\$([A-Za-z0-9-_]+)/','$record->$1', $format);
|
||||||
|
$format = str_replace('__VAL__', '$val', $format);
|
||||||
|
$val = eval('return "' . $format . '";');
|
||||||
|
}
|
||||||
|
|
||||||
|
$prefix = empty($info['newline']) ? "" : "<br>";
|
||||||
|
|
||||||
|
|
||||||
|
$cssClass = ereg_replace('[^A-Za-z0-9]+','',$info['title']);
|
||||||
|
if(isset($info['link']) && $info['link']) {
|
||||||
|
$link = ($info['link'] === true) ? "admin/show/$record->ID" : $info['link'];
|
||||||
|
return $prefix . "<a class=\"$cssClass\" href=\"$link\">$val</a>";
|
||||||
|
} else {
|
||||||
|
return $prefix . "<span class=\"$cssClass\">$val</span>";
|
||||||
|
}
|
||||||
|
|
||||||
function canView() {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Content side-report listing empty pages
|
* Content side-report listing empty pages
|
||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
class SideReport_EmptyPages extends SideReport {
|
class SideReport_EmptyPages extends SS_Report {
|
||||||
function title() {
|
function title() {
|
||||||
return _t('SideReport.EMPTYPAGES',"Pages with no content");
|
return _t('SideReport.EMPTYPAGES',"Pages with no content");
|
||||||
}
|
}
|
||||||
|
|
||||||
function group() {
|
function group() {
|
||||||
return "Content reports";
|
return "Content reports";
|
||||||
}
|
}
|
||||||
function sort() {
|
function sort() {
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
function records($params = null) {
|
function sourceRecords($params = null) {
|
||||||
return DataObject::get("SiteTree", "\"Content\" = '' OR \"Content\" IS NULL OR \"Content\" LIKE '<p></p>' OR \"Content\" LIKE '<p> </p>'", '"Title"');
|
return DataObject::get("SiteTree", "\"Content\" = '' OR \"Content\" IS NULL OR \"Content\" LIKE '<p></p>' OR \"Content\" LIKE '<p> </p>'", '"Title"');
|
||||||
}
|
}
|
||||||
function fieldsToShow() {
|
function columns() {
|
||||||
return array(
|
return array(
|
||||||
"Title" => array("NestedTitle", array("2")),
|
"Title" => array(
|
||||||
|
"title" => "Title", // todo: use NestedTitle(2)
|
||||||
|
"link" => true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,7 +118,7 @@ class SideReport_EmptyPages extends SideReport {
|
|||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
class SideReport_RecentlyEdited extends SideReport {
|
class SideReport_RecentlyEdited extends SS_Report {
|
||||||
function title() {
|
function title() {
|
||||||
return _t('SideReport.LAST2WEEKS',"Pages edited in the last 2 weeks");
|
return _t('SideReport.LAST2WEEKS',"Pages edited in the last 2 weeks");
|
||||||
}
|
}
|
||||||
@ -130,13 +128,16 @@ class SideReport_RecentlyEdited extends SideReport {
|
|||||||
function sort() {
|
function sort() {
|
||||||
return 200;
|
return 200;
|
||||||
}
|
}
|
||||||
function records($params = null) {
|
function sourceRecords($params = null) {
|
||||||
$threshold = strtotime('-14 days', SS_Datetime::now()->Format('U'));
|
$threshold = strtotime('-14 days', SS_Datetime::now()->Format('U'));
|
||||||
return DataObject::get("SiteTree", "\"SiteTree\".\"LastEdited\" > '".date("Y-m-d H:i:s", $threshold)."'", "\"SiteTree\".\"LastEdited\" DESC");
|
return DataObject::get("SiteTree", "\"SiteTree\".\"LastEdited\" > '".date("Y-m-d H:i:s", $threshold)."'", "\"SiteTree\".\"LastEdited\" DESC");
|
||||||
}
|
}
|
||||||
function fieldsToShow() {
|
function columns() {
|
||||||
return array(
|
return array(
|
||||||
"Title" => array("NestedTitle", array("2")),
|
"Title" => array(
|
||||||
|
"title" => "Title", // todo: use NestedTitle(2)
|
||||||
|
"link" => true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -173,14 +174,14 @@ class SideReport_ToDo extends SideReport {
|
|||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
class SideReport_BrokenLinks extends SideReport {
|
class SideReport_BrokenLinks extends SS_Report {
|
||||||
function title() {
|
function title() {
|
||||||
return _t('SideReport.BROKENLINKS',"Pages with broken links");
|
return _t('SideReport.BROKENLINKS',"Pages with broken links");
|
||||||
}
|
}
|
||||||
function group() {
|
function group() {
|
||||||
return "Broken links reports";
|
return "Broken links reports";
|
||||||
}
|
}
|
||||||
function records($params = null) {
|
function sourceRecords($params = null) {
|
||||||
// Get class names for page types that are not virtual pages or redirector pages
|
// Get class names for page types that are not virtual pages or redirector pages
|
||||||
$classes = array_diff(ClassInfo::subclassesFor('SiteTree'), ClassInfo::subclassesFor('VirtualPage'), ClassInfo::subclassesFor('RedirectorPage'));
|
$classes = array_diff(ClassInfo::subclassesFor('SiteTree'), ClassInfo::subclassesFor('VirtualPage'), ClassInfo::subclassesFor('RedirectorPage'));
|
||||||
$classNames = "'".join("','", $classes)."'";
|
$classNames = "'".join("','", $classes)."'";
|
||||||
@ -189,12 +190,15 @@ class SideReport_BrokenLinks extends SideReport {
|
|||||||
else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenLink = 1");
|
else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenLink = 1");
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
function fieldsToShow() {
|
function columns() {
|
||||||
return array(
|
return array(
|
||||||
"Title" => array("NestedTitle", array("2")),
|
"Title" => array(
|
||||||
|
"title" => "Title", // todo: use NestedTitle(2)
|
||||||
|
"link" => true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function getParameterFields() {
|
function parameterFields() {
|
||||||
return new FieldSet(
|
return new FieldSet(
|
||||||
new CheckboxField('OnLive', 'Check live site')
|
new CheckboxField('OnLive', 'Check live site')
|
||||||
);
|
);
|
||||||
@ -207,14 +211,14 @@ class SideReport_BrokenLinks extends SideReport {
|
|||||||
* @package cms
|
* @package cms
|
||||||
* @subpackage content
|
* @subpackage content
|
||||||
*/
|
*/
|
||||||
class SideReport_BrokenFiles extends SideReport {
|
class SideReport_BrokenFiles extends SS_Report {
|
||||||
function title() {
|
function title() {
|
||||||
return _t('SideReport.BROKENFILES',"Pages with broken files");
|
return _t('SideReport.BROKENFILES',"Pages with broken files");
|
||||||
}
|
}
|
||||||
function group() {
|
function group() {
|
||||||
return "Broken links reports";
|
return "Broken links reports";
|
||||||
}
|
}
|
||||||
function records($params = null) {
|
function sourceRecords($params = null) {
|
||||||
// Get class names for page types that are not virtual pages or redirector pages
|
// Get class names for page types that are not virtual pages or redirector pages
|
||||||
$classes = array_diff(ClassInfo::subclassesFor('SiteTree'), ClassInfo::subclassesFor('VirtualPage'), ClassInfo::subclassesFor('RedirectorPage'));
|
$classes = array_diff(ClassInfo::subclassesFor('SiteTree'), ClassInfo::subclassesFor('VirtualPage'), ClassInfo::subclassesFor('RedirectorPage'));
|
||||||
$classNames = "'".join("','", $classes)."'";
|
$classNames = "'".join("','", $classes)."'";
|
||||||
@ -223,52 +227,58 @@ class SideReport_BrokenFiles extends SideReport {
|
|||||||
else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenFile = 1");
|
else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenFile = 1");
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
function fieldsToShow() {
|
function columns() {
|
||||||
return array(
|
return array(
|
||||||
"Title" => array("NestedTitle", array("2")),
|
"Title" => array(
|
||||||
|
"title" => "Title", // todo: use NestedTitle(2)
|
||||||
|
"link" => true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function getParameterFields() {
|
function parameterFields() {
|
||||||
return new FieldSet(
|
return new FieldSet(
|
||||||
new CheckboxField('OnLive', 'Check live site')
|
new CheckboxField('OnLive', 'Check live site')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SideReport_BrokenVirtualPages extends SideReport {
|
class SideReport_BrokenVirtualPages extends SS_Report {
|
||||||
function title() {
|
function title() {
|
||||||
return _t('SideReport.BROKENVIRTUALPAGES', 'VirtualPages pointing to deleted pages');
|
return _t('SideReport.BROKENVIRTUALPAGES', 'VirtualPages pointing to deleted pages');
|
||||||
}
|
}
|
||||||
function group() {
|
function group() {
|
||||||
return "Broken links reports";
|
return "Broken links reports";
|
||||||
}
|
}
|
||||||
function records($params = null) {
|
function sourceRecords($params = null) {
|
||||||
$classNames = "'".join("','", ClassInfo::subclassesFor('VirtualPage'))."'";
|
$classNames = "'".join("','", ClassInfo::subclassesFor('VirtualPage'))."'";
|
||||||
if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "ClassName IN ($classNames) AND HasBrokenLink = 1");
|
if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "ClassName IN ($classNames) AND HasBrokenLink = 1");
|
||||||
else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenLink = 1");
|
else $ret = DataObject::get('SiteTree', "ClassName IN ($classNames) AND HasBrokenLink = 1");
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fieldsToShow() {
|
function columns() {
|
||||||
return array(
|
return array(
|
||||||
"Title" => array("NestedTitle", array("2")),
|
"Title" => array(
|
||||||
|
"title" => "Title", // todo: use NestedTitle(2)
|
||||||
|
"link" => true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function getParameterFields() {
|
function parameterFields() {
|
||||||
return new FieldSet(
|
return new FieldSet(
|
||||||
new CheckboxField('OnLive', 'Check live site')
|
new CheckboxField('OnLive', 'Check live site')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SideReport_BrokenRedirectorPages extends SideReport {
|
class SideReport_BrokenRedirectorPages extends SS_Report {
|
||||||
function title() {
|
function title() {
|
||||||
return _t('SideReport.BROKENREDIRECTORPAGES', 'RedirectorPages pointing to deleted pages');
|
return _t('SideReport.BROKENREDIRECTORPAGES', 'RedirectorPages pointing to deleted pages');
|
||||||
}
|
}
|
||||||
function group() {
|
function group() {
|
||||||
return "Broken links reports";
|
return "Broken links reports";
|
||||||
}
|
}
|
||||||
function records($params = null) {
|
function sourceRecords($params = null) {
|
||||||
$classNames = "'".join("','", ClassInfo::subclassesFor('RedirectorPage'))."'";
|
$classNames = "'".join("','", ClassInfo::subclassesFor('RedirectorPage'))."'";
|
||||||
|
|
||||||
if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "ClassName IN ($classNames) AND HasBrokenLink = 1");
|
if (isset($_REQUEST['OnLive'])) $ret = Versioned::get_by_stage('SiteTree', 'Live', "ClassName IN ($classNames) AND HasBrokenLink = 1");
|
||||||
@ -276,14 +286,38 @@ class SideReport_BrokenRedirectorPages extends SideReport {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fieldsToShow() {
|
function columns() {
|
||||||
return array(
|
return array(
|
||||||
"Title" => array("NestedTitle", array("2")),
|
"Title" => array(
|
||||||
|
"title" => "Title", // todo: use NestedTitle(2)
|
||||||
|
"link" => true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function getParameterFields() {
|
function parameterFields() {
|
||||||
return new FieldSet(
|
return new FieldSet(
|
||||||
new CheckboxField('OnLive', 'Check live site')
|
new CheckboxField('OnLive', 'Check live site')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class SideReport_ToDo extends SS_Report {
|
||||||
|
function title() {
|
||||||
|
return _t('SideReport.TODO',"To do");
|
||||||
|
}
|
||||||
|
function sourceRecords($params = null) {
|
||||||
|
return DataObject::get("SiteTree", "\"SiteTree\".\"ToDo\" IS NOT NULL AND \"SiteTree\".\"ToDo\" <> ''", "\"SiteTree\".\"LastEdited\" DESC");
|
||||||
|
}
|
||||||
|
function columns() {
|
||||||
|
return array(
|
||||||
|
"Title" => array(
|
||||||
|
"title" => "Title", // todo: use NestedTitle(2)
|
||||||
|
"link" => true,
|
||||||
|
),
|
||||||
|
"ToDo" => array(
|
||||||
|
"title" => "ToDo",
|
||||||
|
"newline" => true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user