diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-07-14 20:46:03 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-14 20:46:03 +1200 |
commit | dab4694bcab525bcc26e6af42aacc45901093dc2 (patch) | |
tree | 77631b518eacf8b9a59d9785068624e5ef52003f /web/app/view/edit/UsersController.js | |
parent | 79f557f7b4bb209876977bba99f8c0a18f672b29 (diff) | |
parent | d40b862b56075e1544d3ed117576e05354b398a1 (diff) | |
download | trackermap-web-dab4694bcab525bcc26e6af42aacc45901093dc2.tar.gz trackermap-web-dab4694bcab525bcc26e6af42aacc45901093dc2.tar.bz2 trackermap-web-dab4694bcab525bcc26e6af42aacc45901093dc2.zip |
Merge pull request #524 from Abyss777/drivers
Drivers implementation
Diffstat (limited to 'web/app/view/edit/UsersController.js')
-rw-r--r-- | web/app/view/edit/UsersController.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js index a6f150be..1fa17dfe 100644 --- a/web/app/view/edit/UsersController.js +++ b/web/app/view/edit/UsersController.js @@ -28,6 +28,7 @@ Ext.define('Traccar.view.edit.UsersController', { 'Traccar.view.permissions.UserCalendars', 'Traccar.view.permissions.UserUsers', 'Traccar.view.permissions.UserAttributes', + 'Traccar.view.permissions.UserDrivers', 'Traccar.view.Notifications', 'Traccar.view.BaseWindow', 'Traccar.model.User' @@ -172,6 +173,22 @@ Ext.define('Traccar.view.edit.UsersController', { }).show(); }, + onDriversClick: function () { + var user = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedDrivers, + items: { + xtype: 'userDriversView', + baseObjectName: 'userId', + linkObjectName: 'driverId', + storeName: 'AllDrivers', + linkStoreName: 'Drivers', + urlApi: 'api/permissions/drivers', + baseObject: user.getId() + } + }).show(); + }, + onSelectionChange: function (selection, selected) { var disabled = selected.length === 0; @@ -181,6 +198,7 @@ Ext.define('Traccar.view.edit.UsersController', { this.lookupReference('userNotificationsButton').setDisabled(disabled); this.lookupReference('userCalendarsButton').setDisabled(disabled); this.lookupReference('userAttributesButton').setDisabled(disabled); + this.lookupReference('userDriversButton').setDisabled(disabled); this.lookupReference('userUsersButton').setDisabled(disabled || selected[0].get('userLimit') === 0); this.callParent(arguments); } |