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