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