diff options
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/controller/Root.js | 12 | ||||
-rw-r--r-- | web/app/store/ServerAttributes.js | 4 | ||||
-rw-r--r-- | web/app/store/UserAttributes.js | 4 | ||||
-rw-r--r-- | web/app/view/map/MapController.js | 3 |
4 files changed, 20 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()); }, |