aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit/GroupsController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-12 12:20:08 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-12 12:20:08 +0500
commitd0d156b42eeba86d6a043be051470f05cd022919 (patch)
treec48863bbe645a1c10aa50cb4b2aa18f9022399df /web/app/view/edit/GroupsController.js
parent79f557f7b4bb209876977bba99f8c0a18f672b29 (diff)
downloadtrackermap-web-d0d156b42eeba86d6a043be051470f05cd022919.tar.gz
trackermap-web-d0d156b42eeba86d6a043be051470f05cd022919.tar.bz2
trackermap-web-d0d156b42eeba86d6a043be051470f05cd022919.zip
Implement Drivers
Diffstat (limited to 'web/app/view/edit/GroupsController.js')
-rw-r--r--web/app/view/edit/GroupsController.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/web/app/view/edit/GroupsController.js b/web/app/view/edit/GroupsController.js
index 602bb095..a170b3e9 100644
--- a/web/app/view/edit/GroupsController.js
+++ b/web/app/view/edit/GroupsController.js
@@ -23,6 +23,7 @@ Ext.define('Traccar.view.edit.GroupsController', {
'Traccar.view.dialog.Group',
'Traccar.view.permissions.GroupGeofences',
'Traccar.view.permissions.GroupAttributes',
+ 'Traccar.view.permissions.GroupDrivers',
'Traccar.view.BaseWindow',
'Traccar.model.Group'
],
@@ -65,10 +66,28 @@ Ext.define('Traccar.view.edit.GroupsController', {
}).show();
},
+ onDriversClick: function () {
+ var admin, group;
+ admin = Traccar.app.getUser().get('admin');
+ group = this.getView().getSelectionModel().getSelection()[0];
+ Ext.create('Traccar.view.BaseWindow', {
+ title: Strings.sharedDrivers,
+ items: {
+ xtype: 'groupDriversView',
+ baseObjectName: 'groupId',
+ linkObjectName: 'driverId',
+ storeName: admin ? 'AllDrivers' : 'Drivers',
+ urlApi: 'api/groups/drivers',
+ baseObject: group.getId()
+ }
+ }).show();
+ },
+
onSelectionChange: function (selected) {
var disabled = selected.length > 0;
this.lookupReference('toolbarGeofencesButton').setDisabled(disabled);
this.lookupReference('toolbarAttributesButton').setDisabled(disabled);
+ this.lookupReference('toolbarDriversButton').setDisabled(disabled);
this.callParent(arguments);
}
});