mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGF Renamed Report class to SSReport, file name wasn't altered but class name was
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@63842 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ed4103bc11
commit
20e266d5cb
89
code/SSReport.php
Normal file
89
code/SSReport.php
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Base "abstract" class for all Report classes
|
||||||
|
* viewable in the Reports top menu section of CMS.
|
||||||
|
*/
|
||||||
|
class SSReport extends ViewableData {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the title of the report,
|
||||||
|
* used by the ReportAdmin templates.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $title = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a description about what this
|
||||||
|
* report does. Used by the ReportAdmin
|
||||||
|
* templates.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a FieldSet with which to create the CMS editing form.
|
||||||
|
* You can use the extend() method of FieldSet to create customised forms for your other
|
||||||
|
* data objects.
|
||||||
|
*
|
||||||
|
* @uses getReportField() to render a table, or similar field for the report. This
|
||||||
|
* method should be defined on the Report subclasses.
|
||||||
|
*
|
||||||
|
* @return FieldSet
|
||||||
|
*/
|
||||||
|
function getCMSFields() {
|
||||||
|
$fields = new FieldSet(
|
||||||
|
new TabSet('Root',
|
||||||
|
new Tab('Report',
|
||||||
|
new LiteralField('ReportTitle', "<h3>{$this->title}</h3>"),
|
||||||
|
new LiteralField('ReportDescription', "<p>{$this->description}</p>"),
|
||||||
|
$this->getReportField()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->extend('augmentReportCMSFields', $fields);
|
||||||
|
|
||||||
|
return $fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a field, such as a {@link ComplexTableField} that is
|
||||||
|
* used to show and manipulate data relating to this report.
|
||||||
|
*
|
||||||
|
* For example, if this were an "Unprinted Orders" report, this
|
||||||
|
* field would return a table that shows all Orders with "Unprinted = 1".
|
||||||
|
*
|
||||||
|
* @return FormField subclass
|
||||||
|
*/
|
||||||
|
function getReportField() {
|
||||||
|
user_error('Please implement getReportField() on ' . $this->class, E_USER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the name of this report, which
|
||||||
|
* is used by the templates to render the
|
||||||
|
* name of the report in the report tree,
|
||||||
|
* the left hand pane inside ReportAdmin.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function TreeTitle() {
|
||||||
|
return $this->title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the ID of this Report class.
|
||||||
|
* Because it doesn't have a number, we
|
||||||
|
* use the class name as the ID.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function ID() {
|
||||||
|
return $this->class;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user