diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-04-20 20:21:38 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-20 20:21:38 +1200 |
commit | 957a6544c4d5a44d52f821377b97ee2205bb22a2 (patch) | |
tree | 9ca8487766cc7789435f0b782b41b1b29dee405e /web/app/view/edit/UsersController.js | |
parent | 4e7d2b8fdb41390205d69997d61db536545f5564 (diff) | |
parent | 5ad9dc859216a129da6f352b13b908d08ec983a2 (diff) | |
download | etbsa-traccar-web-957a6544c4d5a44d52f821377b97ee2205bb22a2.tar.gz etbsa-traccar-web-957a6544c4d5a44d52f821377b97ee2205bb22a2.tar.bz2 etbsa-traccar-web-957a6544c4d5a44d52f821377b97ee2205bb22a2.zip |
Merge pull request #665 from Abyss777/multi_maintenance
Implement Maintenances
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); } |