Pman.Dialog.CoreProject.bjs
[Pman.Core] / Pman.Dialog.CoreProject.bjs
1 {
2     "id": "roo-file-129",
3     "name": "Pman.Dialog.CoreProject",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/Pman.Admin/Pman.Dialog.CoreProject.bjs",
7     "items": [
8         {
9             "closable": false,
10             "collapsible": false,
11             "height": 450,
12             "resizable": false,
13             "title": "Edit / Create Projects",
14             "width": 470,
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/Projects.php'",
38                             "items": [
39                                 {
40                                     "fieldLabel": "Code",
41                                     "name": "code",
42                                     "width": 150,
43                                     "xtype": "TextField",
44                                     "|xns": "Roo.form"
45                                 },
46                                 {
47                                     "fieldLabel": "Project Name",
48                                     "name": "name",
49                                     "qtip": "Enter Project Name",
50                                     "width": 300,
51                                     "xtype": "TextField",
52                                     "|xns": "Roo.form"
53                                 },
54                                 {
55                                     "allowBlank": false,
56                                     "displayField": "desc",
57                                     "editable": false,
58                                     "emptyText": "Select Project Type",
59                                     "fieldLabel": "Project Type",
60                                     "forceSelection": true,
61                                     "hiddenName": "type",
62                                     "listWidth": 400,
63                                     "loadingText": "Searching...",
64                                     "minChars": 2,
65                                     "name": "type_desc",
66                                     "pageSize": 20,
67                                     "qtip": "Select Project Type",
68                                     "queryParam": "query[name]",
69                                     "selectOnFocus": true,
70                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{desc}</b> </div>",
71                                     "triggerAction": "all",
72                                     "typeAhead": true,
73                                     "valueField": "id",
74                                     "width": 200,
75                                     "xtype": "ComboBox",
76                                     "|xns": "Roo.form",
77                                     "items": [
78                                         {
79                                             "*prop": "store",
80                                             "|data": "[ [  'U' , \"Project (Unconfirmed)\" ],\n[  'P' , \"Project\" ],\n[  'C' , \"Project (Closed)\" ],\n[  'N' , \"Non-Project\" ],\n[  'X' , \"Non-Project (Closed)\" ]\n]",
81                                             "|fields": " [ 'code', 'desc' ]",
82                                             "xtype": "SimpleStore",
83                                             "|xns": "Roo.data"
84                                         }
85                                     ]
86                                 },
87                                 {
88                                     "listeners": {
89                                         "add": "function (combo)\n{\n Pman.Dialog.Companies.show( {  id: 0 },  function(data) {\n            _this.form.setValues({ \n                client_id : data.id,\n                client_id_name : data.name\n            });\n        }); \n}"
90                                     },
91                                     "allowBlank": "false",
92                                     "displayField": "code",
93                                     "editable": "false",
94                                     "emptyText": "Select Company",
95                                     "fieldLabel": "Client",
96                                     "forceSelection": true,
97                                     "hiddenName": "client_id",
98                                     "listWidth": 400,
99                                     "loadingText": "Searching...",
100                                     "minChars": 2,
101                                     "name": "client_id_name",
102                                     "pageSize": 20,
103                                     "qtip": "Select Companies",
104                                     "queryParam": "query[code]",
105                                     "selectOnFocus": true,
106                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
107                                     "triggerAction": "all",
108                                     "typeAhead": true,
109                                     "valueField": "id",
110                                     "width": 300,
111                                     "xtype": "ComboBox",
112                                     "|xns": "Roo.form",
113                                     "items": [
114                                         {
115                                             "listeners": {
116                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n   \n    o.params.type = 1;\n    o.params['query[group_pulldown]'] = 1;\n}\n"
117                                             },
118                                             "*prop": "store",
119                                             "remoteSort": true,
120                                             "xtype": "Store",
121                                             "|sortInfo": "{ direction : 'ASC', field: 'name' }",
122                                             "|xns": "Roo.data",
123                                             "items": [
124                                                 {
125                                                     "*prop": "proxy",
126                                                     "xtype": "HttpProxy",
127                                                     "method": "GET",
128                                                     "|xns": "Roo.data",
129                                                     "|url": "baseURL + '/Roo/Companies.php'"
130                                                 },
131                                                 {
132                                                     "*prop": "reader",
133                                                     "xtype": "JsonReader",
134                                                     "|xns": "Roo.data",
135                                                     "id": "id",
136                                                     "root": "data",
137                                                     "totalProperty": "total",
138                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"code\",\"type\":\"string\"}]"
139                                                 }
140                                             ]
141                                         }
142                                     ]
143                                 },
144                                 {
145                                     "allowBlank": "false",
146                                     "displayField": "name",
147                                     "editable": "false",
148                                     "emptyText": "Select Team",
149                                     "fieldLabel": "Team",
150                                     "forceSelection": true,
151                                     "hiddenName": "team_id",
152                                     "listWidth": 400,
153                                     "loadingText": "Searching...",
154                                     "minChars": 2,
155                                     "name": "team_id_name",
156                                     "pageSize": 20,
157                                     "qtip": "Select Team",
158                                     "queryParam": "query[name]",
159                                     "selectOnFocus": true,
160                                     "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
161                                     "triggerAction": "all",
162                                     "typeAhead": true,
163                                     "valueField": "id",
164                                     "width": 300,
165                                     "xtype": "ComboBox",
166                                     "|xns": "Roo.form",
167                                     "items": [
168                                         {
169                                             "*prop": "store",
170                                             "xtype": "Store",
171                                             "|xns": "Roo.data",
172                                             "remoteSort": true,
173                                             "|sortInfo": "{ direction : 'ASC', field: 'id' }",
174                                             "listeners": {
175                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
176                                             },
177                                             "items": [
178                                                 {
179                                                     "*prop": "proxy",
180                                                     "xtype": "HttpProxy",
181                                                     "method": "GET",
182                                                     "|xns": "Roo.data",
183                                                     "|url": "baseURL + '/Roo/Groups.php'"
184                                                 },
185                                                 {
186                                                     "*prop": "reader",
187                                                     "xtype": "JsonReader",
188                                                     "|xns": "Roo.data",
189                                                     "id": "id",
190                                                     "root": "data",
191                                                     "totalProperty": "total",
192                                                     "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
193                                                 }
194                                             ]
195                                         }
196                                     ]
197                                 },
198                                 {
199                                     "fieldLabel": "File location",
200                                     "name": "file_location",
201                                     "width": 300,
202                                     "xtype": "TextField",
203                                     "|xns": "Roo.form"
204                                 },
205                                 {
206                                     "fieldLabel": "Remarks",
207                                     "height": 100,
208                                     "name": "remarks",
209                                     "width": 300,
210                                     "xtype": "TextArea",
211                                     "|xns": "Roo.form"
212                                 },
213                                 {
214                                     "legend": "Opened",
215                                     "xtype": "FieldSet",
216                                     "|xns": "Roo.form",
217                                     "items": [
218                                         {
219                                             "altFormats": "Y-m-d|d/m/Y",
220                                             "fieldLabel": "Open date",
221                                             "format": "d/m/Y",
222                                             "name": "open_date",
223                                             "width": 100,
224                                             "xtype": "DateField",
225                                             "|xns": "Roo.form"
226                                         },
227                                         {
228                                             "|xns": "Roo.form",
229                                             "xtype": "ComboBox",
230                                             "allowBlank": "false",
231                                             "editable": "false",
232                                             "emptyText": "Select Person",
233                                             "forceSelection": true,
234                                             "listWidth": 400,
235                                             "loadingText": "Searching...",
236                                             "minChars": 2,
237                                             "pageSize": 20,
238                                             "qtip": "Select Person",
239                                             "selectOnFocus": true,
240                                             "triggerAction": "all",
241                                             "typeAhead": true,
242                                             "width": 300,
243                                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
244                                             "queryParam": "query[name]",
245                                             "fieldLabel": "Open by",
246                                             "valueField": "id",
247                                             "displayField": "name",
248                                             "hiddenName": "open_by",
249                                             "name": "open_by_name",
250                                             "items": [
251                                                 {
252                                                     "*prop": "store",
253                                                     "xtype": "Store",
254                                                     "|xns": "Roo.data",
255                                                     "remoteSort": true,
256                                                     "|sortInfo": "{ direction : 'ASC', field: 'id' }",
257                                                     "listeners": {
258                                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
259                                                     },
260                                                     "items": [
261                                                         {
262                                                             "*prop": "proxy",
263                                                             "xtype": "HttpProxy",
264                                                             "method": "GET",
265                                                             "|xns": "Roo.data",
266                                                             "|url": "baseURL + '/Roo/Person.php'"
267                                                         },
268                                                         {
269                                                             "*prop": "reader",
270                                                             "xtype": "JsonReader",
271                                                             "|xns": "Roo.data",
272                                                             "id": "id",
273                                                             "root": "data",
274                                                             "totalProperty": "total",
275                                                             "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]"
276                                                         }
277                                                     ]
278                                                 }
279                                             ]
280                                         }
281                                     ]
282                                 },
283                                 {
284                                     "name": "id",
285                                     "|xns": "Roo.form",
286                                     "xtype": "Hidden"
287                                 }
288                             ]
289                         }
290                     ]
291                 },
292                 {
293                     "listeners": {
294                         "click": "function (_self, e)\n{\n    _this.dialog.hide();\n}"
295                     },
296                     "*prop": "buttons[]",
297                     "text": "Cancel",
298                     "xtype": "Button",
299                     "|xns": "Roo"
300                 },
301                 {
302                     "listeners": {
303                         "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
304                     },
305                     "*prop": "buttons[]",
306                     "text": "Save",
307                     "xtype": "Button",
308                     "|xns": "Roo"
309                 }
310             ]
311         }
312     ],
313     "permname": ""
314 }