diff options
author | Abyss777 <abyss@fox5.ru> | 2018-04-11 14:31:42 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2018-04-19 12:15:59 +0500 |
commit | 19a9155d988dcee7698a65a45b0558aa0ff279d4 (patch) | |
tree | cea9ae5c73a625d01bc06df5742228b5cbbd1def /web/app/view/edit/GroupsController.js | |
parent | 4e7d2b8fdb41390205d69997d61db536545f5564 (diff) | |
download | trackermap-web-19a9155d988dcee7698a65a45b0558aa0ff279d4.tar.gz trackermap-web-19a9155d988dcee7698a65a45b0558aa0ff279d4.tar.bz2 trackermap-web-19a9155d988dcee7698a65a45b0558aa0ff279d4.zip |
Implement Maintenances
Diffstat (limited to 'web/app/view/edit/GroupsController.js')
-rw-r--r-- | web/app/view/edit/GroupsController.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/web/app/view/edit/GroupsController.js b/web/app/view/edit/GroupsController.js index 04c9692f..2e62a283 100644 --- a/web/app/view/edit/GroupsController.js +++ b/web/app/view/edit/GroupsController.js @@ -25,6 +25,7 @@ Ext.define('Traccar.view.edit.GroupsController', { 'Traccar.view.permissions.ComputedAttributes', 'Traccar.view.permissions.Drivers', 'Traccar.view.permissions.SavedCommands', + 'Traccar.view.permissions.Maintenances', 'Traccar.view.BaseWindow', 'Traccar.model.Group' ], @@ -39,6 +40,8 @@ Ext.define('Traccar.view.edit.GroupsController', { this.lookupReference('toolbarAttributesButton').setHidden( Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes')); this.lookupReference('toolbarCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false)); + this.lookupReference('toolbarMaintenancesButton').setHidden( + Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableMaintenances')); }, onGeofencesClick: function () { @@ -111,6 +114,20 @@ Ext.define('Traccar.view.edit.GroupsController', { }).show(); }, + onMaintenancesClick: function () { + var group = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedMaintenances, + items: { + xtype: 'linkMaintenancesView', + baseObjectName: 'groupId', + linkObjectName: 'maintenanceId', + storeName: 'Maintenances', + baseObject: group.getId() + } + }).show(); + }, + onSelectionChange: function (selection, selected) { var disabled = selected.length === 0; this.lookupReference('toolbarGeofencesButton').setDisabled(disabled); @@ -118,6 +135,7 @@ Ext.define('Traccar.view.edit.GroupsController', { this.lookupReference('toolbarDriversButton').setDisabled(disabled); this.lookupReference('toolbarCommandsButton').setDisabled(disabled); this.lookupReference('toolbarNotificationsButton').setDisabled(disabled); + this.lookupReference('toolbarMaintenancesButton').setDisabled(disabled); this.callParent(arguments); } }); |