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                                     "fieldLabel": "Passwd",
184                                     "name": "passwd",
185                                     "width": 200,
186                                     "|xns": "Roo.form",
187                                     "xtype": "TextField"
188                                 },
189                                 {
190                                     "|xns": "Roo.form",
191                                     "xtype": "ComboBox",
192                                     "allowBlank": "false",
193                                     "editable": "false",
194                                     "emptyText": "Select Person",
195                                     "forceSelection": true,
196                                     "listWidth": 400,
197                                     "loadingText": "Searching...",
198                                     "minChars": 2,
199                                     "pageSize": 20,
200                                     "qtip": "Select Person",
201                                     "selectOnFocus": true,
202                                     "triggerAction": "all",
203                                     "typeAhead": true,
204                                     "width": 300,
205                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
206                                     "queryParam": "query[name]",
207                                     "fieldLabel": "Owner",
208                                     "valueField": "id",
209                                     "displayField": "name",
210                                     "hiddenName": "owner_id",
211                                     "name": "owner_id_name",
212                                     "items": [
213                                         {
214                                             "*prop": "store",
215                                             "xtype": "Store",
216                                             "|xns": "Roo.data",
217                                             "remoteSort": true,
218                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
219                                             "listeners": {
220                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
221                                             },
222                                             "items": [
223                                                 {
224                                                     "*prop": "proxy",
225                                                     "xtype": "HttpProxy",
226                                                     "method": "GET",
227                                                     "|xns": "Roo.data",
228                                                     "|url": "baseURL + '/Roo/Person.php'"
229                                                 },
230                                                 {
231                                                     "*prop": "reader",
232                                                     "xtype": "JsonReader",
233                                                     "|xns": "Roo.data",
234                                                     "id": "id",
235                                                     "root": "data",
236                                                     "totalProperty": "total",
237                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
238                                                 }
239                                             ]
240                                         }
241                                     ]
242                                 },
243                                 {
244                                     "fieldLabel": "Lang",
245                                     "name": "lang",
246                                     "width": 200,
247                                     "|xns": "Roo.form",
248                                     "xtype": "TextField"
249                                 },
250                                 {
251                                     "fieldLabel": "No reset sent",
252                                     "name": "no_reset_sent",
253                                     "width": 75,
254                                     "|xns": "Roo.form",
255                                     "xtype": "TextField"
256                                 },
257                                 {
258                                     "fieldLabel": "Action type",
259                                     "name": "action_type",
260                                     "width": 200,
261                                     "|xns": "Roo.form",
262                                     "xtype": "TextField"
263                                 },
264                                 {
265                                     "|xns": "Roo.form",
266                                     "xtype": "ComboBox",
267                                     "allowBlank": "false",
268                                     "editable": "false",
269                                     "emptyText": "Select Projects",
270                                     "forceSelection": true,
271                                     "listWidth": 400,
272                                     "loadingText": "Searching...",
273                                     "minChars": 2,
274                                     "pageSize": 20,
275                                     "qtip": "Select Projects",
276                                     "selectOnFocus": true,
277                                     "triggerAction": "all",
278                                     "typeAhead": true,
279                                     "width": 300,
280                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
281                                     "queryParam": "query[name]",
282                                     "fieldLabel": "Project",
283                                     "valueField": "id",
284                                     "displayField": "name",
285                                     "hiddenName": "project_id",
286                                     "name": "project_id_name",
287                                     "items": [
288                                         {
289                                             "*prop": "store",
290                                             "xtype": "Store",
291                                             "|xns": "Roo.data",
292                                             "remoteSort": true,
293                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
294                                             "listeners": {
295                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
296                                             },
297                                             "items": [
298                                                 {
299                                                     "*prop": "proxy",
300                                                     "xtype": "HttpProxy",
301                                                     "method": "GET",
302                                                     "|xns": "Roo.data",
303                                                     "|url": "baseURL + '/Roo/Projects.php'"
304                                                 },
305                                                 {
306                                                     "*prop": "reader",
307                                                     "xtype": "JsonReader",
308                                                     "|xns": "Roo.data",
309                                                     "id": "id",
310                                                     "root": "data",
311                                                     "totalProperty": "total",
312                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
313                                                 }
314                                             ]
315                                         }
316                                     ]
317                                 },
318                                 {
319                                     "fieldLabel": "Deleted by",
320                                     "name": "deleted_by",
321                                     "width": 75,
322                                     "|xns": "Roo.form",
323                                     "xtype": "TextField"
324                                 },
325                                 {
326                                     "fieldLabel": "Deleted dt",
327                                     "name": "deleted_dt",
328                                     "width": 75,
329                                     "|xns": "Roo.form",
330                                     "xtype": "DateField"
331                                 },
332                                 {
333                                     "name": "id",
334                                     "|xns": "Roo.form",
335                                     "xtype": "Hidden"
336                                 }
337                             ]
338                         }
339                     ]
340                 },
341                 {
342                     "listeners": {
343                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
344                     },
345                     "*prop": "buttons[]",
346                     "text": "Cancel",
347                     "xtype": "Button",
348                     "|xns": "Roo"
349                 },
350                 {
351                     "listeners": {
352                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
353                     },
354                     "*prop": "buttons[]",
355                     "text": "Save",
356                     "xtype": "Button",
357                     "|xns": "Roo"
358                 }
359             ]
360         }
361     ],
362     "permname": ""
363 }