Pman.Dialog.VerifyAccess.bjs
[Pman.Core] / Pman.Dialog.VerifyAccess.bjs
1 {
2  "name" : "Pman.Dialog.VerifyAccess",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.Core/Pman.Dialog.VerifyAccess.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "e2c9d024b79dfb48b42a7807206c6aed" : "Verify New IP Access",
10   "d41d8cd98f00b204e9800998ecf8427e" : "",
11   "f6039d44b29456b20f8f373155ae4973" : "Username",
12   "004bf6c9a40003140292e97330236c53" : "Action",
13   "dfb790522fdea3859af206d32916fe77" : "User Agent",
14   "d71940f24ee38ee09f6e06b908480bcf" : "Resend email",
15   "14cf5e829f5cb6fbf8cb54f7c5ff4ca9" : "Start the application process   "
16  },
17  "items" : [
18   {
19    "listeners" : {
20     "show" : "function (_self)\n{\n    var path = window.location.pathname.split('/');\n    \n    var authorized_key = path.pop();\n    \n    var id = path.pop();\n    \n    new Pman.Request({\n        url: baseURL + '/Core/VerifyAccess',\n        method : 'POST',\n        mask : 'Loading...',\n        params : {\n            id : id,\n            authorized_key : authorized_key,\n            _to_data : 1\n        }, \n        success : function(res) {\n            _this.form.setValues(res.data);\n            return;\n        },\n        failure: function(res) {\n            \n            _this.dialog.hide();\n            \n            Roo.bootstrap.MessageBox.alert('Error', res.errorMsg);\n            \n            return;\n       }\n    });\n}"
21    },
22    "String cls" : "enable-overflow",
23    "Boolean allow_close" : false,
24    "xtype" : "Modal",
25    "$ xns" : "Roo.bootstrap",
26    "String title" : "Verify New IP Access",
27    "items" : [
28     {
29      "listeners" : {
30       "actionfailed" : "function (_self, action)\n{\n    _this.dialog.el.unmask();\n    Roo.log(\"action failed\");\n    Roo.log(action);\n  \n    if(!action.result.errorMsg){\n        Roo.bootstrap.MessageBox.alert(\"Error\", \"Please contact system adminisrator\");\n    }\n   \n    var msg = action.result.errorMsg;\n   \n    if(msg.length >= 200){\n        msg = msg.substring(0,199) + '...'\n    }\n    \n    Roo.bootstrap.MessageBox.alert(\"Error\", msg);\n}",
31       "actioncomplete" : "function (_self, action)\n{\n    if (action.type == 'setdata') {\n        \n        return;\n    }\n    if (action.type == 'load') {\n        \n        return;\n    }\n    if (action.type =='submit') {\n        \n        _this.dialog.hide();\n        \n        Roo.get(document.body).mask('Start your Application');\n        \n        setTimeout(function() {\n            window.location.href = baseURL;\n        }, 500); \n        \n        return;\n    }\n    \n}",
32       "render" : "function (_self,e)\n{\n    _this.form = _self;\n    \n}"
33      },
34      "$ string url" : "baseURL + '/Core/VerifyAccess'",
35      "Boolean errorMask" : true,
36      "xtype" : "Form",
37      "String labelAlign" : "top",
38      "$ xns" : "Roo.bootstrap",
39      "Boolean loadMask" : false,
40      "items" : [
41       {
42        "xtype" : "Row",
43        "$ xns" : "Roo.bootstrap",
44        "items" : [
45         {
46          "xtype" : "Column",
47          "Number xs" : 12,
48          "$ xns" : "Roo.bootstrap",
49          "items" : [
50           {
51            "String name" : "email",
52            "Boolean readOnly" : true,
53            "xtype" : "Input",
54            "string fieldLabel" : "Username",
55            "$ xns" : "Roo.bootstrap"
56           }
57          ]
58         }
59        ]
60       },
61       {
62        "xtype" : "Row",
63        "$ xns" : "Roo.bootstrap",
64        "items" : [
65         {
66          "xtype" : "Column",
67          "Number xs" : 12,
68          "$ xns" : "Roo.bootstrap",
69          "items" : [
70           {
71            "String name" : "user_agent",
72            "Boolean readOnly" : true,
73            "xtype" : "TextArea",
74            "string fieldLabel" : "User Agent",
75            "Number rows" : 3,
76            "$ xns" : "Roo.bootstrap"
77           }
78          ]
79         }
80        ]
81       },
82       {
83        "listeners" : {
84         "render" : "function (_self)\n{\n    _this.row_pwd_label = _self;\n}"
85        },
86        "xtype" : "Row",
87        "$ xns" : "Roo.bootstrap",
88        "items" : [
89         {
90          "xtype" : "Column",
91          "Number xs" : 12,
92          "$ xns" : "Roo.bootstrap",
93          "items" : [
94           {
95            "listeners" : {
96             "select" : "function (combo, record, index)\n{\n    \n}"
97            },
98            "Boolean allowBlank" : false,
99            "String name" : "status_name",
100            "String mode" : "local",
101            "String valueField" : "code",
102            "Boolean editable" : false,
103            "xtype" : "ComboBox",
104            "String triggerAction" : "all",
105            "string fieldLabel" : "Action",
106            "$ xns" : "Roo.bootstrap",
107            "String hiddenName" : "status",
108            "String displayField" : "value",
109            "items" : [
110             {
111              "$ string data" : "[\n    ['1', 'Approve'],\n    ['-1', 'Reject']\n] ",
112              "xtype" : "SimpleStore",
113              "$ xns" : "Roo.data",
114              "$ fields" : "[ 'code', 'value' ]",
115              "* prop" : "store"
116             }
117            ]
118           }
119          ]
120         }
121        ]
122       },
123       {
124        "xtype" : "Row",
125        "$ xns" : "Roo.bootstrap",
126        "items" : [
127         {
128          "xtype" : "Column",
129          "Number xs" : 12,
130          "$ xns" : "Roo.bootstrap",
131          "items" : [
132           {
133            "String name" : "id",
134            "xtype" : "Input",
135            "String inputType" : "hidden",
136            "$ xns" : "Roo.bootstrap"
137           },
138           {
139            "String name" : "authorized_key",
140            "xtype" : "Input",
141            "String inputType" : "hidden",
142            "$ xns" : "Roo.bootstrap"
143           }
144          ]
145         }
146        ]
147       }
148      ]
149     },
150     {
151      "listeners" : {
152       "render" : "function (_self)\n{\n    _this.error_row = this;\n    \n    this.el.setVisibilityMode(Roo.Element.DISPLAY);\n    \n    this.el.hide();\n}"
153      },
154      "xtype" : "Row",
155      "$ xns" : "Roo.bootstrap",
156      "items" : [
157       {
158        "xtype" : "Column",
159        "Number xs" : 12,
160        "$ xns" : "Roo.bootstrap",
161        "items" : [
162         {
163          "listeners" : {
164           "render" : "function (_self)\n{\n    _this.text_el = _self;\n}"
165          },
166          "xtype" : "Element",
167          "$ xns" : "Roo.bootstrap",
168          "String html" : ""
169         }
170        ]
171       }
172      ]
173     },
174     {
175      "listeners" : {
176       "render" : "function (_self)\n{\n    _this.btn_ok = _self;\n}",
177       "click" : "function (_self, e)\n{\n    if(!_this.form.isValid()){\n        return;\n    }\n    \n    var p1 = _this.form.findField('password').getValue();\n    var p2 = _this.form.findField('password1').getValue();\n    \n    if (p1 != p2) {\n        _this.form.findField('password1').markInvalid('Password do not match');\n        return;\n    }\n    \n    _this.dialog.el.mask('Sending...');\n    _this.form.doAction('submit');\n    \n}"
178      },
179      "String weight" : "primary",
180      "xtype" : "Button",
181      "$ xns" : "Roo.bootstrap",
182      "String html" : "Start the application process   ",
183      "* prop" : "buttons[]"
184     },
185     {
186      "listeners" : {
187       "render" : "function (_self)\n{\n    _this.btn_resend = _self;\n     this.el.setVisibilityMode(Roo.Element.DISPLAY);\n     this.el.hide();\n}",
188       "click" : "function (_self, e)\n{\n    var path = window.location.pathname.split('/');\n    \n    var verify_key = path.pop();\n    \n    var id = path.pop();\n    \n    new Pman.Request({\n        url: baseURL + '/Roo/Coba_application_signup',\n        method : 'POST',\n        mask : 'Sending...',\n        params : {\n            _resend : id\n        }, \n        success : function(res) {\n            var msg = \"We have re-sent you an invitation via email.\" +\n                        \"<br/><br/>\" + \n                        \"Please check your inbox for the final registration step.\" + \n                         \"<br/><br/>\" + \n                        \"<B>(Note. emails may accidentally be sent to your Spam Folder)</B>\";\n                        \n            Roo.bootstrap.MessageBox.alert('Please check your email', msg) ;\n        },\n        failure: function(res) {\n            Roo.bootstrap.MessageBox.alert('Error', res.errorMsg) ;\n        }\n    });\n}"
189      },
190      "String weight" : "primary",
191      "xtype" : "Button",
192      "$ xns" : "Roo.bootstrap",
193      "String html" : "Resend email",
194      "* prop" : "buttons[]"
195     }
196    ]
197   }
198  ]
199 }