aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit/UsersController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-12 12:20:08 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-12 12:20:08 +0500
commitd0d156b42eeba86d6a043be051470f05cd022919 (patch)
treec48863bbe645a1c10aa50cb4b2aa18f9022399df /web/app/view/edit/UsersController.js
parent79f557f7b4bb209876977bba99f8c0a18f672b29 (diff)
downloadtrackermap-web-d0d156b42eeba86d6a043be051470f05cd022919.tar.gz
trackermap-web-d0d156b42eeba86d6a043be051470f05cd022919.tar.bz2
trackermap-web-d0d156b42eeba86d6a043be051470f05cd022919.zip
Implement Drivers
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);
}