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/UsersController.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/UsersController.js')
-rw-r--r-- | web/app/view/edit/UsersController.js | 45 |
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); } |