aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit/UsersController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/edit/UsersController.js')
-rw-r--r--web/app/view/edit/UsersController.js18
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);
}