Pman.Dialog.CoreProject.bjs
[Pman.Core] / Pman.Dialog.CoreProject.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.CoreProject = {
8
9  _strings : {
10   '99b344c8ae43e3e7213862b8f35c4e51' :"Select Company",
11   '231bc72756b5e6de492aaaa1577f61b1' :"Remarks",
12   '577d7068826de925ea2aec01dbadf5e4' :"Client",
13   'ca528d836417871a349312db705a1951' :"Open date",
14   'ddb016a244ff2b895e69d25fb3b5f780' :"Edit / Create Projects",
15   'b5b20a9df20ea61c1cc0485f5e83891e' :"Select Project Type",
16   '1243daf593fa297e07ab03bf06d925af' :"Searching...",
17   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
18   '9675747b5ab12d05f18518761e68a533' :"Select Companies",
19   'ac848fa228f49ba2b8a5fbd76596817d' :"Team",
20   '24f9e53eb92c0995d04433c1f7a4c9c0' :"File location",
21   'd1847fa47ea6bc047b413947463262ab' :"Enter Project Name",
22   '340c2ee497b85d5954b01c64de7f44f6' :"Select Person",
23   '1a11b1adc359c03db0ca798a00e2632c' :"Opened",
24   '8e3a42158ee70b67cf55b33e2789a9e5' :"Project Name",
25   'ca0dbad92a874b2f69b549293387925e' :"Code",
26   '245fe794333c2b0d5c513129b346b93f' :"Project Type",
27   'ab83ccde6764ca581702f38d79834615' :"Select Team",
28   'c9cc8cce247e49bae79f15173ce97354' :"Save",
29   '223aad18ce30620a724d8a97021ce26e' :"Open by"
30  },
31  _named_strings : {
32   'name_qtip' : 'd1847fa47ea6bc047b413947463262ab' /* Enter Project Name */ ,
33   'client_id_name_emptyText' : '99b344c8ae43e3e7213862b8f35c4e51' /* Select Company */ ,
34   'client_id_name_fieldLabel' : '577d7068826de925ea2aec01dbadf5e4' /* Client */ ,
35   'type_desc_emptyText' : 'b5b20a9df20ea61c1cc0485f5e83891e' /* Select Project Type */ ,
36   'type_desc_fieldLabel' : '245fe794333c2b0d5c513129b346b93f' /* Project Type */ ,
37   'type_desc_qtip' : 'b5b20a9df20ea61c1cc0485f5e83891e' /* Select Project Type */ ,
38   'client_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
39   'code_fieldLabel' : 'ca0dbad92a874b2f69b549293387925e' /* Code */ ,
40   'open_by_name_qtip' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
41   'name_fieldLabel' : '8e3a42158ee70b67cf55b33e2789a9e5' /* Project Name */ ,
42   'team_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
43   'remarks_fieldLabel' : '231bc72756b5e6de492aaaa1577f61b1' /* Remarks */ ,
44   'open_by_name_emptyText' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
45   'open_by_name_fieldLabel' : '223aad18ce30620a724d8a97021ce26e' /* Open by */ ,
46   'team_id_name_fieldLabel' : 'ac848fa228f49ba2b8a5fbd76596817d' /* Team */ ,
47   'open_date_fieldLabel' : 'ca528d836417871a349312db705a1951' /* Open date */ ,
48   'team_id_name_qtip' : 'ab83ccde6764ca581702f38d79834615' /* Select Team */ ,
49   'team_id_name_emptyText' : 'ab83ccde6764ca581702f38d79834615' /* Select Team */ ,
50   'file_location_fieldLabel' : '24f9e53eb92c0995d04433c1f7a4c9c0' /* File location */ ,
51   'open_by_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
52   'type_desc_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
53   'client_id_name_qtip' : '9675747b5ab12d05f18518761e68a533' /* Select Companies */ 
54  },
55
56  dialog : false,
57  callback:  false,
58
59  show : function(data, cb)
60  {
61   if (!this.dialog) {
62    this.create();
63   }
64
65   this.callback = cb;
66   this.data = data;
67   this.dialog.show(this.data._el);
68   if (this.form) {
69    this.form.reset();
70    this.form.setValues(data);
71    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
72   }
73
74  },
75
76  create : function()
77  {
78    var _this = this;
79    this.dialog = Roo.factory({
80     xtype : 'LayoutDialog',
81     closable : false,
82     collapsible : false,
83     height : 450,
84     resizable : false,
85     title : _this._strings['ddb016a244ff2b895e69d25fb3b5f780'] /* Edit / Create Projects */,
86     width : 470,
87     xns : Roo,
88     '|xns' : 'Roo',
89     center : {
90      xtype : 'LayoutRegion',
91      xns : Roo,
92      '|xns' : 'Roo'
93     },
94     buttons : [
95      {
96       xtype : 'Button',
97       text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
98       listeners : {
99        click : function (_self, e)
100         {
101             _this.dialog.hide();
102         }
103       },
104       xns : Roo,
105       '|xns' : 'Roo'
106      },
107      {
108       xtype : 'Button',
109       text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
110       listeners : {
111        click : function (_self, e)
112         {
113             // do some checks?
114              
115             
116          
117             _this.form.doAction("submit");
118         
119         }
120       },
121       xns : Roo,
122       '|xns' : 'Roo'
123      }
124     ],
125     items  : [
126      {
127       xtype : 'ContentPanel',
128       region : 'center',
129       xns : Roo,
130       '|xns' : 'Roo',
131       items  : [
132        {
133         xtype : 'Form',
134         method : 'POST',
135         style : 'margin:10px;',
136         url : baseURL + '/Roo/Projects.php',
137         listeners : {
138          actioncomplete : function(_self,action)
139           {
140               if (action.type == 'setdata') {
141                  //_this.dialog.el.mask("Loading");
142                  //this.load({ method: 'GET', params: { '_id' : _this.data.id }});
143                  return;
144               }
145               if (action.type == 'load') {
146            
147                   return;
148               }
149               if (action.type =='submit') {
150               
151            
152                   _this.dialog.hide();
153               
154                    if (_this.callback) {
155                       _this.callback.call(_this, _this.form.getValues());
156                    }
157                    _this.form.reset();
158                    return;
159               }
160           },
161          rendered : function (form)
162           {
163               _this.form= form;
164           }
165         },
166         xns : Roo.form,
167         '|xns' : 'Roo.form',
168         items  : [
169          {
170           xtype : 'TextField',
171           fieldLabel : _this._strings['ca0dbad92a874b2f69b549293387925e'] /* Code */,
172           name : 'code',
173           width : 150,
174           xns : Roo.form,
175           '|xns' : 'Roo.form'
176          },
177          {
178           xtype : 'TextField',
179           fieldLabel : _this._strings['8e3a42158ee70b67cf55b33e2789a9e5'] /* Project Name */,
180           name : 'name',
181           qtip : _this._strings['d1847fa47ea6bc047b413947463262ab'] /* Enter Project Name */,
182           width : 300,
183           xns : Roo.form,
184           '|xns' : 'Roo.form'
185          },
186          {
187           xtype : 'ComboBox',
188           allowBlank : false,
189           displayField : 'desc',
190           editable : false,
191           emptyText : _this._strings['b5b20a9df20ea61c1cc0485f5e83891e'] /* Select Project Type */,
192           fieldLabel : _this._strings['245fe794333c2b0d5c513129b346b93f'] /* Project Type */,
193           forceSelection : true,
194           hiddenName : 'type',
195           listWidth : 400,
196           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
197           minChars : 2,
198           name : 'type_desc',
199           pageSize : 20,
200           qtip : _this._strings['b5b20a9df20ea61c1cc0485f5e83891e'] /* Select Project Type */,
201           queryParam : 'query[name]',
202           selectOnFocus : true,
203           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{desc}</b> </div>',
204           triggerAction : 'all',
205           typeAhead : true,
206           valueField : 'code',
207           width : 200,
208           xns : Roo.form,
209           '|xns' : 'Roo.form',
210           store : {
211            xtype : 'SimpleStore',
212            data : [ [  'U' , "Project (Unconfirmed)" ],
213            [  'P' , "Project" ],
214            [  'C' , "Project (Closed)" ],
215            [  'N' , "Non-Project" ],
216            [  'X' , "Non-Project (Closed)" ]
217            ],
218            fields : [ 'code', 'desc' ],
219            xns : Roo.data,
220            '|xns' : 'Roo.data'
221           }
222          },
223          {
224           xtype : 'ComboBox',
225           allowBlank : false,
226           displayField : 'name',
227           editable : false,
228           emptyText : _this._strings['99b344c8ae43e3e7213862b8f35c4e51'] /* Select Company */,
229           fieldLabel : _this._strings['577d7068826de925ea2aec01dbadf5e4'] /* Client */,
230           forceSelection : true,
231           hiddenName : 'client_id',
232           listWidth : 400,
233           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
234           minChars : 2,
235           name : 'client_id_name',
236           pageSize : 20,
237           qtip : _this._strings['9675747b5ab12d05f18518761e68a533'] /* Select Companies */,
238           queryParam : 'query[name]',
239           selectOnFocus : true,
240           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
241           triggerAction : 'all',
242           typeAhead : true,
243           valueField : 'id',
244           width : 300,
245           listeners : {
246            add : function (combo)
247             {
248              Pman.Dialog.Companies.show( {  id: 0 },  function(data) {
249                         _this.form.setValues({ 
250                             client_id : data.id,
251                             client_id_name : data.name
252                         });
253                     }); 
254             }
255           },
256           xns : Roo.form,
257           '|xns' : 'Roo.form',
258           store : {
259            xtype : 'Store',
260            remoteSort : true,
261            sortInfo : { direction : 'ASC', field: 'name' },
262            listeners : {
263             beforeload : function (_self, o){
264                  o.params = o.params || {};
265                 
266                  o.params.type = 1;
267                  o.params['query[group_pulldown]'] = 1;
268              }
269            },
270            xns : Roo.data,
271            '|xns' : 'Roo.data',
272            proxy : {
273             xtype : 'HttpProxy',
274             method : 'GET',
275             url : baseURL + '/Roo/core_company',
276             xns : Roo.data,
277             '|xns' : 'Roo.data'
278            },
279            reader : {
280             xtype : 'JsonReader',
281             fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}],
282             id : 'id',
283             root : 'data',
284             totalProperty : 'total',
285             xns : Roo.data,
286             '|xns' : 'Roo.data'
287            }
288           }
289          },
290          {
291           xtype : 'ComboBox',
292           allowBlank : false,
293           displayField : 'name',
294           editable : false,
295           emptyText : _this._strings['ab83ccde6764ca581702f38d79834615'] /* Select Team */,
296           fieldLabel : _this._strings['ac848fa228f49ba2b8a5fbd76596817d'] /* Team */,
297           forceSelection : true,
298           hiddenName : 'team_id',
299           listWidth : 400,
300           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
301           minChars : 2,
302           name : 'team_id_name',
303           pageSize : 20,
304           qtip : _this._strings['ab83ccde6764ca581702f38d79834615'] /* Select Team */,
305           queryParam : 'query[name]',
306           selectOnFocus : true,
307           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
308           triggerAction : 'all',
309           typeAhead : true,
310           valueField : 'id',
311           width : 300,
312           xns : Roo.form,
313           '|xns' : 'Roo.form',
314           store : {
315            xtype : 'Store',
316            remoteSort : true,
317            sortInfo : { direction : 'ASC', field: 'id' },
318            listeners : {
319             beforeload : function (_self, o){
320                  o.params = o.params || {};
321                  // set more here
322              }
323            },
324            xns : Roo.data,
325            '|xns' : 'Roo.data',
326            proxy : {
327             xtype : 'HttpProxy',
328             method : 'GET',
329             url : baseURL + '/Roo/Groups.php',
330             xns : Roo.data,
331             '|xns' : 'Roo.data'
332            },
333            reader : {
334             xtype : 'JsonReader',
335             fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
336             id : 'id',
337             root : 'data',
338             totalProperty : 'total',
339             xns : Roo.data,
340             '|xns' : 'Roo.data'
341            }
342           }
343          },
344          {
345           xtype : 'TextField',
346           fieldLabel : _this._strings['24f9e53eb92c0995d04433c1f7a4c9c0'] /* File location */,
347           name : 'file_location',
348           width : 300,
349           xns : Roo.form,
350           '|xns' : 'Roo.form'
351          },
352          {
353           xtype : 'TextArea',
354           fieldLabel : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
355           height : 100,
356           name : 'remarks',
357           width : 300,
358           xns : Roo.form,
359           '|xns' : 'Roo.form'
360          },
361          {
362           xtype : 'FieldSet',
363           legend : _this._strings['1a11b1adc359c03db0ca798a00e2632c'] /* Opened */,
364           xns : Roo.form,
365           '|xns' : 'Roo.form',
366           items  : [
367            {
368             xtype : 'DateField',
369             altFormats : 'Y-m-d|d/m/Y',
370             fieldLabel : _this._strings['ca528d836417871a349312db705a1951'] /* Open date */,
371             format : 'd/m/Y',
372             name : 'open_date',
373             width : 100,
374             xns : Roo.form,
375             '|xns' : 'Roo.form'
376            },
377            {
378             xtype : 'ComboBox',
379             allowBlank : false,
380             displayField : 'name',
381             editable : false,
382             emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
383             fieldLabel : _this._strings['223aad18ce30620a724d8a97021ce26e'] /* Open by */,
384             forceSelection : true,
385             hiddenName : 'open_by',
386             listWidth : 400,
387             loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
388             minChars : 2,
389             name : 'open_by_name',
390             pageSize : 20,
391             qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
392             queryParam : 'query[name]',
393             selectOnFocus : true,
394             tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
395             triggerAction : 'all',
396             typeAhead : true,
397             valueField : 'id',
398             width : 300,
399             xns : Roo.form,
400             '|xns' : 'Roo.form',
401             store : {
402              xtype : 'Store',
403              remoteSort : true,
404              sortInfo : { direction : 'ASC', field: 'id' },
405              listeners : {
406               beforeload : function (_self, o){
407                    o.params = o.params || {};
408                    // set more here
409                }
410              },
411              xns : Roo.data,
412              '|xns' : 'Roo.data',
413              proxy : {
414               xtype : 'HttpProxy',
415               method : 'GET',
416               url : baseURL + '/Roo/core_person',
417               xns : Roo.data,
418               '|xns' : 'Roo.data'
419              },
420              reader : {
421               xtype : 'JsonReader',
422               fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
423               id : 'id',
424               root : 'data',
425               totalProperty : 'total',
426               xns : Roo.data,
427               '|xns' : 'Roo.data'
428              }
429             }
430            }
431           ]
432          },
433          {
434           xtype : 'Hidden',
435           name : 'id',
436           xns : Roo.form,
437           '|xns' : 'Roo.form'
438          }
439         ]
440        }
441       ]
442      }
443     ]
444    });
445  }
446 };