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": 500,
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 Companies",
45                                     "forceSelection": true,
46                                     "listWidth": 400,
47                                     "loadingText": "Searching...",
48                                     "minChars": 2,
49                                     "pageSize": 20,
50                                     "qtip": "Select Companies",
51                                     "selectOnFocus": true,
52                                     "triggerAction": "all",
53                                     "typeAhead": true,
54                                     "width": 300,
55                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{code}</b> </div>",
56                                     "queryParam": "query[code]",
57                                     "fieldLabel": "Company",
58                                     "valueField": "id",
59                                     "displayField": "code",
60                                     "hiddenName": "company_id",
61                                     "name": "company_id_code",
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/Companies.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\":\"code\",\"type\":\"string\"}]"
88                                                 }
89                                             ]
90                                         }
91                                     ]
92                                 },
93                                 {
94                                     "|xns": "Roo.form",
95                                     "xtype": "ComboBox",
96                                     "allowBlank": "false",
97                                     "editable": "false",
98                                     "emptyText": "Select Office",
99                                     "forceSelection": true,
100                                     "listWidth": 400,
101                                     "loadingText": "Searching...",
102                                     "minChars": 2,
103                                     "pageSize": 20,
104                                     "qtip": "Select Office",
105                                     "selectOnFocus": true,
106                                     "triggerAction": "all",
107                                     "typeAhead": true,
108                                     "width": 300,
109                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
110                                     "queryParam": "query[name]",
111                                     "fieldLabel": "Office",
112                                     "valueField": "id",
113                                     "displayField": "name",
114                                     "hiddenName": "office_id",
115                                     "name": "office_id_name",
116                                     "items": [
117                                         {
118                                             "*prop": "store",
119                                             "xtype": "Store",
120                                             "|xns": "Roo.data",
121                                             "remoteSort": true,
122                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
123                                             "listeners": {
124                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
125                                             },
126                                             "items": [
127                                                 {
128                                                     "*prop": "proxy",
129                                                     "xtype": "HttpProxy",
130                                                     "method": "GET",
131                                                     "|xns": "Roo.data",
132                                                     "|url": "baseURL + '/Roo/Office.php'"
133                                                 },
134                                                 {
135                                                     "*prop": "reader",
136                                                     "xtype": "JsonReader",
137                                                     "|xns": "Roo.data",
138                                                     "id": "id",
139                                                     "root": "data",
140                                                     "totalProperty": "total",
141                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
142                                                 }
143                                             ]
144                                         }
145                                     ]
146                                 },
147                                 {
148                                     "fieldLabel": "Name",
149                                     "name": "name",
150                                     "width": 300,
151                                     "xtype": "TextField",
152                                     "|xns": "Roo.form"
153                                 },
154                                 {
155                                     "fieldLabel": "Role",
156                                     "name": "role",
157                                     "width": 200,
158                                     "|xns": "Roo.form",
159                                     "xtype": "TextField"
160                                 },
161                                 {
162                                     "fieldLabel": "Phone",
163                                     "name": "phone",
164                                     "width": 200,
165                                     "|xns": "Roo.form",
166                                     "xtype": "TextField"
167                                 },
168                                 {
169                                     "fieldLabel": "Fax",
170                                     "name": "fax",
171                                     "width": 200,
172                                     "|xns": "Roo.form",
173                                     "xtype": "TextField"
174                                 },
175                                 {
176                                     "fieldLabel": "Email",
177                                     "name": "email",
178                                     "width": 200,
179                                     "|xns": "Roo.form",
180                                     "xtype": "TextField"
181                                 },
182                                 {
183                                     "|xns": "Roo.form",
184                                     "xtype": "ComboBox",
185                                     "allowBlank": "false",
186                                     "editable": "false",
187                                     "emptyText": "Select Person",
188                                     "forceSelection": true,
189                                     "listWidth": 400,
190                                     "loadingText": "Searching...",
191                                     "minChars": 2,
192                                     "pageSize": 20,
193                                     "qtip": "Select Person",
194                                     "selectOnFocus": true,
195                                     "triggerAction": "all",
196                                     "typeAhead": true,
197                                     "width": 300,
198                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
199                                     "queryParam": "query[name]",
200                                     "fieldLabel": "Owner",
201                                     "valueField": "id",
202                                     "displayField": "name",
203                                     "hiddenName": "owner_id",
204                                     "name": "owner_id_name",
205                                     "items": [
206                                         {
207                                             "*prop": "store",
208                                             "xtype": "Store",
209                                             "|xns": "Roo.data",
210                                             "remoteSort": true,
211                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
212                                             "listeners": {
213                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
214                                             },
215                                             "items": [
216                                                 {
217                                                     "*prop": "proxy",
218                                                     "xtype": "HttpProxy",
219                                                     "method": "GET",
220                                                     "|xns": "Roo.data",
221                                                     "|url": "baseURL + '/Roo/Person.php'"
222                                                 },
223                                                 {
224                                                     "*prop": "reader",
225                                                     "xtype": "JsonReader",
226                                                     "|xns": "Roo.data",
227                                                     "id": "id",
228                                                     "root": "data",
229                                                     "totalProperty": "total",
230                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
231                                                 }
232                                             ]
233                                         }
234                                     ]
235                                 },
236                                 {
237                                     "fieldLabel": "Lang",
238                                     "name": "lang",
239                                     "width": 200,
240                                     "|xns": "Roo.form",
241                                     "xtype": "TextField"
242                                 },
243                                 {
244                                     "fieldLabel": "No reset sent",
245                                     "name": "no_reset_sent",
246                                     "width": 75,
247                                     "|xns": "Roo.form",
248                                     "xtype": "TextField"
249                                 },
250                                 {
251                                     "fieldLabel": "Action type",
252                                     "name": "action_type",
253                                     "width": 200,
254                                     "|xns": "Roo.form",
255                                     "xtype": "TextField"
256                                 },
257                                 {
258                                     "|xns": "Roo.form",
259                                     "xtype": "ComboBox",
260                                     "allowBlank": "false",
261                                     "editable": "false",
262                                     "emptyText": "Select Projects",
263                                     "forceSelection": true,
264                                     "listWidth": 400,
265                                     "loadingText": "Searching...",
266                                     "minChars": 2,
267                                     "pageSize": 20,
268                                     "qtip": "Select Projects",
269                                     "selectOnFocus": true,
270                                     "triggerAction": "all",
271                                     "typeAhead": true,
272                                     "width": 300,
273                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
274                                     "queryParam": "query[name]",
275                                     "fieldLabel": "Project",
276                                     "valueField": "id",
277                                     "displayField": "name",
278                                     "hiddenName": "project_id",
279                                     "name": "project_id_name",
280                                     "items": [
281                                         {
282                                             "*prop": "store",
283                                             "xtype": "Store",
284                                             "|xns": "Roo.data",
285                                             "remoteSort": true,
286                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
287                                             "listeners": {
288                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
289                                             },
290                                             "items": [
291                                                 {
292                                                     "*prop": "proxy",
293                                                     "xtype": "HttpProxy",
294                                                     "method": "GET",
295                                                     "|xns": "Roo.data",
296                                                     "|url": "baseURL + '/Roo/Projects.php'"
297                                                 },
298                                                 {
299                                                     "*prop": "reader",
300                                                     "xtype": "JsonReader",
301                                                     "|xns": "Roo.data",
302                                                     "id": "id",
303                                                     "root": "data",
304                                                     "totalProperty": "total",
305                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
306                                                 }
307                                             ]
308                                         }
309                                     ]
310                                 },
311                                 {
312                                     "fieldLabel": "Deleted by",
313                                     "name": "deleted_by",
314                                     "width": 75,
315                                     "|xns": "Roo.form",
316                                     "xtype": "TextField"
317                                 },
318                                 {
319                                     "fieldLabel": "Deleted dt",
320                                     "name": "deleted_dt",
321                                     "width": 75,
322                                     "|xns": "Roo.form",
323                                     "xtype": "DateField"
324                                 },
325                                 {
326                                     "name": "id",
327                                     "|xns": "Roo.form",
328                                     "xtype": "Hidden"
329                                 }
330                             ]
331                         }
332                     ]
333                 },
334                 {
335                     "listeners": {
336                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
337                     },
338                     "*prop": "buttons[]",
339                     "text": "Cancel",
340                     "xtype": "Button",
341                     "|xns": "Roo"
342                 },
343                 {
344                     "listeners": {
345                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
346                     },
347                     "*prop": "buttons[]",
348                     "text": "Save",
349                     "xtype": "Button",
350                     "|xns": "Roo"
351                 }
352             ]
353         }
354     ],
355     "permname": ""
356 }