aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
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 d85102a..27455b3 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 05002f1..7d72083 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 91a54d0..928a9be 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 02d4e38..39cf510 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 ba34d06..0523935 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",