Pman.Dialog.BAdminStaff.bjs
authorjohn <john@roojs.com>
Tue, 9 Oct 2018 10:31:28 +0000 (18:31 +0800)
committerjohn <john@roojs.com>
Tue, 9 Oct 2018 10:31:28 +0000 (18:31 +0800)
Pman.Dialog.BAdminStaff.js

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

index 4b1c606..fa23917 100644 (file)
          "items" : [
           {
            "listeners" : {
-            "actioncomplete" : "function (_self, action)\n{\n    if(action.type == 'setdata'){\n        \n        _this.layout.showPanel('DetailPanel');\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        _this.form.findField('secure_passwords').setValue(1);\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        _this.dialog.resize();\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.layout.showPanel('DetailPanel');\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.form.findField('secure_passwords').setValue(1);\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        _this.dialog.resize();\n        \n        return;\n    }\n   \n    if (action.type == 'load') {\n        \n        _this.data = action.result.data;\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' ",
-           "xtype" : "Form",
            "style" : "margin-top: 20px;",
+           "xtype" : "Form",
            "String labelAlign" : "top",
            "$ xns" : "Roo.bootstrap",
            "string errorMask" : true,
index f148fbb..db10115 100644 (file)
@@ -231,15 +231,6 @@ Roo.apply(Pman.Dialog.BAdminStaff.prototype, {
                       _this.form.findField('passwd2').show();
                       _this.passwordbox.collapse();
                       
-                      _this.qrCodeBox.collapse();
-                      _this.qrCodeBox.el.hide();
-                      _this.form.findField('_enable_oath_key').setValue(1);
-                      _this.form.findField('_enable_oath_key').el.show();
-                      
-                      _this.generate_qrcode_btn.el.hide();
-                      _this.delete_qrcode_btn.el.hide();
-                      _this.show_qrcode_btn.el.hide();
-                      
                       _this.form.findField('secure_passwords').setValue(1);
                       
                       if(_this.data.id * 1 > 0) {
@@ -257,22 +248,6 @@ Roo.apply(Pman.Dialog.BAdminStaff.prototype, {
                       
                       _this.data = action.result.data;
                       
-                      _this.qrCodeBox.el.show();
-                      _this.form.findField('_enable_oath_key').setValue(0);
-                      _this.form.findField('_enable_oath_key').el.hide();
-                      
-                      _this.generate_qrcode_btn.el.show();
-                      _this.delete_qrcode_btn.el.hide();
-                      _this.show_qrcode_btn.el.hide();
-                          
-                      _this.qrCodeBox.collapse();
-                      
-                      if(_this.data.length_oath_key * 1 > 0){
-                          _this.delete_qrcode_btn.el.show();
-                          _this.show_qrcode_btn.el.show();
-                          _this.qrCodeBox.expand();
-                      }
-                      
                       return;
                   }