diff options
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 04c9692..2e62a28 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); } }); |