From 34c878d014a065981d56859cb73564bfa2bc478e Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 13 Jan 2017 09:26:24 +0500 Subject: Initial manager implementation --- web/app/view/AttributeAliasesController.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'web/app/view/AttributeAliasesController.js') diff --git a/web/app/view/AttributeAliasesController.js b/web/app/view/AttributeAliasesController.js index 367a32a..1cbb735 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 -- cgit v1.2.3