aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/DeviceMenuController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2018-04-11 14:31:42 +0500
committerAbyss777 <abyss@fox5.ru>2018-04-19 12:15:59 +0500
commit19a9155d988dcee7698a65a45b0558aa0ff279d4 (patch)
treecea9ae5c73a625d01bc06df5742228b5cbbd1def /web/app/view/DeviceMenuController.js
parent4e7d2b8fdb41390205d69997d61db536545f5564 (diff)
downloadtrackermap-web-19a9155d988dcee7698a65a45b0558aa0ff279d4.tar.gz
trackermap-web-19a9155d988dcee7698a65a45b0558aa0ff279d4.tar.bz2
trackermap-web-19a9155d988dcee7698a65a45b0558aa0ff279d4.zip
Implement Maintenances
Diffstat (limited to 'web/app/view/DeviceMenuController.js')
-rw-r--r--web/app/view/DeviceMenuController.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/web/app/view/DeviceMenuController.js b/web/app/view/DeviceMenuController.js
index 6416314a..e50b0e0c 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'
],
@@ -37,6 +38,8 @@ Ext.define('Traccar.view.DeviceMenuController', {
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());
+ 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();