aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit/UsersController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-05-10 12:14:44 +0500
committerAbyss777 <abyss@fox5.ru>2017-05-16 13:23:49 +0500
commita6765559b9388cea4ebc056cc207d7fc05206065 (patch)
tree9e9ef8577593c4ec8f5b31d1bfd496681fdf2dc7 /web/app/view/edit/UsersController.js
parente200c1b9fe2f840d0d28836e19abaebb7c33210e (diff)
downloadtrackermap-web-a6765559b9388cea4ebc056cc207d7fc05206065.tar.gz
trackermap-web-a6765559b9388cea4ebc056cc207d7fc05206065.tar.bz2
trackermap-web-a6765559b9388cea4ebc056cc207d7fc05206065.zip
Implement computed attributes
Diffstat (limited to 'web/app/view/edit/UsersController.js')
-rw-r--r--web/app/view/edit/UsersController.js19
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..f4ef4012 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.sharedCalendars,
+ 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);
}