mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX: More fixes renaming SSReport to SS_Report
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@98218 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
983849449e
commit
2ff2d28841
@ -662,7 +662,7 @@ JS;
|
||||
}
|
||||
|
||||
function SideReports() {
|
||||
return SSReport::get_reports('SideReport');
|
||||
return SS_Report::get_reports('SideReport');
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -35,7 +35,7 @@
|
||||
* Showing reports to the user
|
||||
* ===========================
|
||||
*
|
||||
* Right now, all subclasses of SSReport will be shown in the ReportAdmin. However, we are planning
|
||||
* Right now, all subclasses of SS_Report will be shown in the ReportAdmin. However, we are planning
|
||||
* on adding an explicit registration mechanism, so that you can decide which reports go in the
|
||||
* report admin, and which go elsewhere (such as the side panel in the CMS).
|
||||
*
|
||||
@ -44,7 +44,7 @@
|
||||
*/
|
||||
class SS_Report extends ViewableData {
|
||||
/**
|
||||
* Report registry populated by {@link SSReport::register()}
|
||||
* Report registry populated by {@link SS_Report::register()}
|
||||
*/
|
||||
private static $registered_reports = array();
|
||||
|
||||
@ -107,7 +107,7 @@ class SS_Report extends ViewableData {
|
||||
*/
|
||||
function sourceQuery($params) {
|
||||
if($this->hasMethod('sourceRecords')) {
|
||||
$query = new SSReport_FakeQuery($this, 'sourceRecords', $params);
|
||||
$query = new SS_Report_FakeQuery($this, 'sourceRecords', $params);
|
||||
$query->setSortColumnMethod('sortColumns');
|
||||
return $query;
|
||||
} else {
|
||||
@ -163,7 +163,7 @@ class SS_Report extends ViewableData {
|
||||
* data objects.
|
||||
*
|
||||
* @uses getReportField() to render a table, or similar field for the report. This
|
||||
* method should be defined on the SSReport subclasses.
|
||||
* method should be defined on the SS_Report subclasses.
|
||||
*
|
||||
* @return FieldSet
|
||||
*/
|
||||
@ -296,8 +296,8 @@ class SS_Report extends ViewableData {
|
||||
* The default value is zero.
|
||||
*/
|
||||
static function register($list, $reportClass, $priority = 0) {
|
||||
if(strpos($reportClass, '(') === false && (!class_exists($reportClass) || !is_subclass_of($reportClass,'SSReport'))) {
|
||||
user_error("SSReport::register(): '$reportClass' is not a subclass of SSReport", E_USER_WARNING);
|
||||
if(strpos($reportClass, '(') === false && (!class_exists($reportClass) || !is_subclass_of($reportClass,'SS_Report'))) {
|
||||
user_error("SS_Report::register(): '$reportClass' is not a subclass of SS_Report", E_USER_WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -312,8 +312,8 @@ class SS_Report extends ViewableData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SSReport objects making up the given list.
|
||||
* @return An array of SSReport objects
|
||||
* Return the SS_Report objects making up the given list.
|
||||
* @return An array of SS_Report objects
|
||||
*/
|
||||
static function get_reports($list) {
|
||||
$output = array();
|
||||
@ -349,17 +349,17 @@ class SS_Report extends ViewableData {
|
||||
* Use it like this:
|
||||
*
|
||||
* function sourceQuery($params) {
|
||||
* return new SSReport_FakeQuery($this, 'sourceRecords', $params)
|
||||
* return new SS_Report_FakeQuery($this, 'sourceRecords', $params)
|
||||
* }
|
||||
* function sourceRecords($params, $sort, $limit) {
|
||||
* // Do some stuff
|
||||
* // Return a DataObjectSet of actual objects.
|
||||
* }
|
||||
*
|
||||
* This object is used by the default implementation of sourceQuery() on SSReport, to make use of
|
||||
* This object is used by the default implementation of sourceQuery() on SS_Report, to make use of
|
||||
* a sourceReords() method if one exists.
|
||||
*/
|
||||
class SSReport_FakeQuery extends SQLQuery {
|
||||
class SS_Report_FakeQuery extends SQLQuery {
|
||||
public $orderby;
|
||||
public $limit;
|
||||
|
||||
@ -410,20 +410,20 @@ class SSReport_FakeQuery extends SQLQuery {
|
||||
}
|
||||
|
||||
/**
|
||||
* SSReportWrapper is a base class for creating report wappers.
|
||||
* SS_ReportWrapper is a base class for creating report wappers.
|
||||
*
|
||||
* Wrappers encapsulate an existing report to alter their behaviour - they are implementations of
|
||||
* the standard GoF decorator pattern.
|
||||
*
|
||||
* This base class ensure that, by default, wrappers behave in the same way as the report that is
|
||||
* being wrapped. You should override any methods that need to behave differently in your subclass
|
||||
* of SSReportWrapper.
|
||||
* of SS_ReportWrapper.
|
||||
*
|
||||
* It also makes calls to 2 empty methods that you can override {@link beforeQuery()} and
|
||||
* {@link afterQuery()}
|
||||
*/
|
||||
|
||||
abstract class SSReportWrapper extends SSReport {
|
||||
abstract class SS_ReportWrapper extends SS_Report {
|
||||
protected $baseReport;
|
||||
|
||||
function __construct($baseReport) {
|
||||
|
@ -67,7 +67,7 @@ class ReportAdmin extends LeftAndMain {
|
||||
*/
|
||||
public function Reports() {
|
||||
$output = new DataObjectSet();
|
||||
foreach(SSReport::get_reports('ReportAdmin') as $report) {
|
||||
foreach(SS_Report::get_reports('ReportAdmin') as $report) {
|
||||
if($report->canView()) $output->push($report);
|
||||
}
|
||||
return $output;
|
||||
@ -129,7 +129,7 @@ class ReportAdmin extends LeftAndMain {
|
||||
/**
|
||||
* Get the current report
|
||||
*
|
||||
* @return SSReport
|
||||
* @return SS_Report
|
||||
*/
|
||||
public function CurrentReport() {
|
||||
$id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : Session::get('currentReport');
|
||||
@ -158,7 +158,7 @@ class ReportAdmin extends LeftAndMain {
|
||||
$fields = new FieldSet();
|
||||
$actions = new FieldSet();
|
||||
|
||||
$reports = SSReport::get_reports('ReportAdmin');
|
||||
$reports = SS_Report::get_reports('ReportAdmin');
|
||||
$obj = $reports[$id];
|
||||
|
||||
if($obj) $fields = $obj->getCMSFields();
|
||||
@ -198,7 +198,7 @@ class ReportAdmin extends LeftAndMain {
|
||||
* @return boolean
|
||||
*/
|
||||
public static function has_reports() {
|
||||
return sizeof(SSReport::get_reports('ReportAdmin')) > 0;
|
||||
return sizeof(SS_Report::get_reports('ReportAdmin')) > 0;
|
||||
}
|
||||
|
||||
public function updatereport() {
|
||||
|
@ -98,7 +98,7 @@ class SideReportView extends ViewableData {
|
||||
*
|
||||
* This report wrapper will use sideReportColumns() for the report columns, instead of columns().
|
||||
*/
|
||||
class SideReportWrapper extends SSReportWrapper {
|
||||
class SideReportWrapper extends SS_ReportWrapper {
|
||||
function columns() {
|
||||
if($this->baseReport->hasMethod('sideReportColumns')) {
|
||||
return $this->baseReport->sideReportColumns();
|
||||
@ -168,7 +168,7 @@ class SideReport_RecentlyEdited extends SS_Report {
|
||||
}
|
||||
}
|
||||
|
||||
class SideReport_ToDo extends SideReport {
|
||||
class SideReport_ToDo extends SS_Report {
|
||||
function title() {
|
||||
return _t('SideReport.TODO',"Pages with To Do items");
|
||||
}
|
||||
@ -178,17 +178,17 @@ class SideReport_ToDo extends SideReport {
|
||||
function sort() {
|
||||
return 0;
|
||||
}
|
||||
function records($params = null) {
|
||||
function sourceRecords($params = null) {
|
||||
return DataObject::get("SiteTree", "\"SiteTree\".\"ToDo\" IS NOT NULL AND \"SiteTree\".\"ToDo\" <> ''", "\"SiteTree\".\"LastEdited\" DESC");
|
||||
}
|
||||
function fieldsToShow() {
|
||||
function columns() {
|
||||
return array(
|
||||
"Title" => array(
|
||||
"source" => array("NestedTitle", array("2")),
|
||||
"title" => "Title", // todo: use NestedTitle(2)
|
||||
"link" => true,
|
||||
),
|
||||
"ToDo" => array(
|
||||
"source" => "ToDo",
|
||||
"title" => "ToDo",
|
||||
"newline" => true,
|
||||
),
|
||||
);
|
||||
@ -326,24 +326,3 @@ class SideReport_BrokenRedirectorPages extends SS_Report {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @subpackage content
|
||||
*/
|
||||
|
||||
class BrokenLinksReport extends SSReport {
|
||||
class BrokenLinksReport extends SS_Report {
|
||||
function title() {
|
||||
return _t('BrokenLinksReport.BROKENLINKS',"Broken links report");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user