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   "7c5ba892645af8d7dba520e3978c726f" : "Director",
12   "f6039d44b29456b20f8f373155ae4973" : "Username",
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        "listeners" : {
63         "render" : "function (_self)\n{\n    _this.row_pwd_label = _self;\n}"
64        },
65        "xtype" : "Row",
66        "$ xns" : "Roo.bootstrap",
67        "items" : [
68         {
69          "xtype" : "Column",
70          "Number xs" : 12,
71          "$ xns" : "Roo.bootstrap",
72          "items" : [
73           {
74            "String name" : "user_agent",
75            "Boolean readOnly" : true,
76            "xtype" : "TextArea",
77            "string fieldLabel" : "User Agent",
78            "Number rows" : 3,
79            "$ xns" : "Roo.bootstrap"
80           }
81          ]
82         }
83        ]
84       },
85       {
86        "listeners" : {
87         "render" : "function (_self)\n{\n    _this.row_pwd_label = _self;\n}"
88        },
89        "xtype" : "Row",
90        "$ xns" : "Roo.bootstrap",
91        "items" : [
92         {
93          "xtype" : "Column",
94          "Number xs" : 12,
95          "$ xns" : "Roo.bootstrap",
96          "items" : [
97           {
98            "Boolean allowBlank" : false,
99            "String name" : "_existing_director_name",
100            "Number minChars" : 2,
101            "Number md" : 12,
102            "String valueField" : "id",
103            "String queryParam" : "query[name]",
104            "Boolean typeAhead" : true,
105            "xtype" : "ComboBox",
106            "String triggerAction" : "all",
107            "Boolean editable" : true,
108            "Boolean alwaysQuery" : true,
109            "$ xns" : "Roo.bootstrap",
110            "String/Roo.Template tpl" : "<div class=\"roo-select2-result\">{fullname}</div>",
111            "String fieldLabel" : "Director",
112            "String hiddenName" : "_existing_director",
113            "String displayField" : "fullname",
114            "Boolean forceSelection" : true,
115            "String indicatorpos" : "right",
116            "items" : [
117             {
118              "listeners" : {
119               "beforeload" : "function (_self, o)\n{\n    o.params = o.params || {};\n    \n    o.params._with_fullname = 1;\n    \n    var parent = _this.form.findField('parent_company_id').getValue() * 1;\n    \n    o.params._hide_existing = 1;\n    \n    o.params._parent_company_id = parent;\n    \n    if (Roo.select('main').first().dom.className.indexOf('trust') >= 0) {\n        \n        o.params._find_person_type = 'trustee';\n    }\n    \n}"
120              },
121              "xtype" : "Store",
122              "boolean remoteSort" : true,
123              "$ xns" : "Roo.data",
124              "$ sortInfo" : "{field:\"firstname\",direction:\"ASC\"}",
125              "* prop" : "store",
126              "items" : [
127               {
128                "xtype" : "HttpProxy",
129                "$ xns" : "Roo.data",
130                "String method" : "GET",
131                "* prop" : "proxy",
132                "$ String url" : "baseURL+'/Roo/Coba_person'"
133               },
134               {
135                "xtype" : "JsonReader",
136                "$ xns" : "Roo.data",
137                "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'honor',\n        'type': 'string'\n    },\n    {\n        'name': 'firstname',\n        'type': 'string'\n    },\n    {\n        'name': 'middlename',\n        'type': 'string'\n    },\n    {\n        'name': 'lastname',\n        'type': 'string'\n    },\n    {\n        'name': 'fullname',\n        'type': 'string'\n    }\n]",
138                "* prop" : "reader"
139               }
140              ]
141             }
142            ]
143           }
144          ]
145         }
146        ]
147       },
148       {
149        "xtype" : "Row",
150        "$ xns" : "Roo.bootstrap",
151        "items" : [
152         {
153          "xtype" : "Column",
154          "Number xs" : 12,
155          "$ xns" : "Roo.bootstrap",
156          "items" : [
157           {
158            "String name" : "id",
159            "xtype" : "Input",
160            "String inputType" : "hidden",
161            "$ xns" : "Roo.bootstrap"
162           },
163           {
164            "String name" : "authorized_key",
165            "xtype" : "Input",
166            "String inputType" : "hidden",
167            "$ xns" : "Roo.bootstrap"
168           }
169          ]
170         }
171        ]
172       }
173      ]
174     },
175     {
176      "listeners" : {
177       "render" : "function (_self)\n{\n    _this.error_row = this;\n    \n    this.el.setVisibilityMode(Roo.Element.DISPLAY);\n    \n    this.el.hide();\n}"
178      },
179      "xtype" : "Row",
180      "$ xns" : "Roo.bootstrap",
181      "items" : [
182       {
183        "xtype" : "Column",
184        "Number xs" : 12,
185        "$ xns" : "Roo.bootstrap",
186        "items" : [
187         {
188          "listeners" : {
189           "render" : "function (_self)\n{\n    _this.text_el = _self;\n}"
190          },
191          "xtype" : "Element",
192          "$ xns" : "Roo.bootstrap",
193          "String html" : ""
194         }
195        ]
196       }
197      ]
198     },
199     {
200      "listeners" : {
201       "render" : "function (_self)\n{\n    _this.btn_ok = _self;\n}",
202       "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}"
203      },
204      "String weight" : "primary",
205      "xtype" : "Button",
206      "$ xns" : "Roo.bootstrap",
207      "String html" : "Start the application process   ",
208      "* prop" : "buttons[]"
209     },
210     {
211      "listeners" : {
212       "render" : "function (_self)\n{\n    _this.btn_resend = _self;\n     this.el.setVisibilityMode(Roo.Element.DISPLAY);\n     this.el.hide();\n}",
213       "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}"
214      },
215      "String weight" : "primary",
216      "xtype" : "Button",
217      "$ xns" : "Roo.bootstrap",
218      "String html" : "Resend email",
219      "* prop" : "buttons[]"
220     }
221    ]
222   }
223  ]
224 }