aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/UsersController.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-06-20 22:56:18 +1200
committerGitHub <noreply@github.com>2016-06-20 22:56:18 +1200
commit63aa4472c7d851a0b414dd3c295ccce2bc8c827f (patch)
treefca526a145f48ba07128649dd77348dbab257721 /web/app/view/UsersController.js
parentcc26f01471506935d6f438a102fbf9478dcebb1b (diff)
parentf82970ac21ec2f050a09493fa7bc46c7178b57c3 (diff)
downloadtrackermap-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.tar.gz
trackermap-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.tar.bz2
trackermap-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.zip
Merge pull request #2030 from Abyss777/master
Link and unlink geofences in web client
Diffstat (limited to 'web/app/view/UsersController.js')
-rw-r--r--web/app/view/UsersController.js32
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);
}
});