diff options
author | Abyss777 <abyss@fox5.ru> | 2017-05-10 12:14:44 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-05-16 13:23:49 +0500 |
commit | a6765559b9388cea4ebc056cc207d7fc05206065 (patch) | |
tree | 9e9ef8577593c4ec8f5b31d1bfd496681fdf2dc7 /web/app/view/edit/GroupsController.js | |
parent | e200c1b9fe2f840d0d28836e19abaebb7c33210e (diff) | |
download | trackermap-web-a6765559b9388cea4ebc056cc207d7fc05206065.tar.gz trackermap-web-a6765559b9388cea4ebc056cc207d7fc05206065.tar.bz2 trackermap-web-a6765559b9388cea4ebc056cc207d7fc05206065.zip |
Implement computed attributes
Diffstat (limited to 'web/app/view/edit/GroupsController.js')
-rw-r--r-- | web/app/view/edit/GroupsController.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/web/app/view/edit/GroupsController.js b/web/app/view/edit/GroupsController.js index 36154b4e..602bb095 100644 --- a/web/app/view/edit/GroupsController.js +++ b/web/app/view/edit/GroupsController.js @@ -22,6 +22,7 @@ Ext.define('Traccar.view.edit.GroupsController', { requires: [ 'Traccar.view.dialog.Group', 'Traccar.view.permissions.GroupGeofences', + 'Traccar.view.permissions.GroupAttributes', 'Traccar.view.BaseWindow', 'Traccar.model.Group' ], @@ -47,9 +48,27 @@ Ext.define('Traccar.view.edit.GroupsController', { }).show(); }, + onAttributesClick: function () { + var admin, group; + admin = Traccar.app.getUser().get('admin'); + group = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedComputedAttributes, + items: { + xtype: 'groupAttributesView', + baseObjectName: 'groupId', + linkObjectName: 'attributeId', + storeName: admin ? 'AllComputedAttributes' : 'ComputedAttributes', + urlApi: 'api/groups/attributes', + baseObject: group.getId() + } + }).show(); + }, + onSelectionChange: function (selected) { var disabled = selected.length > 0; this.lookupReference('toolbarGeofencesButton').setDisabled(disabled); + this.lookupReference('toolbarAttributesButton').setDisabled(disabled); this.callParent(arguments); } }); |