mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge pull request #1017 from tractorcow/pulls/3.1/fix-report-sorting
BUG Fix sorting on main ReportAdmin grid
This commit is contained in:
commit
796874dae7
@ -37,7 +37,9 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider {
|
||||
parent::init();
|
||||
|
||||
//set the report we are currently viewing from the URL
|
||||
$this->reportClass = (isset($this->urlParams['ReportClass'])) ? $this->urlParams['ReportClass'] : null;
|
||||
$this->reportClass = (isset($this->urlParams['ReportClass']) && $this->urlParams['ReportClass'] !== 'index')
|
||||
? $this->urlParams['ReportClass']
|
||||
: null;
|
||||
$allReports = SS_Report::get_reports();
|
||||
$this->reportObject = (isset($allReports[$this->reportClass])) ? $allReports[$this->reportClass] : null;
|
||||
|
||||
@ -132,8 +134,11 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider {
|
||||
* @return String
|
||||
*/
|
||||
public function Link($action = null) {
|
||||
$link = parent::Link($action);
|
||||
if ($this->reportObject) $link = $this->reportObject->getLink($action);
|
||||
if ($this->reportObject) {
|
||||
$link = $this->reportObject->getLink($action);
|
||||
} else {
|
||||
$link = self::join_links(parent::Link('index'), $action);
|
||||
}
|
||||
return $link;
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,15 @@ class SS_Report extends ViewableData {
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows access to title as a property
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle() {
|
||||
return $this->title();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the description of this report.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user