diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-17 11:34:09 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-17 11:34:09 +1200 |
commit | 31187bc2a3ae41ab553a6472b7592895e3641fe8 (patch) | |
tree | d5b130414ed164586efb867b7649de1617f2c90c /web/app/view/edit/UsersController.js | |
parent | e200c1b9fe2f840d0d28836e19abaebb7c33210e (diff) | |
parent | 54137d72265355c04c4b71836d524391ea144998 (diff) | |
download | trackermap-web-31187bc2a3ae41ab553a6472b7592895e3641fe8.tar.gz trackermap-web-31187bc2a3ae41ab553a6472b7592895e3641fe8.tar.bz2 trackermap-web-31187bc2a3ae41ab553a6472b7592895e3641fe8.zip |
Merge pull request #486 from Abyss777/computed_attributes
Implement computed attributes
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 88f39fbf..fe69d40c 100644 --- a/web/app/view/edit/UsersController.js +++ b/web/app/view/edit/UsersController.js @@ -27,6 +27,7 @@ Ext.define('Traccar.view.edit.UsersController', { 'Traccar.view.permissions.UserGeofences', 'Traccar.view.permissions.UserCalendars', 'Traccar.view.permissions.UserUsers', + 'Traccar.view.permissions.UserAttributes', 'Traccar.view.Notifications', 'Traccar.view.BaseWindow', 'Traccar.model.User' @@ -155,6 +156,23 @@ Ext.define('Traccar.view.edit.UsersController', { }).show(); }, + onAttributesClick: function () { + var user = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedComputedAttributes, + items: { + xtype: 'userAttributesView', + baseObjectName: 'userId', + linkObjectName: 'attributeId', + storeName: 'AllComputedAttributes', + linkStoreName: 'ComputedAttributes', + urlApi: 'api/permissions/attributes', + baseObject: user.getId() + } + }).show(); + }, + + onSelectionChange: function (selection, selected) { var disabled = selected.length === 0; this.lookupReference('userDevicesButton').setDisabled(disabled); @@ -162,6 +180,7 @@ Ext.define('Traccar.view.edit.UsersController', { this.lookupReference('userGeofencesButton').setDisabled(disabled); this.lookupReference('userNotificationsButton').setDisabled(disabled); this.lookupReference('userCalendarsButton').setDisabled(disabled); + this.lookupReference('userAttributesButton').setDisabled(disabled); this.lookupReference('userUsersButton').setDisabled(disabled || selected[0].get('userLimit') === 0); this.callParent(arguments); } |