From 19a9155d988dcee7698a65a45b0558aa0ff279d4 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 11 Apr 2018 14:31:42 +0500 Subject: Implement Maintenances --- web/app/view/DeviceMenuController.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'web/app/view/DeviceMenuController.js') diff --git a/web/app/view/DeviceMenuController.js b/web/app/view/DeviceMenuController.js index 6416314..e50b0e0 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(); -- cgit v1.2.3