Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
github-actions | 6942278b41 | |
Guy Sartorelli | c9c6c3ff1e | |
Guy Sartorelli | f5b5daa711 | |
github-actions | aa3d0a3b6a | |
Guy Sartorelli | aa085022a1 | |
Will Rossiter | a25d0432c4 | |
github-actions | 030c56777c | |
Guy Sartorelli | 03869a7535 |
|
@ -0,0 +1,9 @@
|
|||
mappings:
|
||||
SS_Report: SilverStripe\Reports\Report
|
||||
SilverStripe\Reports\SS_Report: SilverStripe\Reports\Report
|
||||
SS_ReportWrapper: SilverStripe\Reports\ReportWrapper
|
||||
SilverStripe\Reports\SS_ReportWrapper: SilverStripe\Reports\ReportWrapper
|
||||
ReportAdmin: SilverStripe\Reports\ReportAdmin
|
||||
SideReportView: SilverStripe\Reports\SideReportView
|
||||
SideReportWrapper: SilverStripe\Reports\SideReportWrapper
|
||||
SideReport: SilverStripe\Reports\SideReportView
|
13
README.md
13
README.md
|
@ -3,16 +3,15 @@
|
|||
[![CI](https://github.com/silverstripe/silverstripe-reports/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-reports/actions/workflows/ci.yml)
|
||||
[![Silverstripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
composer require silverstripe/reports
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
This module contains the API's for building Reports that are displayed in the
|
||||
Silverstripe backend.
|
||||
Silverstripe backend. This module replaces the built-in reports API from earlier
|
||||
versions of Silverstripe (2.4 and 3.0).
|
||||
|
||||
## Requirements
|
||||
|
||||
* Silverstripe 4.0
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ abstract class ReportWrapper extends Report
|
|||
|
||||
public function group()
|
||||
{
|
||||
/** @skipUpgrade */
|
||||
return $this->baseReport->hasMethod('group') ? $this->baseReport->group() : 'Group';
|
||||
}
|
||||
|
||||
|
|
|
@ -20,17 +20,17 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"silverstripe/framework": "^5",
|
||||
"silverstripe/admin": "^2",
|
||||
"silverstripe/versioned": "^2",
|
||||
"silverstripe/config": "^2",
|
||||
"silverstripe/assets": "^2",
|
||||
"silverstripe/vendor-plugin": "^2"
|
||||
"php": "^7.4 || ^8.0",
|
||||
"silverstripe/framework": "^4.11",
|
||||
"silverstripe/admin": "^1.6@dev",
|
||||
"silverstripe/versioned": "^1.6@dev",
|
||||
"silverstripe/config": "^1.0@dev",
|
||||
"silverstripe/assets": "^1.6@dev",
|
||||
"silverstripe/vendor-plugin": "^1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"squizlabs/php_codesniffer": "^3.7"
|
||||
"squizlabs/php_codesniffer": "^3.0"
|
||||
},
|
||||
"extra": {
|
||||
"expose": [
|
||||
|
|
|
@ -2,17 +2,32 @@
|
|||
* File: ReportAdmin.js
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.entwine('ss', function($){
|
||||
$('.ReportAdmin .cms-edit-form').entwine({
|
||||
onsubmit: function(e) {
|
||||
var url = $.path.parseUrl(document.location.href).hrefNoSearch,
|
||||
params = this.find(':input[name^=filters]').serializeArray();
|
||||
params = $.grep(params, function(param) {return (param.value);}); // filter out empty
|
||||
if(params) url = $.path.addSearchParams(url, $.param(params));
|
||||
$('.cms-container').loadPanel(url);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
(function ($) {
|
||||
$.entwine("ss", function ($) {
|
||||
$(".ReportAdmin .cms-edit-form").entwine({
|
||||
onsubmit: function (e) {
|
||||
let url = $.path.parseUrl(document.location.href).hrefNoSearch;
|
||||
let params = this.find(":input[name^=filters]").serializeArray();
|
||||
|
||||
try {
|
||||
params = $.grep(params, function (param) {
|
||||
// filter out empty
|
||||
return param.value;
|
||||
});
|
||||
|
||||
// convert params to a query string
|
||||
params = $.param(params);
|
||||
|
||||
// append query string to url
|
||||
url += "?" + params;
|
||||
|
||||
$(".cms-container").loadPanel(url);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
en:
|
||||
SilverStripe\CMS\Controllers\CMSPageHistoryController:
|
||||
PREVIEW: 'Website preview'
|
||||
SilverStripe\Forms\GridField\GridField:
|
||||
Filter: Filter
|
||||
SilverStripe\Reports\ReportAdmin:
|
||||
MENUTITLE: Reports
|
||||
ReportTitle: Title
|
||||
SilverStripe\Reports\SideReport:
|
||||
OtherGroupTitle: Other
|
||||
REPEMPTY: 'The {title} report is empty.'
|
||||
SilverStripe\CMS\Controllers\CMSPageHistoryController:
|
||||
PREVIEW: 'Website preview'
|
||||
SilverStripe\Forms\GridField\GridField:
|
||||
Filter: Filter
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
eo:
|
||||
SilverStripe\CMS\Controllers\CMSPageHistoryController:
|
||||
PREVIEW: 'Retejon antaŭvidi'
|
||||
SilverStripe\Forms\GridField\GridField:
|
||||
Filter: Filtrilo
|
||||
SilverStripe\Reports\ReportAdmin:
|
||||
MENUTITLE: Raportoj
|
||||
ReportTitle: Titoloj
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
sk:
|
||||
SilverStripe\CMS\Controllers\CMSPageHistoryController:
|
||||
PREVIEW: 'Náhľad webovej stránky'
|
||||
SilverStripe\Reports\ReportAdmin:
|
||||
MENUTITLE: Výkazy
|
||||
ReportTitle: Titulok
|
||||
MENUTITLE: Správy
|
||||
ReportTitle: Názov
|
||||
SilverStripe\Reports\SideReport:
|
||||
OtherGroupTitle: Iné
|
||||
REPEMPTY: 'Výkaz {title} je prázdny.'
|
||||
REPEMPTY: 'Správa {title} je prázdna.'
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
sv:
|
||||
SilverStripe\CMS\Controllers\CMSPageHistoryController:
|
||||
PREVIEW: 'Webbplats förhandsvisning'
|
||||
SilverStripe\Reports\ReportAdmin:
|
||||
MENUTITLE: Rapporter
|
||||
ReportTitle: Titel
|
||||
|
|
|
@ -23,7 +23,7 @@ class ReportAdminTest extends SapphireTest
|
|||
$this->assertCount(2, $breadcrumbs);
|
||||
$map = $breadcrumbs[0]->toMap();
|
||||
$this->assertSame('Reports', $map['Title']);
|
||||
$this->assertSame('admin/reports', $map['Link']);
|
||||
$this->assertSame('admin/reports/', $map['Link']);
|
||||
|
||||
$map = $breadcrumbs[1]->toMap();
|
||||
$this->assertSame('Fake report', $map['Title']);
|
||||
|
@ -36,7 +36,7 @@ class ReportAdminTest extends SapphireTest
|
|||
|
||||
$map = $breadcrumbs[0]->toMap();
|
||||
$this->assertSame('Reports', $map['Title']);
|
||||
$this->assertSame('admin/reports', $map['Link']);
|
||||
$this->assertSame('admin/reports/', $map['Link']);
|
||||
|
||||
$map = $breadcrumbs[1]->toMap();
|
||||
$this->assertSame('Fake report title', $map['Title']);
|
||||
|
|
Loading…
Reference in New Issue