Pman.Dialog.CorePersonContact.bjs
[Pman.Core] / Pman.Dialog.CorePersonContact.bjs
1 {
2     "id": "roo-file-129",
3     "name": "Pman.Dialog.CorePersonContact",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/Pman.Core/Pman.Dialog.CorePersonContact.bjs",
7     "items": [
8         {
9             "closable": false,
10             "collapsible": false,
11             "height": 630,
12             "resizable": false,
13             "title": "Edit / Create Person",
14             "width": 400,
15             "xtype": "LayoutDialog",
16             "|xns": "Roo",
17             "items": [
18                 {
19                     "|xns": "Roo",
20                     "xtype": "LayoutRegion",
21                     "*prop": "center"
22                 },
23                 {
24                     "region": "center",
25                     "xtype": "ContentPanel",
26                     "|xns": "Roo",
27                     "items": [
28                         {
29                             "|xns": "Roo.form",
30                             "xtype": "Form",
31                             "listeners": {
32                                 "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\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                             "method": "POST",
36                             "style": "margin:10px;",
37                             "|url": "baseURL + '/Roo/Person.php'",
38                             "items": [
39                                 {
40                                     "|xns": "Roo.form",
41                                     "xtype": "ComboBox",
42                                     "allowBlank": "false",
43                                     "editable": "false",
44                                     "emptyText": "Select Office",
45                                     "forceSelection": true,
46                                     "listWidth": 400,
47                                     "loadingText": "Searching...",
48                                     "minChars": 2,
49                                     "pageSize": 20,
50                                     "qtip": "Select Office",
51                                     "selectOnFocus": true,
52                                     "triggerAction": "all",
53                                     "typeAhead": true,
54                                     "width": 300,
55                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
56                                     "queryParam": "query[name]",
57                                     "fieldLabel": "Office",
58                                     "valueField": "id",
59                                     "displayField": "name",
60                                     "hiddenName": "office_id",
61                                     "name": "office_id_name",
62                                     "items": [
63                                         {
64                                             "*prop": "store",
65                                             "xtype": "Store",
66                                             "|xns": "Roo.data",
67                                             "remoteSort": true,
68                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
69                                             "listeners": {
70                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
71                                             },
72                                             "items": [
73                                                 {
74                                                     "*prop": "proxy",
75                                                     "xtype": "HttpProxy",
76                                                     "method": "GET",
77                                                     "|xns": "Roo.data",
78                                                     "|url": "baseURL + '/Roo/Office.php'"
79                                                 },
80                                                 {
81                                                     "*prop": "reader",
82                                                     "xtype": "JsonReader",
83                                                     "|xns": "Roo.data",
84                                                     "id": "id",
85                                                     "root": "data",
86                                                     "totalProperty": "total",
87                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
88                                                 }
89                                             ]
90                                         }
91                                     ]
92                                 },
93                                 {
94                                     "fieldLabel": "Name",
95                                     "name": "name",
96                                     "width": 200,
97                                     "|xns": "Roo.form",
98                                     "xtype": "TextField"
99                                 },
100                                 {
101                                     "fieldLabel": "Phone",
102                                     "name": "phone",
103                                     "width": 200,
104                                     "|xns": "Roo.form",
105                                     "xtype": "TextField"
106                                 },
107                                 {
108                                     "fieldLabel": "Fax",
109                                     "name": "fax",
110                                     "width": 200,
111                                     "|xns": "Roo.form",
112                                     "xtype": "TextField"
113                                 },
114                                 {
115                                     "fieldLabel": "Email",
116                                     "name": "email",
117                                     "width": 200,
118                                     "|xns": "Roo.form",
119                                     "xtype": "TextField"
120                                 },
121                                 {
122                                     "|xns": "Roo.form",
123                                     "xtype": "ComboBox",
124                                     "allowBlank": "false",
125                                     "editable": "false",
126                                     "emptyText": "Select Companies",
127                                     "forceSelection": true,
128                                     "listWidth": 400,
129                                     "loadingText": "Searching...",
130                                     "minChars": 2,
131                                     "pageSize": 20,
132                                     "qtip": "Select Companies",
133                                     "selectOnFocus": true,
134                                     "triggerAction": "all",
135                                     "typeAhead": true,
136                                     "width": 300,
137                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{code}</b> </div>",
138                                     "queryParam": "query[code]",
139                                     "fieldLabel": "Company",
140                                     "valueField": "id",
141                                     "displayField": "code",
142                                     "hiddenName": "company_id",
143                                     "name": "company_id_code",
144                                     "items": [
145                                         {
146                                             "*prop": "store",
147                                             "xtype": "Store",
148                                             "|xns": "Roo.data",
149                                             "remoteSort": true,
150                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
151                                             "listeners": {
152                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
153                                             },
154                                             "items": [
155                                                 {
156                                                     "*prop": "proxy",
157                                                     "xtype": "HttpProxy",
158                                                     "method": "GET",
159                                                     "|xns": "Roo.data",
160                                                     "|url": "baseURL + '/Roo/Companies.php'"
161                                                 },
162                                                 {
163                                                     "*prop": "reader",
164                                                     "xtype": "JsonReader",
165                                                     "|xns": "Roo.data",
166                                                     "id": "id",
167                                                     "root": "data",
168                                                     "totalProperty": "total",
169                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"code\",\"type\":\"string\"}]"
170                                                 }
171                                             ]
172                                         }
173                                     ]
174                                 },
175                                 {
176                                     "fieldLabel": "Role",
177                                     "name": "role",
178                                     "width": 200,
179                                     "|xns": "Roo.form",
180                                     "xtype": "TextField"
181                                 },
182                                 {
183                                     "fieldLabel": "Active",
184                                     "name": "active",
185                                     "width": 75,
186                                     "|xns": "Roo.form",
187                                     "xtype": "TextField"
188                                 },
189                                 {
190                                     "fieldLabel": "Remarks",
191                                     "name": "remarks",
192                                     "width": 200,
193                                     "|xns": "Roo.form",
194                                     "xtype": "TextArea",
195                                     "height": 100
196                                 },
197                                 {
198                                     "fieldLabel": "Passwd",
199                                     "name": "passwd",
200                                     "width": 200,
201                                     "|xns": "Roo.form",
202                                     "xtype": "TextField"
203                                 },
204                                 {
205                                     "|xns": "Roo.form",
206                                     "xtype": "ComboBox",
207                                     "allowBlank": "false",
208                                     "editable": "false",
209                                     "emptyText": "Select Person",
210                                     "forceSelection": true,
211                                     "listWidth": 400,
212                                     "loadingText": "Searching...",
213                                     "minChars": 2,
214                                     "pageSize": 20,
215                                     "qtip": "Select Person",
216                                     "selectOnFocus": true,
217                                     "triggerAction": "all",
218                                     "typeAhead": true,
219                                     "width": 300,
220                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
221                                     "queryParam": "query[name]",
222                                     "fieldLabel": "Owner",
223                                     "valueField": "id",
224                                     "displayField": "name",
225                                     "hiddenName": "owner_id",
226                                     "name": "owner_id_name",
227                                     "items": [
228                                         {
229                                             "*prop": "store",
230                                             "xtype": "Store",
231                                             "|xns": "Roo.data",
232                                             "remoteSort": true,
233                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
234                                             "listeners": {
235                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
236                                             },
237                                             "items": [
238                                                 {
239                                                     "*prop": "proxy",
240                                                     "xtype": "HttpProxy",
241                                                     "method": "GET",
242                                                     "|xns": "Roo.data",
243                                                     "|url": "baseURL + '/Roo/Person.php'"
244                                                 },
245                                                 {
246                                                     "*prop": "reader",
247                                                     "xtype": "JsonReader",
248                                                     "|xns": "Roo.data",
249                                                     "id": "id",
250                                                     "root": "data",
251                                                     "totalProperty": "total",
252                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
253                                                 }
254                                             ]
255                                         }
256                                     ]
257                                 },
258                                 {
259                                     "fieldLabel": "Lang",
260                                     "name": "lang",
261                                     "width": 200,
262                                     "|xns": "Roo.form",
263                                     "xtype": "TextField"
264                                 },
265                                 {
266                                     "fieldLabel": "No reset sent",
267                                     "name": "no_reset_sent",
268                                     "width": 75,
269                                     "|xns": "Roo.form",
270                                     "xtype": "TextField"
271                                 },
272                                 {
273                                     "fieldLabel": "Action type",
274                                     "name": "action_type",
275                                     "width": 200,
276                                     "|xns": "Roo.form",
277                                     "xtype": "TextField"
278                                 },
279                                 {
280                                     "|xns": "Roo.form",
281                                     "xtype": "ComboBox",
282                                     "allowBlank": "false",
283                                     "editable": "false",
284                                     "emptyText": "Select Projects",
285                                     "forceSelection": true,
286                                     "listWidth": 400,
287                                     "loadingText": "Searching...",
288                                     "minChars": 2,
289                                     "pageSize": 20,
290                                     "qtip": "Select Projects",
291                                     "selectOnFocus": true,
292                                     "triggerAction": "all",
293                                     "typeAhead": true,
294                                     "width": 300,
295                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
296                                     "queryParam": "query[name]",
297                                     "fieldLabel": "Project",
298                                     "valueField": "id",
299                                     "displayField": "name",
300                                     "hiddenName": "project_id",
301                                     "name": "project_id_name",
302                                     "items": [
303                                         {
304                                             "*prop": "store",
305                                             "xtype": "Store",
306                                             "|xns": "Roo.data",
307                                             "remoteSort": true,
308                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
309                                             "listeners": {
310                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
311                                             },
312                                             "items": [
313                                                 {
314                                                     "*prop": "proxy",
315                                                     "xtype": "HttpProxy",
316                                                     "method": "GET",
317                                                     "|xns": "Roo.data",
318                                                     "|url": "baseURL + '/Roo/Projects.php'"
319                                                 },
320                                                 {
321                                                     "*prop": "reader",
322                                                     "xtype": "JsonReader",
323                                                     "|xns": "Roo.data",
324                                                     "id": "id",
325                                                     "root": "data",
326                                                     "totalProperty": "total",
327                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
328                                                 }
329                                             ]
330                                         }
331                                     ]
332                                 },
333                                 {
334                                     "fieldLabel": "Deleted by",
335                                     "name": "deleted_by",
336                                     "width": 75,
337                                     "|xns": "Roo.form",
338                                     "xtype": "TextField"
339                                 },
340                                 {
341                                     "fieldLabel": "Deleted dt",
342                                     "name": "deleted_dt",
343                                     "width": 75,
344                                     "|xns": "Roo.form",
345                                     "xtype": "DateField"
346                                 },
347                                 {
348                                     "name": "id",
349                                     "|xns": "Roo.form",
350                                     "xtype": "Hidden"
351                                 }
352                             ]
353                         }
354                     ]
355                 },
356                 {
357                     "listeners": {
358                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
359                     },
360                     "*prop": "buttons[]",
361                     "text": "Cancel",
362                     "xtype": "Button",
363                     "|xns": "Roo"
364                 },
365                 {
366                     "listeners": {
367                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
368                     },
369                     "*prop": "buttons[]",
370                     "text": "Save",
371                     "xtype": "Button",
372                     "|xns": "Roo"
373                 }
374             ]
375         }
376     ],
377     "permname": ""
378 }