diff options
Diffstat (limited to 'web/app/view/UsersController.js')
-rw-r--r-- | web/app/view/UsersController.js | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/web/app/view/UsersController.js b/web/app/view/UsersController.js index c48f57cf4..acba66b4d 100644 --- a/web/app/view/UsersController.js +++ b/web/app/view/UsersController.js @@ -22,6 +22,7 @@ Ext.define('Traccar.view.UsersController', { 'Traccar.view.UserDialog', 'Traccar.view.UserDevices', 'Traccar.view.UserGroups', + 'Traccar.view.UserGeofences', 'Traccar.view.BaseWindow' ], @@ -71,7 +72,12 @@ Ext.define('Traccar.view.UsersController', { title: Strings.deviceTitle, items: { xtype: 'userDevicesView', - user: user + baseObjectName: 'userId', + linkObjectName: 'deviceId', + storeName: 'AllDevices', + linkStoreName: 'Devices', + urlApi: '/api/permissions/devices', + baseObject: user.getData().id } }).show(); }, @@ -82,7 +88,28 @@ Ext.define('Traccar.view.UsersController', { title: Strings.settingsGroups, items: { xtype: 'userGroupsView', - user: user + baseObjectName: 'userId', + linkObjectName: 'groupId', + storeName: 'AllGroups', + linkStoreName: 'Groups', + urlApi: '/api/permissions/groups', + baseObject: user.getData().id + } + }).show(); + }, + + onGeofencesClick: function () { + var user = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedGeofences, + items: { + xtype: 'userGeofencesView', + baseObjectName: 'userId', + linkObjectName: 'geofenceId', + storeName: 'AllGeofences', + linkStoreName: 'Geofences', + urlApi: '/api/permissions/geofences', + baseObject: user.getData().id } }).show(); }, @@ -93,5 +120,6 @@ Ext.define('Traccar.view.UsersController', { this.lookupReference('toolbarRemoveButton').setDisabled(disabled); this.lookupReference('userDevicesButton').setDisabled(disabled); this.lookupReference('userGroupsButton').setDisabled(disabled); + this.lookupReference('userGeofencesButton').setDisabled(disabled); } }); |