diff options
author | Abyss777 <abyss@fox5.ru> | 2017-03-11 10:53:33 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-03-11 10:53:33 +0500 |
commit | f8e90b20d08bbd00cd7d5657c91c364b47288ae6 (patch) | |
tree | acb2473f07a7cb02f5f7d8cdcd3f06cc2f6abce6 /web/app/view/UserDialogController.js | |
parent | 2eeb2a1bdc6a11a115a6774a49a21d88abb63056 (diff) | |
download | trackermap-web-f8e90b20d08bbd00cd7d5657c91c364b47288ae6.tar.gz trackermap-web-f8e90b20d08bbd00cd7d5657c91c364b47288ae6.tar.bz2 trackermap-web-f8e90b20d08bbd00cd7d5657c91c364b47288ae6.zip |
- Pass selfEdit parameter to UserDialog
- Group Geofence fields
Diffstat (limited to 'web/app/view/UserDialogController.js')
-rw-r--r-- | web/app/view/UserDialogController.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/web/app/view/UserDialogController.js b/web/app/view/UserDialogController.js index d187dec0..f001dead 100644 --- a/web/app/view/UserDialogController.js +++ b/web/app/view/UserDialogController.js @@ -19,16 +19,15 @@ Ext.define('Traccar.view.UserDialogController', { extend: 'Traccar.view.MapPickerDialogController', alias: 'controller.userDialog', - onShow: function () { + init: function () { if (Traccar.app.getUser().get('admin')) { - this.lookupReference('adminField').setHidden(false); + this.lookupReference('adminField').setDisabled(false); this.lookupReference('deviceLimitField').setDisabled(false); this.lookupReference('userLimitField').setDisabled(false); } - if (Traccar.app.getUser().get('admin') || - Traccar.app.getUser().getId() !== this.getView().down('form').getRecord().getId()) { - this.lookupReference('readonlyField').setHidden(false); - this.lookupReference('disabledField').setHidden(false); + if (Traccar.app.getUser().get('admin') || !this.getView().selfEdit) { + this.lookupReference('readonlyField').setDisabled(false); + this.lookupReference('disabledField').setDisabled(false); this.lookupReference('expirationTimeField').setDisabled(false); this.lookupReference('deviceReadonlyField').setDisabled(false); } |