BUGFIX: Don't throw an error if there are no report filters.

ENHANCEMENT: Allow for custom generation of SSReport::ID() for parameterised reports.
MINOR: Added SSReport::dataClass() accessor.
BUGFIX: Don't randomise the order of reports with the same priority. (from r95955)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@98180 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-02-04 04:51:32 +00:00
parent 49244234d4
commit cc89bc68e9
2 changed files with 9 additions and 6 deletions

View File

@ -92,7 +92,7 @@ class ReportAdmin extends LeftAndMain {
* @return unknown
*/
protected function showWithEditForm($params, $editForm) {
if(isset($params['ID'])) Session::set('currentPage', $params['ID']);
if(isset($params['ID'])) Session::set('currentReport', $params['ID']);
if(isset($params['OtherID'])) Session::set('currentOtherID', $params['OtherID']);
if(Director::is_ajax()) {
@ -116,7 +116,7 @@ class ReportAdmin extends LeftAndMain {
* @return Form
*/
public function EditForm() {
$id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : Session::get('currentPage');
$id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : Session::get('currentReport');
if($id) {
foreach($this->Reports() as $report) {
@ -142,10 +142,9 @@ class ReportAdmin extends LeftAndMain {
$fields = new FieldSet();
$actions = new FieldSet();
if(is_numeric($id)) $page = DataObject::get_by_id('SiteTree', $id);
$reportClass = is_object($page) ? 'SS_Report_' . $page->ClassName : $id;
$obj = new $reportClass();
$reports = SSReport::get_reports('ReportAdmin');
$obj = $reports[$id];
if($obj) $fields = $obj->getCMSFields();
if($obj) $actions = $obj->getCMSActions();

View File

@ -11,6 +11,7 @@
<!-- Filters -->
<% if FieldMap.Filters.Children %>
<div style="border-bottom: 1px #AAA solid"><b>Filter by</b></div>
<% control FieldMap.Filters %>
@ -24,10 +25,13 @@
<div id="action_updatereport" style="float: left; margin: 1px 10px 10px 0">
<br />
<% if FieldMap.action_updatereport %>
$FieldMap.action_updatereport.Field
<% end_if %>
</div>
<div style="clear: both">&nbsp;</div>
<% end_if %>
$FieldMap.ReportContent.FieldHolder