diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-09-14 22:59:54 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-14 22:59:54 +1200 |
commit | ca960df40e15d7bfb88d2e0e41a269d4b069058c (patch) | |
tree | 0b41508a3f856700c353e5a5082c6ea829f13d43 /web/app/view/edit/GroupsController.js | |
parent | 4193ac77fd9f0da264284a6f73601963995554c8 (diff) | |
parent | be47d612285d484e2d0a2aa43174fb8e36acd816 (diff) | |
download | trackermap-web-ca960df40e15d7bfb88d2e0e41a269d4b069058c.tar.gz trackermap-web-ca960df40e15d7bfb88d2e0e41a269d4b069058c.tar.bz2 trackermap-web-ca960df40e15d7bfb88d2e0e41a269d4b069058c.zip |
Merge pull request #585 from Abyss777/saved_commands
Implement Saved Commands
Diffstat (limited to 'web/app/view/edit/GroupsController.js')
-rw-r--r-- | web/app/view/edit/GroupsController.js | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/web/app/view/edit/GroupsController.js b/web/app/view/edit/GroupsController.js index be26cc93..872fea4a 100644 --- a/web/app/view/edit/GroupsController.js +++ b/web/app/view/edit/GroupsController.js @@ -21,9 +21,10 @@ Ext.define('Traccar.view.edit.GroupsController', { requires: [ 'Traccar.view.dialog.Group', - 'Traccar.view.permissions.GroupGeofences', - 'Traccar.view.permissions.GroupAttributes', - 'Traccar.view.permissions.GroupDrivers', + 'Traccar.view.permissions.Geofences', + 'Traccar.view.permissions.ComputedAttributes', + 'Traccar.view.permissions.Drivers', + 'Traccar.view.permissions.SavedCommands', 'Traccar.view.BaseWindow', 'Traccar.model.Group' ], @@ -37,6 +38,7 @@ Ext.define('Traccar.view.edit.GroupsController', { Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableDrivers')); this.lookupReference('toolbarAttributesButton').setHidden( Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes')); + this.lookupReference('toolbarCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false)); }, onGeofencesClick: function () { @@ -46,7 +48,7 @@ Ext.define('Traccar.view.edit.GroupsController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedGeofences, items: { - xtype: 'groupGeofencesView', + xtype: 'linkGeofencesView', baseObjectName: 'groupId', linkObjectName: 'geofenceId', storeName: admin ? 'AllGeofences' : 'Geofences', @@ -62,7 +64,7 @@ Ext.define('Traccar.view.edit.GroupsController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedComputedAttributes, items: { - xtype: 'groupAttributesView', + xtype: 'linkComputedAttributesView', baseObjectName: 'groupId', linkObjectName: 'attributeId', storeName: admin ? 'AllComputedAttributes' : 'ComputedAttributes', @@ -78,7 +80,7 @@ Ext.define('Traccar.view.edit.GroupsController', { Ext.create('Traccar.view.BaseWindow', { title: Strings.sharedDrivers, items: { - xtype: 'groupDriversView', + xtype: 'linkDriversView', baseObjectName: 'groupId', linkObjectName: 'driverId', storeName: admin ? 'AllDrivers' : 'Drivers', @@ -87,11 +89,28 @@ Ext.define('Traccar.view.edit.GroupsController', { }).show(); }, + onCommandsClick: function () { + var admin, group; + admin = Traccar.app.getUser().get('admin'); + group = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedSavedCommands, + items: { + xtype: 'linkSavedCommandsView', + baseObjectName: 'groupId', + linkObjectName: 'commandId', + storeName: admin ? 'AllCommands' : 'Commands', + baseObject: group.getId() + } + }).show(); + }, + onSelectionChange: function (selection, selected) { var disabled = selected.length === 0; this.lookupReference('toolbarGeofencesButton').setDisabled(disabled); this.lookupReference('toolbarAttributesButton').setDisabled(disabled); this.lookupReference('toolbarDriversButton').setDisabled(disabled); + this.lookupReference('toolbarCommandsButton').setDisabled(disabled); this.callParent(arguments); } }); |