diff options
Diffstat (limited to 'web/app/view/edit/UsersController.js')
-rw-r--r-- | web/app/view/edit/UsersController.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js index db82b4f..f3154b1 100644 --- a/web/app/view/edit/UsersController.js +++ b/web/app/view/edit/UsersController.js @@ -31,6 +31,7 @@ Ext.define('Traccar.view.edit.UsersController', { 'Traccar.view.permissions.Drivers', 'Traccar.view.permissions.SavedCommands', 'Traccar.view.permissions.Notifications', + 'Traccar.view.permissions.Maintenances', 'Traccar.view.BaseWindow', 'Traccar.model.User' ], @@ -49,6 +50,8 @@ Ext.define('Traccar.view.edit.UsersController', { this.lookupReference('userCalendarsButton').setHidden( Traccar.app.getBooleanAttributePreference('ui.disableCalendars')); this.lookupReference('userCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false)); + this.lookupReference('userMaintenancesButton').setHidden( + Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableMaintenances')); }, onEditClick: function () { @@ -209,6 +212,21 @@ Ext.define('Traccar.view.edit.UsersController', { }).show(); }, + onMaintenancesClick: function () { + var user = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedMaintenances, + items: { + xtype: 'linkMaintenancesView', + baseObjectName: 'userId', + linkObjectName: 'maintenanceId', + storeName: 'AllMaintenances', + linkStoreName: 'Maintenances', + baseObject: user.getId() + } + }).show(); + }, + onSelectionChange: function (selection, selected) { var disabled = selected.length === 0; this.lookupReference('userDevicesButton').setDisabled(disabled); @@ -219,6 +237,7 @@ Ext.define('Traccar.view.edit.UsersController', { this.lookupReference('userAttributesButton').setDisabled(disabled); this.lookupReference('userDriversButton').setDisabled(disabled); this.lookupReference('userCommandsButton').setDisabled(disabled); + this.lookupReference('userMaintenancesButton').setDisabled(disabled); this.lookupReference('userUsersButton').setDisabled(disabled || selected[0].get('userLimit') === 0); this.callParent(arguments); } |