diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-07-14 20:46:03 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-14 20:46:03 +1200 |
commit | dab4694bcab525bcc26e6af42aacc45901093dc2 (patch) | |
tree | 77631b518eacf8b9a59d9785068624e5ef52003f /web/app/view/edit/GroupsController.js | |
parent | 79f557f7b4bb209876977bba99f8c0a18f672b29 (diff) | |
parent | d40b862b56075e1544d3ed117576e05354b398a1 (diff) | |
download | trackermap-web-dab4694bcab525bcc26e6af42aacc45901093dc2.tar.gz trackermap-web-dab4694bcab525bcc26e6af42aacc45901093dc2.tar.bz2 trackermap-web-dab4694bcab525bcc26e6af42aacc45901093dc2.zip |
Merge pull request #524 from Abyss777/drivers
Drivers implementation
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 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); } }); |