aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
Diffstat (limited to 'web/app')
-rw-r--r--web/app/store/ReportEventTypes.js2
-rw-r--r--web/app/view/ReportConfigController.js6
-rw-r--r--web/app/view/ReportController.js4
3 files changed, 7 insertions, 5 deletions
diff --git a/web/app/store/ReportEventTypes.js b/web/app/store/ReportEventTypes.js
index 4c2f69bb4..c5840305a 100644
--- a/web/app/store/ReportEventTypes.js
+++ b/web/app/store/ReportEventTypes.js
@@ -19,6 +19,8 @@ Ext.define('Traccar.store.ReportEventTypes', {
extend: 'Ext.data.Store',
fields: ['type', 'name'],
+ allEvents: '%',
+
data: [{
type: '%',
name: Strings.eventAll
diff --git a/web/app/view/ReportConfigController.js b/web/app/view/ReportConfigController.js
index d98690e95..5bd6ae7ef 100644
--- a/web/app/view/ReportConfigController.js
+++ b/web/app/view/ReportConfigController.js
@@ -44,10 +44,10 @@ Ext.define('Traccar.view.ReportConfigController', {
this.getView().callingPanel.deviceId = this.lookupReference('deviceField').getValue();
this.getView().callingPanel.groupId = this.lookupReference('groupField').getValue();
eventType = this.lookupReference('eventTypeField').getValue();
- if (eventType.indexOf('%') > -1) {
- eventType = ['%'];
+ if (eventType.indexOf(Ext.getStore('ReportEventTypes').allEvents) > -1) {
+ eventType = [Ext.getStore('ReportEventTypes').allEvents];
} else if (eventType.length === this.lookupReference('eventTypeField').getStore().getCount() - 1) {
- eventType = ['%'];
+ eventType = [Ext.getStore('ReportEventTypes').allEvents];
}
this.getView().callingPanel.eventType = eventType;
this.getView().callingPanel.fromDate = this.lookupReference('fromDateField').getValue();
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js
index 8f2b9b871..3fa26fcca 100644
--- a/web/app/view/ReportController.js
+++ b/web/app/view/ReportController.js
@@ -43,7 +43,7 @@ Ext.define('Traccar.view.ReportController', {
if (this.eventType !== undefined) {
dialog.lookupReference('eventTypeField').setValue(this.eventType);
} else {
- dialog.lookupReference('eventTypeField').setValue(['%']);
+ dialog.lookupReference('eventTypeField').setValue([Ext.getStore('ReportEventTypes').allEvents]);
}
if (this.fromDate !== undefined) {
dialog.lookupReference('fromDateField').setValue(this.fromDate);
@@ -143,7 +143,7 @@ Ext.define('Traccar.view.ReportController', {
disposition = response.getResponseHeader('Content-Disposition');
filename = disposition.slice(disposition.indexOf("=") + 1, disposition.length);
type = response.getResponseHeader('Content-Type');
- blob = new Blob([response.responseText], { type: type });
+ blob = new Blob([response.responseText], {type: type});
if (typeof window.navigator.msSaveBlob !== 'undefined') {
// IE workaround
window.navigator.msSaveBlob(blob, filename);