aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/DeviceMenuController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/DeviceMenuController.js')
-rw-r--r--web/app/view/DeviceMenuController.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/web/app/view/DeviceMenuController.js b/web/app/view/DeviceMenuController.js
index 6416314a..f191756c 100644
--- a/web/app/view/DeviceMenuController.js
+++ b/web/app/view/DeviceMenuController.js
@@ -1,6 +1,6 @@
/*
- * Copyright 2017 Anton Tananaev (anton@traccar.org)
- * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org)
+ * Copyright 2017 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2017 - 2018 Andrey Kunitsyn (andrey@traccar.org)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@ Ext.define('Traccar.view.DeviceMenuController', {
'Traccar.view.permissions.Notifications',
'Traccar.view.edit.ComputedAttributes',
'Traccar.view.permissions.SavedCommands',
+ 'Traccar.view.permissions.Maintenances',
'Traccar.view.BaseWindow'
],
@@ -36,7 +37,9 @@ Ext.define('Traccar.view.DeviceMenuController', {
Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes'));
this.lookupReference('menuCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false));
this.lookupReference('menuDeviceDistanceButton').setHidden(
- !Traccar.app.getUser().get('admin') && Traccar.app.getUser().get('userLimit') === 0 || Traccar.app.getVehicleFeaturesDisabled());
+ !Traccar.app.getUser().get('administrator') && Traccar.app.getUser().get('userLimit') === 0 || Traccar.app.getVehicleFeaturesDisabled());
+ this.lookupReference('menuMaintenancesButton').setHidden(
+ Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableMaintenances'));
},
onGeofencesClick: function () {
@@ -104,6 +107,19 @@ Ext.define('Traccar.view.DeviceMenuController', {
}).show();
},
+ onMaintenancesClick: function () {
+ Ext.create('Traccar.view.BaseWindow', {
+ title: Strings.sharedMaintenances,
+ items: {
+ xtype: 'linkMaintenancesView',
+ baseObjectName: 'deviceId',
+ linkObjectName: 'maintenanceId',
+ storeName: 'Maintenances',
+ baseObject: this.getView().up('deviceMenu').device.getId()
+ }
+ }).show();
+ },
+
onDeviceDistanceClick: function () {
var position, dialog = Ext.create('Traccar.view.dialog.DeviceDistance');
dialog.deviceId = this.getView().up('deviceMenu').device.getId();