mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Rename SS_ prefixed classes (#46)
This commit is contained in:
parent
c6b6c5fb2a
commit
b2f3902996
@ -1,6 +1,8 @@
|
|||||||
mappings:
|
mappings:
|
||||||
SS_Report: SilverStripe\Reports\SS_Report
|
SS_Report: SilverStripe\Reports\Report
|
||||||
SS_ReportWrapper: SilverStripe\Reports\SS_ReportWrapper
|
SilverStripe\Reports\SS_Report: SilverStripe\Reports\Report
|
||||||
|
SS_ReportWrapper: SilverStripe\Reports\ReportWrapper
|
||||||
|
SilverStripe\Reports\SS_ReportWrapper: SilverStripe\Reports\ReportWrapper
|
||||||
ReportAdmin: SilverStripe\Reports\ReportAdmin
|
ReportAdmin: SilverStripe\Reports\ReportAdmin
|
||||||
SideReportView: SilverStripe\Reports\SideReportView
|
SideReportView: SilverStripe\Reports\SideReportView
|
||||||
SideReportWrapper: SilverStripe\Reports\SideReportWrapper
|
SideReportWrapper: SilverStripe\Reports\SideReportWrapper
|
||||||
|
@ -52,7 +52,7 @@ use ReflectionClass;
|
|||||||
* Right now, all subclasses of SS_Report will be shown in the ReportAdmin. In SS3 there is only
|
* Right now, all subclasses of SS_Report will be shown in the ReportAdmin. In SS3 there is only
|
||||||
* one place where reports can go, so this class is greatly simplifed from its version in SS2.
|
* one place where reports can go, so this class is greatly simplifed from its version in SS2.
|
||||||
*/
|
*/
|
||||||
class SS_Report extends ViewableData
|
class Report extends ViewableData
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* This is the title of the report,
|
* This is the title of the report,
|
||||||
@ -88,8 +88,8 @@ class SS_Report extends ViewableData
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public static $excluded_reports = array(
|
public static $excluded_reports = array(
|
||||||
'SilverStripe\\Reports\\SS_Report',
|
'SilverStripe\\Reports\\Report',
|
||||||
'SilverStripe\\Reports\\SS_ReportWrapper',
|
'SilverStripe\\Reports\\ReportWrapper',
|
||||||
'SilverStripe\\Reports\\SideReportWrapper',
|
'SilverStripe\\Reports\\SideReportWrapper',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -189,8 +189,8 @@ class SS_Report extends ViewableData
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* counts the number of objects returned
|
* counts the number of objects returned
|
||||||
* @param Array $params - any parameters for the sourceRecords
|
* @param array $params - any parameters for the sourceRecords
|
||||||
* @return Int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getCount($params = array())
|
public function getCount($params = array())
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
|||||||
|
|
||||||
private static $template_path = null; // defaults to (project)/templates/email
|
private static $template_path = null; // defaults to (project)/templates/email
|
||||||
|
|
||||||
private static $tree_class = 'SilverStripe\\Reports\\SS_Report';
|
private static $tree_class = 'SilverStripe\\Reports\\Report';
|
||||||
|
|
||||||
private static $url_handlers = array(
|
private static $url_handlers = array(
|
||||||
'show/$ReportClass/$Action' => 'handleAction'
|
'show/$ReportClass/$Action' => 'handleAction'
|
||||||
@ -51,7 +51,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
|||||||
protected $reportClass;
|
protected $reportClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var SS_Report
|
* @var Report
|
||||||
*/
|
*/
|
||||||
protected $reportObject;
|
protected $reportObject;
|
||||||
|
|
||||||
@ -107,8 +107,8 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
|||||||
public function Reports()
|
public function Reports()
|
||||||
{
|
{
|
||||||
$output = new ArrayList();
|
$output = new ArrayList();
|
||||||
/** @var SS_Report $report */
|
/** @var Report $report */
|
||||||
foreach (SS_Report::get_reports() as $report) {
|
foreach (Report::get_reports() as $report) {
|
||||||
if ($report->canView()) {
|
if ($report->canView()) {
|
||||||
$output->push($report);
|
$output->push($report);
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
|||||||
|
|
||||||
// Check report
|
// Check report
|
||||||
if ($this->reportClass) {
|
if ($this->reportClass) {
|
||||||
$allReports = SS_Report::get_reports();
|
$allReports = Report::get_reports();
|
||||||
if (empty($allReports[$this->reportClass])) {
|
if (empty($allReports[$this->reportClass])) {
|
||||||
return $this->httpError(404);
|
return $this->httpError(404);
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider
|
|||||||
*/
|
*/
|
||||||
public static function has_reports()
|
public static function has_reports()
|
||||||
{
|
{
|
||||||
return sizeof(SS_Report::get_reports()) > 0;
|
return sizeof(Report::get_reports()) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,7 @@ namespace SilverStripe\Reports;
|
|||||||
* It also makes calls to 2 empty methods that you can override {@link beforeQuery()} and
|
* It also makes calls to 2 empty methods that you can override {@link beforeQuery()} and
|
||||||
* {@link afterQuery()}
|
* {@link afterQuery()}
|
||||||
*/
|
*/
|
||||||
abstract class SS_ReportWrapper extends SS_Report
|
abstract class ReportWrapper extends Report
|
||||||
{
|
{
|
||||||
protected $baseReport;
|
protected $baseReport;
|
||||||
|
|
@ -7,7 +7,7 @@ namespace SilverStripe\Reports;
|
|||||||
*
|
*
|
||||||
* This report wrapper will use sideReportColumns() for the report columns, instead of columns().
|
* This report wrapper will use sideReportColumns() for the report columns, instead of columns().
|
||||||
*/
|
*/
|
||||||
class SideReportWrapper extends SS_ReportWrapper
|
class SideReportWrapper extends ReportWrapper
|
||||||
{
|
{
|
||||||
public function columns()
|
public function columns()
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use SilverStripe\ORM\ArrayList;
|
use SilverStripe\ORM\ArrayList;
|
||||||
use SilverStripe\Reports\SS_Report;
|
use SilverStripe\Reports\Report;
|
||||||
use SilverStripe\Control\Session;
|
use SilverStripe\Control\Session;
|
||||||
use SilverStripe\Dev\SapphireTest;
|
use SilverStripe\Dev\SapphireTest;
|
||||||
use SilverStripe\Dev\TestOnly;
|
use SilverStripe\Dev\TestOnly;
|
||||||
@ -17,7 +17,7 @@ class ReportTest extends SapphireTest
|
|||||||
|
|
||||||
public function testGetReports()
|
public function testGetReports()
|
||||||
{
|
{
|
||||||
$reports = SS_Report::get_reports();
|
$reports = Report::get_reports();
|
||||||
$this->assertNotNull($reports, "Reports returned");
|
$this->assertNotNull($reports, "Reports returned");
|
||||||
$previousSort = 0;
|
$previousSort = 0;
|
||||||
foreach ($reports as $report) {
|
foreach ($reports as $report) {
|
||||||
@ -28,7 +28,7 @@ class ReportTest extends SapphireTest
|
|||||||
|
|
||||||
public function testExcludeReport()
|
public function testExcludeReport()
|
||||||
{
|
{
|
||||||
$reports = SS_Report::get_reports();
|
$reports = Report::get_reports();
|
||||||
$reportNames = array();
|
$reportNames = array();
|
||||||
foreach ($reports as $report) {
|
foreach ($reports as $report) {
|
||||||
$reportNames[] = $report->class;
|
$reportNames[] = $report->class;
|
||||||
@ -36,9 +36,9 @@ class ReportTest extends SapphireTest
|
|||||||
$this->assertContains('ReportTest_FakeTest', $reportNames, 'ReportTest_FakeTest is in reports list');
|
$this->assertContains('ReportTest_FakeTest', $reportNames, 'ReportTest_FakeTest is in reports list');
|
||||||
|
|
||||||
//exclude one report
|
//exclude one report
|
||||||
SS_Report::add_excluded_reports('ReportTest_FakeTest');
|
Report::add_excluded_reports('ReportTest_FakeTest');
|
||||||
|
|
||||||
$reports = SS_Report::get_reports();
|
$reports = Report::get_reports();
|
||||||
$reportNames = array();
|
$reportNames = array();
|
||||||
foreach ($reports as $report) {
|
foreach ($reports as $report) {
|
||||||
$reportNames[] = $report->class;
|
$reportNames[] = $report->class;
|
||||||
@ -46,9 +46,9 @@ class ReportTest extends SapphireTest
|
|||||||
$this->assertNotContains('ReportTest_FakeTest', $reportNames, 'ReportTest_FakeTest is NOT in reports list');
|
$this->assertNotContains('ReportTest_FakeTest', $reportNames, 'ReportTest_FakeTest is NOT in reports list');
|
||||||
|
|
||||||
//exclude two reports
|
//exclude two reports
|
||||||
SS_Report::add_excluded_reports(array('ReportTest_FakeTest', 'ReportTest_FakeTest2'));
|
Report::add_excluded_reports(array('ReportTest_FakeTest', 'ReportTest_FakeTest2'));
|
||||||
|
|
||||||
$reports = SS_Report::get_reports();
|
$reports = Report::get_reports();
|
||||||
$reportNames = array();
|
$reportNames = array();
|
||||||
foreach ($reports as $report) {
|
foreach ($reports as $report) {
|
||||||
$reportNames[] = $report->class;
|
$reportNames[] = $report->class;
|
||||||
@ -59,7 +59,7 @@ class ReportTest extends SapphireTest
|
|||||||
|
|
||||||
public function testAbstractClassesAreExcluded()
|
public function testAbstractClassesAreExcluded()
|
||||||
{
|
{
|
||||||
$reports = SS_Report::get_reports();
|
$reports = Report::get_reports();
|
||||||
$reportNames = array();
|
$reportNames = array();
|
||||||
foreach ($reports as $report) {
|
foreach ($reports as $report) {
|
||||||
$reportNames[] = $report->class;
|
$reportNames[] = $report->class;
|
||||||
@ -95,7 +95,7 @@ class ReportTest extends SapphireTest
|
|||||||
* @package reports
|
* @package reports
|
||||||
* @subpackage tests
|
* @subpackage tests
|
||||||
*/
|
*/
|
||||||
class ReportTest_FakeTest extends SS_Report implements TestOnly
|
class ReportTest_FakeTest extends Report implements TestOnly
|
||||||
{
|
{
|
||||||
public function title()
|
public function title()
|
||||||
{
|
{
|
||||||
@ -124,7 +124,7 @@ class ReportTest_FakeTest extends SS_Report implements TestOnly
|
|||||||
* @package reports
|
* @package reports
|
||||||
* @subpackage tests
|
* @subpackage tests
|
||||||
*/
|
*/
|
||||||
class ReportTest_FakeTest2 extends SS_Report implements TestOnly
|
class ReportTest_FakeTest2 extends Report implements TestOnly
|
||||||
{
|
{
|
||||||
public function title()
|
public function title()
|
||||||
{
|
{
|
||||||
@ -153,7 +153,7 @@ class ReportTest_FakeTest2 extends SS_Report implements TestOnly
|
|||||||
* @package reports
|
* @package reports
|
||||||
* @subpackage tests
|
* @subpackage tests
|
||||||
*/
|
*/
|
||||||
abstract class ReportTest_FakeTest_Abstract extends SS_Report implements TestOnly
|
abstract class ReportTest_FakeTest_Abstract extends Report implements TestOnly
|
||||||
{
|
{
|
||||||
|
|
||||||
public function title()
|
public function title()
|
||||||
|
Loading…
Reference in New Issue
Block a user