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