aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit/GroupsController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-09-12 17:39:43 +0500
committerAbyss777 <abyss@fox5.ru>2017-09-13 13:51:35 +0500
commita5d36c62facad98c409b9fcd4f8b92c3d47601ab (patch)
tree368a2ed169c1457a1cc2dd69a811f2dccc59ce04 /web/app/view/edit/GroupsController.js
parent31a6fed66b4f077d2b6443fdd34229befe8777c3 (diff)
downloadtrackermap-web-a5d36c62facad98c409b9fcd4f8b92c3d47601ab.tar.gz
trackermap-web-a5d36c62facad98c409b9fcd4f8b92c3d47601ab.tar.bz2
trackermap-web-a5d36c62facad98c409b9fcd4f8b92c3d47601ab.zip
Implement Saved Commands
Diffstat (limited to 'web/app/view/edit/GroupsController.js')
-rw-r--r--web/app/view/edit/GroupsController.js31
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);
}
});