aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit/UsersController.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/UsersController.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/UsersController.js')
-rw-r--r--web/app/view/edit/UsersController.js45
1 files changed, 31 insertions, 14 deletions
diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js
index 3bc7d1c4..f710ed24 100644
--- a/web/app/view/edit/UsersController.js
+++ b/web/app/view/edit/UsersController.js
@@ -22,13 +22,14 @@ Ext.define('Traccar.view.edit.UsersController', {
requires: [
'Traccar.view.dialog.User',
- 'Traccar.view.permissions.UserDevices',
- 'Traccar.view.permissions.UserGroups',
- 'Traccar.view.permissions.UserGeofences',
- 'Traccar.view.permissions.UserCalendars',
- 'Traccar.view.permissions.UserUsers',
- 'Traccar.view.permissions.UserAttributes',
- 'Traccar.view.permissions.UserDrivers',
+ 'Traccar.view.permissions.Devices',
+ 'Traccar.view.permissions.Groups',
+ 'Traccar.view.permissions.Geofences',
+ 'Traccar.view.permissions.Calendars',
+ 'Traccar.view.permissions.Users',
+ 'Traccar.view.permissions.ComputedAttributes',
+ 'Traccar.view.permissions.Drivers',
+ 'Traccar.view.permissions.SavedCommands',
'Traccar.view.Notifications',
'Traccar.view.BaseWindow',
'Traccar.model.User'
@@ -47,6 +48,7 @@ Ext.define('Traccar.view.edit.UsersController', {
Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes'));
this.lookupReference('userCalendarsButton').setHidden(
Traccar.app.getBooleanAttributePreference('ui.disableCalendars'));
+ this.lookupReference('userCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false));
},
onEditClick: function () {
@@ -78,7 +80,7 @@ Ext.define('Traccar.view.edit.UsersController', {
Ext.create('Traccar.view.BaseWindow', {
title: Strings.deviceTitle,
items: {
- xtype: 'userDevicesView',
+ xtype: 'linkDevicesView',
baseObjectName: 'userId',
linkObjectName: 'deviceId',
storeName: 'AllDevices',
@@ -93,7 +95,7 @@ Ext.define('Traccar.view.edit.UsersController', {
Ext.create('Traccar.view.BaseWindow', {
title: Strings.settingsGroups,
items: {
- xtype: 'userGroupsView',
+ xtype: 'linkGroupsView',
baseObjectName: 'userId',
linkObjectName: 'groupId',
storeName: 'AllGroups',
@@ -108,7 +110,7 @@ Ext.define('Traccar.view.edit.UsersController', {
Ext.create('Traccar.view.BaseWindow', {
title: Strings.sharedGeofences,
items: {
- xtype: 'userGeofencesView',
+ xtype: 'linkGeofencesView',
baseObjectName: 'userId',
linkObjectName: 'geofenceId',
storeName: 'AllGeofences',
@@ -134,7 +136,7 @@ Ext.define('Traccar.view.edit.UsersController', {
Ext.create('Traccar.view.BaseWindow', {
title: Strings.sharedCalendars,
items: {
- xtype: 'userCalendarsView',
+ xtype: 'linkCalendarsView',
baseObjectName: 'userId',
linkObjectName: 'calendarId',
storeName: 'AllCalendars',
@@ -149,7 +151,7 @@ Ext.define('Traccar.view.edit.UsersController', {
Ext.create('Traccar.view.BaseWindow', {
title: Strings.settingsUsers,
items: {
- xtype: 'userUsersView',
+ xtype: 'linkUsersView',
baseObjectName: 'userId',
linkObjectName: 'managedUserId',
storeName: 'Users',
@@ -163,7 +165,7 @@ Ext.define('Traccar.view.edit.UsersController', {
Ext.create('Traccar.view.BaseWindow', {
title: Strings.sharedComputedAttributes,
items: {
- xtype: 'userAttributesView',
+ xtype: 'linkComputedAttributesView',
baseObjectName: 'userId',
linkObjectName: 'attributeId',
storeName: 'AllComputedAttributes',
@@ -178,7 +180,7 @@ Ext.define('Traccar.view.edit.UsersController', {
Ext.create('Traccar.view.BaseWindow', {
title: Strings.sharedDrivers,
items: {
- xtype: 'userDriversView',
+ xtype: 'linkDriversView',
baseObjectName: 'userId',
linkObjectName: 'driverId',
storeName: 'AllDrivers',
@@ -188,6 +190,20 @@ Ext.define('Traccar.view.edit.UsersController', {
}).show();
},
+ onCommandsClick: function () {
+ var user = this.getView().getSelectionModel().getSelection()[0];
+ Ext.create('Traccar.view.BaseWindow', {
+ title: Strings.sharedSavedCommands,
+ items: {
+ xtype: 'linkSavedCommandsView',
+ baseObjectName: 'userId',
+ linkObjectName: 'commandId',
+ storeName: 'AllCommands',
+ linkStoreName: 'Commands',
+ baseObject: user.getId()
+ }
+ }).show();
+ },
onSelectionChange: function (selection, selected) {
var disabled = selected.length === 0;
@@ -198,6 +214,7 @@ Ext.define('Traccar.view.edit.UsersController', {
this.lookupReference('userCalendarsButton').setDisabled(disabled);
this.lookupReference('userAttributesButton').setDisabled(disabled);
this.lookupReference('userDriversButton').setDisabled(disabled);
+ this.lookupReference('userCommandsButton').setDisabled(disabled);
this.lookupReference('userUsersButton').setDisabled(disabled || selected[0].get('userLimit') === 0);
this.callParent(arguments);
}