aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-08-01 11:57:54 +0500
committerAbyss777 <abyss@fox5.ru>2017-08-01 11:57:54 +0500
commit9f7b998c50b304205858973fe542b49b0e705be5 (patch)
tree8ef8f08fb184ebb52bc1c42e2d5dc5f7dd624de0 /web
parent3f4190a60c119f55822b218cc54fff22ff3c2ac5 (diff)
downloadtrackermap-web-9f7b998c50b304205858973fe542b49b0e705be5.tar.gz
trackermap-web-9f7b998c50b304205858973fe542b49b0e705be5.tar.bz2
trackermap-web-9f7b998c50b304205858973fe542b49b0e705be5.zip
Implemented attribute to disable reports
Diffstat (limited to 'web')
-rw-r--r--web/app/controller/Root.js12
-rw-r--r--web/app/store/ServerAttributes.js4
-rw-r--r--web/app/store/UserAttributes.js4
-rw-r--r--web/app/view/map/MapController.js3
-rw-r--r--web/l10n/en.json1
5 files changed, 21 insertions, 3 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index d85102a7..27455b39 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -103,7 +103,7 @@ Ext.define('Traccar.controller.Root', {
},
loadApp: function () {
- var attribution, eventId;
+ var attribution, eventId, main, i;
Ext.getStore('Groups').load();
Ext.getStore('Drivers').load();
Ext.getStore('Geofences').load();
@@ -124,7 +124,15 @@ Ext.define('Traccar.controller.Root', {
if (Traccar.app.isMobile()) {
Ext.create('widget.mainMobile');
} else {
- Ext.create('widget.main');
+ main = Ext.create('widget.main');
+ if (Traccar.app.getAttributePreference('web.disableReport', false)) {
+ for (i = 0; i < main.items.length; i++) {
+ if (main.items.items[i].xtype === 'reportView') {
+ main.items.items[i].hide();
+ break;
+ }
+ }
+ }
}
eventId = Ext.Object.fromQueryString(window.location.search).eventId;
if (eventId) {
diff --git a/web/app/store/ServerAttributes.js b/web/app/store/ServerAttributes.js
index 05002f16..7d720836 100644
--- a/web/app/store/ServerAttributes.js
+++ b/web/app/store/ServerAttributes.js
@@ -47,5 +47,9 @@ Ext.define('Traccar.store.ServerAttributes', {
allowDecimals: false,
minValue: Traccar.Style.mapDefaultZoom,
maxValue: Traccar.Style.mapMaxZoom
+ }, {
+ key: 'web.disableReport',
+ name: Strings.attributeWebDisableReport,
+ valueType: 'boolean'
}]
});
diff --git a/web/app/store/UserAttributes.js b/web/app/store/UserAttributes.js
index 91a54d04..928a9be8 100644
--- a/web/app/store/UserAttributes.js
+++ b/web/app/store/UserAttributes.js
@@ -79,5 +79,9 @@ Ext.define('Traccar.store.UserAttributes', {
allowDecimals: false,
minValue: Traccar.Style.mapDefaultZoom,
maxValue: Traccar.Style.mapMaxZoom
+ }, {
+ key: 'web.disableReport',
+ name: Strings.attributeWebDisableReport,
+ valueType: 'boolean'
}]
});
diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js
index 02d4e382..39cf5101 100644
--- a/web/app/view/map/MapController.js
+++ b/web/app/view/map/MapController.js
@@ -44,7 +44,8 @@ Ext.define('Traccar.view.map.MapController', {
init: function () {
this.callParent();
- this.lookupReference('showReportsButton').setVisible(Traccar.app.isMobile());
+ this.lookupReference('showReportsButton').setVisible(Traccar.app.isMobile() &&
+ !Traccar.app.getAttributePreference('web.disableReport', false));
this.lookupReference('showEventsButton').setVisible(Traccar.app.isMobile());
},
diff --git a/web/l10n/en.json b/web/l10n/en.json
index ba34d066..05239354 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -88,6 +88,7 @@
"attributeMailSmtpAuth": "Mail: SMTP Auth Enable",
"attributeMailSmtpUsername": "Mail: SMTP Username",
"attributeMailSmtpPassword": "Mail: SMTP Password",
+ "attributeWebDisableReport": "Web: Disable Report",
"errorTitle": "Error",
"errorGeneral": "Invalid parameters or constraints violation",
"errorConnection": "Connection error",