aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/edit/UsersController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2018-04-11 14:31:42 +0500
committerAbyss777 <abyss@fox5.ru>2018-04-19 12:15:59 +0500
commit19a9155d988dcee7698a65a45b0558aa0ff279d4 (patch)
treecea9ae5c73a625d01bc06df5742228b5cbbd1def /web/app/view/edit/UsersController.js
parent4e7d2b8fdb41390205d69997d61db536545f5564 (diff)
downloadtrackermap-web-19a9155d988dcee7698a65a45b0558aa0ff279d4.tar.gz
trackermap-web-19a9155d988dcee7698a65a45b0558aa0ff279d4.tar.bz2
trackermap-web-19a9155d988dcee7698a65a45b0558aa0ff279d4.zip
Implement Maintenances
Diffstat (limited to 'web/app/view/edit/UsersController.js')
-rw-r--r--web/app/view/edit/UsersController.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js
index db82b4f4..f3154b1a 100644
--- a/web/app/view/edit/UsersController.js
+++ b/web/app/view/edit/UsersController.js
@@ -31,6 +31,7 @@ Ext.define('Traccar.view.edit.UsersController', {
'Traccar.view.permissions.Drivers',
'Traccar.view.permissions.SavedCommands',
'Traccar.view.permissions.Notifications',
+ 'Traccar.view.permissions.Maintenances',
'Traccar.view.BaseWindow',
'Traccar.model.User'
],
@@ -49,6 +50,8 @@ Ext.define('Traccar.view.edit.UsersController', {
this.lookupReference('userCalendarsButton').setHidden(
Traccar.app.getBooleanAttributePreference('ui.disableCalendars'));
this.lookupReference('userCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false));
+ this.lookupReference('userMaintenancesButton').setHidden(
+ Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableMaintenances'));
},
onEditClick: function () {
@@ -209,6 +212,21 @@ Ext.define('Traccar.view.edit.UsersController', {
}).show();
},
+ onMaintenancesClick: function () {
+ var user = this.getView().getSelectionModel().getSelection()[0];
+ Ext.create('Traccar.view.BaseWindow', {
+ title: Strings.sharedMaintenances,
+ items: {
+ xtype: 'linkMaintenancesView',
+ baseObjectName: 'userId',
+ linkObjectName: 'maintenanceId',
+ storeName: 'AllMaintenances',
+ linkStoreName: 'Maintenances',
+ baseObject: user.getId()
+ }
+ }).show();
+ },
+
onSelectionChange: function (selection, selected) {
var disabled = selected.length === 0;
this.lookupReference('userDevicesButton').setDisabled(disabled);
@@ -219,6 +237,7 @@ Ext.define('Traccar.view.edit.UsersController', {
this.lookupReference('userAttributesButton').setDisabled(disabled);
this.lookupReference('userDriversButton').setDisabled(disabled);
this.lookupReference('userCommandsButton').setDisabled(disabled);
+ this.lookupReference('userMaintenancesButton').setDisabled(disabled);
this.lookupReference('userUsersButton').setDisabled(disabled || selected[0].get('userLimit') === 0);
this.callParent(arguments);
}