diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-06-20 22:56:18 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-20 22:56:18 +1200 |
commit | 63aa4472c7d851a0b414dd3c295ccce2bc8c827f (patch) | |
tree | fca526a145f48ba07128649dd77348dbab257721 /web/app/view/GroupsController.js | |
parent | cc26f01471506935d6f438a102fbf9478dcebb1b (diff) | |
parent | f82970ac21ec2f050a09493fa7bc46c7178b57c3 (diff) | |
download | traccar-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.tar.gz traccar-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.tar.bz2 traccar-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.zip |
Merge pull request #2030 from Abyss777/master
Link and unlink geofences in web client
Diffstat (limited to 'web/app/view/GroupsController.js')
-rw-r--r-- | web/app/view/GroupsController.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/web/app/view/GroupsController.js b/web/app/view/GroupsController.js index 6cc568ea2..bc713bb6d 100644 --- a/web/app/view/GroupsController.js +++ b/web/app/view/GroupsController.js @@ -18,6 +18,10 @@ Ext.define('Traccar.view.GroupsController', { extend: 'Ext.app.ViewController', alias: 'controller.groups', + requires: [ + 'Traccar.view.GroupGeofences' + ], + onAddClick: function () { var group, dialog; group = Ext.create('Traccar.model.Group'); @@ -55,9 +59,26 @@ Ext.define('Traccar.view.GroupsController', { }); }, + onGeofencesClick: function () { + var admin = Traccar.app.getUser().get('admin'); + var group = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedGeofences, + items: { + xtype: 'groupGeofencesView', + baseObjectName: 'groupId', + linkObjectName: 'geofenceId', + storeName: (admin) ? 'AllGeofences' : 'Geofences', + urlApi: '/api/groups/geofences', + baseObject: group.getData().id + } + }).show(); + }, + onSelectionChange: function (selected) { var disabled = selected.length > 0; this.lookupReference('toolbarEditButton').setDisabled(disabled); this.lookupReference('toolbarRemoveButton').setDisabled(disabled); + this.lookupReference('toolbarGeofencesButton').setDisabled(disabled); } }); |