mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
49244234d4
commit
cc89bc68e9
@ -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;
|
||||
$reports = SSReport::get_reports('ReportAdmin');
|
||||
$obj = $reports[$id];
|
||||
|
||||
$obj = new $reportClass();
|
||||
if($obj) $fields = $obj->getCMSFields();
|
||||
if($obj) $actions = $obj->getCMSActions();
|
||||
|
||||
|
@ -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"> </div>
|
||||
<% end_if %>
|
||||
|
||||
$FieldMap.ReportContent.FieldHolder
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user