Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleQuickContact.bjs
1 {
2     "name" : "Pman.Dialog.XtupleQuickContact",
3     "parent" : "",
4     "title" : "",
5     "path" : "/home/alan/gitlive/Pman.Xtuple/Pman.Dialog.XtupleQuickContact.bjs",
6     "permname" : "",
7     "modOrder" : "001",
8     "items" : [
9         {
10             "modal" : true,
11             "collapsible" : false,
12             "title" : "Quick enter Contact /  Address",
13             "xtype" : "LayoutDialog",
14             "width" : 500,
15             "$ xns" : "Roo",
16             "closable" : false,
17             "resizable" : false,
18             "height" : 480,
19             "items" : [
20                 {
21                     "xtype" : "LayoutRegion",
22                     "$ xns" : "Roo",
23                     "* prop" : "center"
24                 },
25                 {
26                     "region" : "center",
27                     "xtype" : "ContentPanel",
28                     "$ xns" : "Roo",
29                     "items" : [
30                         {
31                             "listeners" : {
32                                 "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n        if (_this.data._id) { \n            this.load({ method: 'GET', params: { \n                _id : _this.data._id , \n                _with_addr : 1\n            }});\n        }\n       return;\n    }\n    if (action.type == 'load') {\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.hide();\n    \n         if (_this.callback) {\n             _this.form.setValues(action.result.data);\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
33                                 "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
34                             },
35                             "$ url" : "baseURL + '/Roo/cntct.php'",
36                             "xtype" : "Form",
37                             "method" : "POST",
38                             "style" : "margin:10px;",
39                             "$ xns" : "Roo.form",
40                             "items" : [
41                                 {
42                                     "fieldLabel" : "First Name",
43                                     "xtype" : "TextField",
44                                     "allowBlank" : false,
45                                     "width" : 300,
46                                     "$ xns" : "Roo.form",
47                                     "name" : "cntct_first_name"
48                                 },
49                                 {
50                                     "fieldLabel" : "Last Name",
51                                     "xtype" : "TextField",
52                                     "width" : 300,
53                                     "$ xns" : "Roo.form",
54                                     "name" : "cntct_last_name"
55                                 },
56                                 {
57                                     "fieldLabel" : "ID Card",
58                                     "xtype" : "TextField",
59                                     "width" : 300,
60                                     "$ xns" : "Roo.form",
61                                     "name" : "cntct_id_card"
62                                 },
63                                 {
64                                     "xtype" : "Row",
65                                     "labelWidth" : 120,
66                                     "width" : 500,
67                                     "$ xns" : "Roo.form",
68                                     "items" : [
69                                         {
70                                             "xtype" : "Column",
71                                             "$ xns" : "Roo.form",
72                                             "items" : [
73                                                 {
74                                                     "fieldLabel" : "Phone / Alt",
75                                                     "xtype" : "TextField",
76                                                     "$ regex" : "/^[0-9 +-]+$/",
77                                                     "width" : 130,
78                                                     "$ xns" : "Roo.form",
79                                                     "name" : "cntct_phone"
80                                                 }
81                                             ]
82                                         },
83                                         {
84                                             "xtype" : "Column",
85                                             "$ xns" : "Roo.form",
86                                             "Boolean hideLabels" : true,
87                                             "String/Object/Function style" : "padding-left:10px",
88                                             "items" : [
89                                                 {
90                                                     "fieldLabel" : "Phone (Alt)",
91                                                     "xtype" : "TextField",
92                                                     "$ regex" : "/^[0-9 +-]+$/",
93                                                     "width" : 150,
94                                                     "$ xns" : "Roo.form",
95                                                     "name" : "cntct_phone2"
96                                                 }
97                                             ]
98                                         }
99                                     ]
100                                 },
101                                 {
102                                     "fieldLabel" : "Email",
103                                     "vtype" : "email",
104                                     "xtype" : "TextField",
105                                     "width" : 200,
106                                     "$ xns" : "Roo.form",
107                                     "name" : "cntct_email"
108                                 },
109                                 {
110                                     "xtype" : "FieldSet",
111                                     "legend" : "Address",
112                                     "style" : "width:420px",
113                                     "$ xns" : "Roo.form",
114                                     "items" : [
115                                         {
116                                             "listeners" : {
117                                                 "keyup" : "function (_self, e)\n{\n    _this.form.findField('addr_number').sync();\n}"
118                                             },
119                                             "fieldLabel" : "Line 1",
120                                             "xtype" : "TextField",
121                                             "allowBlank" : false,
122                                             "width" : 300,
123                                             "$ xns" : "Roo.form",
124                                             "name" : "cntct_addr_id_addr_line1"
125                                         },
126                                         {
127                                             "fieldLabel" : "Line 2",
128                                             "xtype" : "TextField",
129                                             "width" : 300,
130                                             "$ xns" : "Roo.form",
131                                             "name" : "cntct_addr_id_addr_line2"
132                                         },
133                                         {
134                                             "fieldLabel" : "Line 3",
135                                             "xtype" : "TextField",
136                                             "width" : 300,
137                                             "$ xns" : "Roo.form",
138                                             "name" : "cntct_addr_id_addr_line3"
139                                         },
140                                         {
141                                             "listWidth" : 400,
142                                             "triggerAction" : "all",
143                                             "fieldLabel" : "State",
144                                             "selectOnFocus" : true,
145                                             "displayField" : "addr_state",
146                                             "emptyText" : "State",
147                                             "hiddenName" : "cntct_addr_id_addr_state",
148                                             "minChars" : 2,
149                                             "valueField" : "addr_state",
150                                             "xtype" : "ComboBox",
151                                             "allowBlank" : true,
152                                             "typeAhead" : true,
153                                             "editable" : true,
154                                             "width" : 200,
155                                             "$ xns" : "Roo.form",
156                                             "name" : "cntct_addr_id_addr_state",
157                                             "qtip" : "Select State",
158                                             "queryParam" : "query[addr_state]",
159                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{addr_state}</b> </div>",
160                                             "loadingText" : "Searching...",
161                                             "items" : [
162                                                 {
163                                                     "listeners" : {
164                                                         "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n   // o.params.state_country_id_country_name = _this.form.findField('addr_country').getValue();\n    //if (!o.params.state_country_id_country_name.length) {\n    //    Roo.MessageBox.alert(\"Select Country First\");\n//        return false;\n  //  }\n  \n   o.params._distinct = 'addr_state';\n   o.params._columns = 'addr_state';\n   o.params.limit = 999;\n    // set more here\n}\n"
165                                                     },
166                                                     "xtype" : "Store",
167                                                     "remoteSort" : true,
168                                                     "$ sortInfo" : "{ direction : 'ASC', field: 'addr_state' }",
169                                                     "$ xns" : "Roo.data",
170                                                     "* prop" : "store",
171                                                     "items" : [
172                                                         {
173                                                             "$ url" : "baseURL + '/Roo/addr.php'",
174                                                             "xtype" : "HttpProxy",
175                                                             "method" : "GET",
176                                                             "$ xns" : "Roo.data",
177                                                             "* prop" : "proxy"
178                                                         },
179                                                         {
180                                                             "id" : "addr_state",
181                                                             "root" : "data",
182                                                             "xtype" : "JsonReader",
183                                                             "$ fields" : "[ \"addr_state\"]",
184                                                             "$ xns" : "Roo.data",
185                                                             "* prop" : "reader",
186                                                             "totalProperty" : "total"
187                                                         }
188                                                     ]
189                                                 }
190                                             ]
191                                         },
192                                         {
193                                             "fieldLabel" : "City",
194                                             "xtype" : "TextField",
195                                             "width" : 300,
196                                             "$ xns" : "Roo.form",
197                                             "name" : "cntct_addr_id_addr_city"
198                                         },
199                                         {
200                                             "fieldLabel" : "Zip code",
201                                             "xtype" : "TextField",
202                                             "width" : 300,
203                                             "$ xns" : "Roo.form",
204                                             "name" : "cntct_addr_id_addr_postalcode"
205                                         },
206                                         {
207                                             "listWidth" : 400,
208                                             "triggerAction" : "all",
209                                             "fieldLabel" : "Country",
210                                             "selectOnFocus" : true,
211                                             "displayField" : "country_name",
212                                             "emptyText" : "Country",
213                                             "hiddenName" : "cntct_addr_id_addr_country",
214                                             "minChars" : 2,
215                                             "valueField" : "country_name",
216                                             "xtype" : "ComboBox",
217                                             "allowBlank" : true,
218                                             "typeAhead" : true,
219                                             "editable" : true,
220                                             "width" : 200,
221                                             "$ xns" : "Roo.form",
222                                             "name" : "cntct_addr_id_addr_country",
223                                             "qtip" : "Select Country",
224                                             "queryParam" : "query[country_name]",
225                                             "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{country_name}</b> </div>",
226                                             "loadingText" : "Searching...",
227                                             "items" : [
228                                                 {
229                                                     "listeners" : {
230                                                         "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.limit = 999;\n}\n"
231                                                     },
232                                                     "xtype" : "Store",
233                                                     "remoteSort" : true,
234                                                     "$ sortInfo" : "{ direction : 'ASC', field: 'country_name' }",
235                                                     "$ xns" : "Roo.data",
236                                                     "* prop" : "store",
237                                                     "items" : [
238                                                         {
239                                                             "$ url" : "baseURL + '/Roo/country.php'",
240                                                             "xtype" : "HttpProxy",
241                                                             "method" : "GET",
242                                                             "$ xns" : "Roo.data",
243                                                             "* prop" : "proxy"
244                                                         },
245                                                         {
246                                                             "id" : "country_id",
247                                                             "root" : "data",
248                                                             "xtype" : "JsonReader",
249                                                             "$ fields" : "[{\"name\":\"country_id\",\"type\":\"int\"},\"county_name\"]",
250                                                             "$ xns" : "Roo.data",
251                                                             "* prop" : "reader",
252                                                             "totalProperty" : "total"
253                                                         }
254                                                     ]
255                                                 }
256                                             ]
257                                         }
258                                     ]
259                                 },
260                                 {
261                                     "legend" : "Store Details (Delivery only)",
262                                     "xtype" : "FieldSet",
263                                     "$ xns" : "Roo.form",
264                                     "items" : [
265                                         {
266                                             "fieldLabel" : "Name",
267                                             "xtype" : "TextField",
268                                             "allowBlank" : true,
269                                             "readOnly" : true,
270                                             "width" : 300,
271                                             "$ xns" : "Roo.form",
272                                             "name" : "vend_name"
273                                         },
274                                         {
275                                             "fieldLabel" : "Code",
276                                             "xtype" : "TextField",
277                                             "allowBlank" : true,
278                                             "readOnly" : true,
279                                             "width" : 300,
280                                             "$ xns" : "Roo.form",
281                                             "name" : "vendaddr_code"
282                                         }
283                                     ]
284                                 },
285                                 {
286                                     "xtype" : "Hidden",
287                                     "width" : 100,
288                                     "$ xns" : "Roo.form",
289                                     "name" : "customer_id"
290                                 },
291                                 {
292                                     "xtype" : "Hidden",
293                                     "width" : 100,
294                                     "$ xns" : "Roo.form",
295                                     "name" : "cntct_addr_id"
296                                 },
297                                 {
298                                     "xtype" : "Hidden",
299                                     "$ xns" : "Roo.form",
300                                     "name" : "cntct_id"
301                                 }
302                             ]
303                         }
304                     ]
305                 },
306                 {
307                     "listeners" : {
308                         "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
309                     },
310                     "text" : "Cancel",
311                     "xtype" : "Button",
312                     "$ xns" : "Roo",
313                     "* prop" : "buttons[]"
314                 },
315                 {
316                     "listeners" : {
317                         "click" : "function (_self, e)\n{\n    // do some checks?\n     \n    \n \n    _this.form.doAction(\"submit\");\n\n}"
318                     },
319                     "text" : "Save",
320                     "xtype" : "Button",
321                     "$ xns" : "Roo",
322                     "* prop" : "buttons[]"
323                 }
324             ]
325         }
326     ]
327 }