Pman.Dialog.BAdminStaff.bjs
authorEdward <edward@roojs.com>
Tue, 18 Sep 2018 05:42:32 +0000 (13:42 +0800)
committerEdward <edward@roojs.com>
Tue, 18 Sep 2018 05:42:32 +0000 (13:42 +0800)
Pman.Dialog.BAdminStaff.js

Pman.Dialog.BAdminStaff.bjs
Pman.Dialog.BAdminStaff.js

index 6075a69..255d61c 100644 (file)
@@ -87,7 +87,7 @@
          "items" : [
           {
            "listeners" : {
-            "actioncomplete" : "function (_self, action)\n{\n    if(action.type == 'setdata'){\n        \n        /*\n        * Use for init -- Call from Pman.Login.js\n        */\n        if(typeof(_this.data.role) != 'undefined' && _this.data.role == 'Administrators') {\n            _this.dialog.setTitle(\"Create Adminstrator\");\n            _this.form.findField('role').setDisabled(true);\n        }\n        \n        _this.form.findField('passwd1').el.select('input',true).first().dom.type=\"password\";\n        _this.form.findField('passwd2').show();\n        _this.passwordbox.collapse();\n        \n        _this.qrCodeBox.collapse();\n        _this.qrCodeBox.el.hide();\n        _this.form.findField('_enable_oath_key').setValue(1);\n        _this.form.findField('_enable_oath_key').el.show();\n        \n        _this.generate_qrcode_btn.el.hide();\n        _this.delete_qrcode_btn.el.hide();\n        _this.show_qrcode_btn.el.hide();\n        \n        if(_this.data.id * 1 > 0) {\n            this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});\n        }\n        \n        this.clearInvalid();\n        \n        return;\n    }\n   \n    if (action.type == 'load') {\n    \n        _this.data = action.result.data;\n        \n        _this.qrCodeBox.el.show();\n        _this.form.findField('_enable_oath_key').setValue(0);\n        _this.form.findField('_enable_oath_key').el.hide();\n        \n        _this.generate_qrcode_btn.el.show();\n        _this.delete_qrcode_btn.el.hide();\n        _this.show_qrcode_btn.el.hide();\n            \n        _this.qrCodeBox.collapse();\n        \n        if(_this.data.length_oath_key * 1 > 0){\n            _this.delete_qrcode_btn.el.show();\n            _this.show_qrcode_btn.el.show();\n            _this.qrCodeBox.expand();\n        }\n        \n        return;\n    }\n    \n    if (action.type == 'submit') { // only submitted here if we are \n    \n        _this.dialog.hide();\n       \n        if (_this.callback) {\n            _this.callback.call(this, action.result.data);\n        }\n        \n        return;\n        \n    }\n}",
+            "actioncomplete" : "function (_self, action)\n{\n    if(action.type == 'setdata'){\n        \n        _this.dialog.setTitle(\"Add / Edit User\");\n        _this.form.findField('role').setDisabled(false);\n            \n        /*\n        * Use for init -- Call from Pman.Login.js\n        */\n        if(typeof(_this.data.role) != 'undefined' && _this.data.role == 'Administrators') {\n            _this.dialog.setTitle(\"Create Adminstrator\");\n            _this.form.findField('role').setDisabled(true);\n        }\n        \n        _this.form.findField('passwd1').el.select('input',true).first().dom.type=\"password\";\n        _this.form.findField('passwd2').show();\n        _this.passwordbox.collapse();\n        \n        _this.qrCodeBox.collapse();\n        _this.qrCodeBox.el.hide();\n        _this.form.findField('_enable_oath_key').setValue(1);\n        _this.form.findField('_enable_oath_key').el.show();\n        \n        _this.generate_qrcode_btn.el.hide();\n        _this.delete_qrcode_btn.el.hide();\n        _this.show_qrcode_btn.el.hide();\n        \n        if(_this.data.id * 1 > 0) {\n            this.doAction('load',{ method: 'GET', params: { '_id' : _this.data.id }});\n        }\n        \n        this.clearInvalid();\n        \n        return;\n    }\n   \n    if (action.type == 'load') {\n    \n        _this.data = action.result.data;\n        \n        _this.qrCodeBox.el.show();\n        _this.form.findField('_enable_oath_key').setValue(0);\n        _this.form.findField('_enable_oath_key').el.hide();\n        \n        _this.generate_qrcode_btn.el.show();\n        _this.delete_qrcode_btn.el.hide();\n        _this.show_qrcode_btn.el.hide();\n            \n        _this.qrCodeBox.collapse();\n        \n        if(_this.data.length_oath_key * 1 > 0){\n            _this.delete_qrcode_btn.el.show();\n            _this.show_qrcode_btn.el.show();\n            _this.qrCodeBox.expand();\n        }\n        \n        return;\n    }\n    \n    if (action.type == 'submit') { // only submitted here if we are \n    \n        _this.dialog.hide();\n       \n        if (_this.callback) {\n            _this.callback.call(this, action.result.data);\n        }\n        \n        return;\n        \n    }\n}",
             "render" : "function (_self)\n{\n    _this.form = _self;\n    \n}"
            },
            "$ url" : "baseURL + '/Roo/core_person' ",
index 8aa00be..06b4d25 100644 (file)
@@ -217,6 +217,9 @@ Roo.apply(Pman.Dialog.BAdminStaff.prototype, {
               {
                   if(action.type == 'setdata'){
                       
+                      _this.dialog.setTitle("Add / Edit User");
+                      _this.form.findField('role').setDisabled(false);
+                          
                       /*
                       * Use for init -- Call from Pman.Login.js
                       */