aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/AttributeAliasesController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-01-13 09:26:24 +0500
committerAbyss777 <abyss@fox5.ru>2017-01-16 16:58:52 +0500
commit34c878d014a065981d56859cb73564bfa2bc478e (patch)
treea303aa2f2671faf2c0a4c0870e0aafea5e430ba4 /web/app/view/AttributeAliasesController.js
parentede04a679525bb95fcc5ca0a327e8e915f58564e (diff)
downloadtrackermap-web-34c878d014a065981d56859cb73564bfa2bc478e.tar.gz
trackermap-web-34c878d014a065981d56859cb73564bfa2bc478e.tar.bz2
trackermap-web-34c878d014a065981d56859cb73564bfa2bc478e.zip
Initial manager implementation
Diffstat (limited to 'web/app/view/AttributeAliasesController.js')
-rw-r--r--web/app/view/AttributeAliasesController.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/web/app/view/AttributeAliasesController.js b/web/app/view/AttributeAliasesController.js
index 367a32a3..1cbb735f 100644
--- a/web/app/view/AttributeAliasesController.js
+++ b/web/app/view/AttributeAliasesController.js
@@ -1,6 +1,6 @@
/*
- * Copyright 2016 Anton Tananaev (anton@traccar.org)
- * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org)
+ * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2017 Andrey Kunitsyn (andrey@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
@@ -26,8 +26,8 @@ Ext.define('Traccar.view.AttributeAliasesController', {
],
init: function () {
- var admin = Traccar.app.getUser().get('admin');
- this.lookupReference('deviceField').setStore(admin ? 'AllDevices' : 'Devices');
+ var manager = Traccar.app.getUser().get('admin') || Traccar.app.getUser().get('userLimit') > 0;
+ this.lookupReference('deviceField').setStore(manager ? 'AllDevices' : 'Devices');
this.lookupReference('toolbarAddButton').setDisabled(true);
this.lookupReference('toolbarEditButton').setDisabled(true);
this.lookupReference('toolbarRemoveButton').setDisabled(true);
@@ -88,11 +88,11 @@ Ext.define('Traccar.view.AttributeAliasesController', {
},
onDeviceChange: function (combobox, newValue, oldValue) {
- var admin = Traccar.app.getUser().get('admin');
+ var manager = Traccar.app.getUser().get('admin') || Traccar.app.getUser().get('userLimit') > 0;
this.onSelectionChange('');
if (newValue !== null) {
this.getView().getStore().filter('deviceId', newValue);
- if (admin && this.getView().getStore().getCount() === 0) {
+ if (manager && this.getView().getStore().getCount() === 0) {
Ext.getStore('AttributeAliases').getProxy().setExtraParam('deviceId', newValue);
Ext.getStore('AttributeAliases').load({
addRecords: true