aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/SettingsMenuController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/SettingsMenuController.js')
-rw-r--r--web/app/view/SettingsMenuController.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/web/app/view/SettingsMenuController.js b/web/app/view/SettingsMenuController.js
index e8893e3f..59f62c2e 100644
--- a/web/app/view/SettingsMenuController.js
+++ b/web/app/view/SettingsMenuController.js
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,12 +33,13 @@ Ext.define('Traccar.view.SettingsMenuController', {
'Traccar.view.dialog.DeviceDistance',
'Traccar.view.edit.Calendars',
'Traccar.view.edit.SavedCommands',
+ 'Traccar.view.edit.Maintenances',
'Traccar.view.BaseWindow'
],
init: function () {
var admin, manager, readonly, deviceReadonly;
- admin = Traccar.app.getUser().get('admin');
+ admin = Traccar.app.getUser().get('administrator');
manager = Traccar.app.getUser().get('userLimit') !== 0;
readonly = Traccar.app.getPreference('readonly', false);
deviceReadonly = Traccar.app.getUser().get('deviceReadonly');
@@ -59,6 +60,8 @@ Ext.define('Traccar.view.SettingsMenuController', {
this.lookupReference('settingsDriversButton').setHidden(
Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableDrivers'));
this.lookupReference('settingsCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false));
+ this.lookupReference('settingsMaintenancesButton').setHidden(
+ Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableMaintenances'));
}
if (admin || !deviceReadonly && !readonly) {
this.lookupReference('settingsComputedAttributesButton').setHidden(
@@ -162,6 +165,15 @@ Ext.define('Traccar.view.SettingsMenuController', {
}).show();
},
+ onMaintenancesClick: function () {
+ Ext.create('Traccar.view.BaseWindow', {
+ title: Strings.sharedMaintenances,
+ items: {
+ xtype: 'maintenancesView'
+ }
+ }).show();
+ },
+
onLogoutClick: function () {
Ext.create('Traccar.view.dialog.LoginController').logout();
}