php warnings
[Pman.MTrack] / Pman.Tab.MTrackMilestone.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.Tab');
6
7 Pman.Tab.MTrackMilestone = new Roo.XComponent({
8
9  _strings : {
10   'fa444e1c75f40633fccded45b0870206' :"No mtrack_milestone found",
11   '54e1d44609e3abed11f6e1eb6ae54988' :"Projects",
12   'b8cb81ab43044c454c1e69dbba646b68' :"On-hold",
13   'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
14   '9e727fdd3aec8274f46685441900280d' :"Project",
15   '7dce122004969d56ae2e0245cb754d35' :"Edit",
16   'd5e96f1a04f3dd132b193765eee39b9e' :"Duedate",
17   'c6030af9c753c4081d7ba01420cd0922' :"Displaying mtrack_milestone{0} - {1} of {2}",
18   '1243daf593fa297e07ab03bf06d925af' :"Searching...",
19   'df25de42c84837baf5fa15049a8bc764' :"View:",
20   '5288ef9e03a2b0686856a301272e8e56' :"#Tickets",
21   '24f27bda5dd2c488aa9bc7700ba98c34' :"Select Projects",
22   '0460245609b5dc1fc4e3c72a84f95bb7' :"Startdate",
23   '780c165edced420f2207a4d5983e4bd0' :"Merge With another Milestone",
24   '07ca5050e697392c9ed47e6453f1453f' :"Completed",
25   '4ab658036f4f174205c384b863fed5c2' :"Milestones",
26   'e15e216fc1c639f787b1231ecdfa1bf8' :"HEAD",
27   'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
28   '49ee3087348e8d44e1feda1917443987' :"Name",
29   'b5a7adde1af5c87d7fd797b6245c2a39' :"Description",
30   'db478325306f02298b2980f40223a413' :"#ref"
31  },
32  _named_strings : {
33   'project_id_name_emptyText' : '24f27bda5dd2c488aa9bc7700ba98c34' /* Select Projects */ ,
34   'project_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
35   'project_id_name_qtip' : '24f27bda5dd2c488aa9bc7700ba98c34' /* Select Projects */ ,
36   'project_id_name_fieldLabel' : '54e1d44609e3abed11f6e1eb6ae54988' /* Projects */ 
37  },
38
39   part     :  ["MTrack", "Milestone" ],
40   order    : '200-Pman.Tab.MTrackMilestone',
41   region   : 'center',
42   parent   : 'Pman.Tab.MTrack',
43   name     : "Pman.Tab.MTrackMilestone",
44   disabled : false, 
45   permname : '', 
46   _tree : function(_data)
47   {
48    var _this = this;
49    var MODULE = this;
50    return {
51    xtype : 'GridPanel',
52    background : true,
53    fitContainer : true,
54    fitToframe : true,
55    region : 'center',
56    tableName : 'mtrack_milestone',
57    title : _this._strings['4ab658036f4f174205c384b863fed5c2'] /* Milestones */,
58    listeners : {
59     activate : function() {
60          _this.panel = this;
61          if (_this.grid) {
62              _this.grid.footer.onClick('first');
63          }
64      }
65    },
66    xns : Roo,
67    '|xns' : 'Roo',
68    grid : {
69     xtype : 'Grid',
70     autoExpandColumn : 'description',
71     loadMask : true,
72     listeners : {
73      render : function() 
74       {
75           _this.grid = this; 
76            _this.dialog = Pman.Dialog.MTrackMilestone;
77           if (_this.panel.active) {
78              this.footer.onClick('first');
79           }
80       },
81      rowdblclick : function (_self, rowIndex, e)
82       {
83           if (!_this.dialog) { return; }
84           _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
85               _this.grid.footer.onClick('first');
86           }); 
87       }
88     },
89     xns : Roo.grid,
90     '|xns' : 'Roo.grid',
91     footer : {
92      xtype : 'PagingToolbar',
93      displayInfo : true,
94      displayMsg : _this._strings['c6030af9c753c4081d7ba01420cd0922'] /* Displaying mtrack_milestone{0} - {1} of {2} */,
95      emptyMsg : _this._strings['fa444e1c75f40633fccded45b0870206'] /* No mtrack_milestone found */,
96      pageSize : 100,
97      xns : Roo,
98      '|xns' : 'Roo'
99     },
100     toolbar : {
101      xtype : 'Toolbar',
102      xns : Roo,
103      '|xns' : 'Roo',
104      items  : [
105       {
106        xtype : 'TextItem',
107        text : _this._strings['df25de42c84837baf5fa15049a8bc764'] /* View: */,
108        xns : Roo.Toolbar,
109        '|xns' : 'Roo.Toolbar'
110       },
111       {
112        xtype : 'ComboBox',
113        allowBlank : false,
114        displayField : 'val',
115        editable : false,
116        forceSelection : true,
117        hiddenName : 'currency',
118        listWidth : 200,
119        triggerAction : 'all',
120        value : _this._strings['e15e216fc1c639f787b1231ecdfa1bf8'] /* HEAD */,
121        valueField : 'key',
122        width : 150,
123        listeners : {
124         beforeselect : function (combo, record, index)
125          {
126            (function() { _this.grid.footer.onClick('first'); }).defer(100);
127          },
128         render : function (_self)
129          {
130             _this.viewType = this;
131          }
132        },
133        xns : Roo.form,
134        '|xns' : 'Roo.form',
135        store : {
136         xtype : 'SimpleStore',
137         data : [ 
138           [ 'HEAD', 'Head Milestones' ],
139           [ 'ACTIVE', 'Active Milestones' ],
140           [ 'ALL', 'All Milestones' ]
141           ],
142         fields : [ 'key' , 'val' ],
143         xns : Roo.data,
144         '|xns' : 'Roo.data'
145        }
146       },
147       {
148        xtype : 'ComboBox',
149        allowBlank : false,
150        displayField : 'name',
151        editable : false,
152        emptyText : _this._strings['24f27bda5dd2c488aa9bc7700ba98c34'] /* Select Projects */,
153        fieldLabel : _this._strings['54e1d44609e3abed11f6e1eb6ae54988'] /* Projects */,
154        forceSelection : true,
155        hiddenName : 'project_id',
156        listWidth : 400,
157        loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
158        minChars : 2,
159        name : 'project_id_name',
160        pageSize : 50,
161        qtip : _this._strings['24f27bda5dd2c488aa9bc7700ba98c34'] /* Select Projects */,
162        queryParam : '',
163        selectOnFocus : true,
164        tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{code}</b> {name}</div>',
165        triggerAction : 'all',
166        typeAhead : true,
167        valueField : 'id',
168        width : 200,
169        listeners : {
170         beforeselect : function (combo, record, index)
171          {
172            (function() { _this.grid.footer.onClick('first')}).defer(100);
173          },
174         render : function (_self)
175          {
176             _this.projsel = _self;
177          }
178        },
179        xns : Roo.form,
180        '|xns' : 'Roo.form',
181        store : {
182         xtype : 'Store',
183         remoteSort : true,
184         sortInfo : { direction : 'ASC', field: 'code' },
185         listeners : {
186          beforeload : function (_self, o){
187               o.params = o.params || {};
188               // set more here
189           }
190         },
191         xns : Roo.data,
192         '|xns' : 'Roo.data',
193         proxy : {
194          xtype : 'HttpProxy',
195          method : 'GET',
196          url : baseURL + '/Roo/Projects.php',
197          xns : Roo.data,
198          '|xns' : 'Roo.data'
199         },
200         reader : {
201          xtype : 'JsonReader',
202          fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
203          id : 'id',
204          root : 'data',
205          totalProperty : 'total',
206          xns : Roo.data,
207          '|xns' : 'Roo.data'
208         }
209        }
210       },
211       {
212        xtype : 'Fill',
213        xns : Roo.Toolbar,
214        '|xns' : 'Roo.Toolbar'
215       },
216       {
217        xtype : 'Button',
218        cls : 'x-btn-text-icon',
219        icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
220        text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
221        listeners : {
222         click : function()
223          {
224          if (!_this.dialog) { return; }
225              _this.dialog.show( { id : 0 } , function() {
226                  _this.grid.footer.onClick('first');
227             }); 
228          }
229        },
230        xns : Roo.Toolbar,
231        '|xns' : 'Roo.Toolbar'
232       },
233       {
234        xtype : 'Button',
235        cls : 'x-btn-text-icon',
236        icon : Roo.rootURL + 'images/default/tree/leaf.gif',
237        text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
238        listeners : {
239         click : function()
240          {
241              var s = _this.grid.getSelectionModel().getSelections();
242              if (!s.length || (s.length > 1))  {
243                  Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
244                  return;
245              }
246              if (!_this.dialog) { return; }
247              _this.dialog.show(s[0].data, function() {
248                  _this.grid.footer.onClick('first');
249              }); 
250              
251          }
252        },
253        xns : Roo.Toolbar,
254        '|xns' : 'Roo.Toolbar'
255       },
256       {
257        xtype : 'Button',
258        cls : 'x-btn-text-icon',
259        icon : Roo.rootURL + 'images/default/tree/leaf.gif',
260        text : _this._strings['780c165edced420f2207a4d5983e4bd0'] /* Merge With another Milestone */,
261        listeners : {
262         click : function()
263          {
264              var s = _this.grid.getSelectionModel().getSelections();
265              if (!s.length || (s.length > 1))  {
266                  Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
267                  return;
268              }
269                
270              Pman.Dialog.MTrackMilestoneMerge.show(s[0].data, function() {
271                  Pman.genericDelete(_this, 'mtrack_milestone'); 
272              }); 
273              
274          }
275        },
276        xns : Roo.Toolbar,
277        '|xns' : 'Roo.Toolbar'
278       },
279       {
280        xtype : 'Button',
281        cls : 'x-btn-text-icon',
282        icon : rootURL + '/Pman/templates/images/trash.gif',
283        text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
284        listeners : {
285         click : function()
286                  {
287                  Pman.genericDelete(_this, 'mtrack_milestone'); 
288                  }
289        },
290        xns : Roo.Toolbar,
291        '|xns' : 'Roo.Toolbar'
292       }
293      ]
294     },
295     dataSource : {
296      xtype : 'Store',
297      remoteSort : true,
298      sortInfo : { field : 'duedate', direction: 'ASC' },
299      listeners : {
300       beforeload : function (_self, options)
301        {
302            options.params._with_active_tickets = 1;
303            if (!_this.viewType) {
304                return false;
305            }
306            options.params._viewtype = _this.viewType.getValue();
307            
308            if (_this.projsel.getValue()) {
309                 options.params.project_id = _this.projsel.getValue();
310            }
311            
312            
313        }
314      },
315      xns : Roo.data,
316      '|xns' : 'Roo.data',
317      proxy : {
318       xtype : 'HttpProxy',
319       method : 'GET',
320       url : baseURL + '/Roo/mtrack_milestone.php',
321       xns : Roo.data,
322       '|xns' : 'Roo.data'
323      },
324      reader : {
325       xtype : 'JsonReader',
326       fields : [
327           {
328               'name': 'id',
329               'type': 'int'
330           },
331           {
332               'name': 'name',
333               'type': 'string'
334           },
335           {
336               'name': 'description',
337               'type': 'string'
338           },
339           {
340               'name': 'startdate',
341               'type': 'date',
342               'dateFormat': 'Y-m-d'
343           },
344           {
345               'name': 'duedate',
346               'type': 'date',
347               'dateFormat': 'Y-m-d'
348           },
349           {
350               'name': 'completed',
351               'type': 'date',
352               'dateFormat': 'Y-m-d'
353           },
354           {
355               'name': 'deleted',
356               'type': 'int'
357           },
358           {
359               'name': 'created',
360               'type': 'int'
361           },
362           {
363               'name': 'updated',
364               'type': 'int'
365           },
366           {
367               'name': 'project_id',
368               'type': 'int'
369           },
370           {
371               'name': 'deleted_id',
372               'type': 'int'
373           },
374           {
375               'name': 'deleted_person_id',
376               'type': 'int'
377           },
378           {
379               'name': 'deleted_ontable',
380               'type': 'string'
381           },
382           {
383               'name': 'deleted_onid',
384               'type': 'int'
385           },
386           {
387               'name': 'deleted_changedate',
388               'type': 'date'
389           },
390           {
391               'name': 'deleted_reason',
392               'type': 'string'
393           },
394           {
395               'name': 'updated_id',
396               'type': 'int'
397           },
398           {
399               'name': 'updated_person_id',
400               'type': 'int'
401           },
402           {
403               'name': 'updated_ontable',
404               'type': 'string'
405           },
406           {
407               'name': 'updated_onid',
408               'type': 'int'
409           },
410           {
411               'name': 'updated_changedate',
412               'type': 'date'
413           },
414           {
415               'name': 'updated_reason',
416               'type': 'string'
417           },
418           {
419               'name': 'created_id',
420               'type': 'int'
421           },
422           {
423               'name': 'created_person_id',
424               'type': 'int'
425           },
426           {
427               'name': 'created_ontable',
428               'type': 'string'
429           },
430           {
431               'name': 'created_onid',
432               'type': 'int'
433           },
434           {
435               'name': 'created_changedate',
436               'type': 'date'
437           },
438           {
439               'name': 'created_reason',
440               'type': 'string'
441           }
442       ],
443       id : 'id',
444       root : 'data',
445       totalProperty : 'total',
446       xns : Roo.data,
447       '|xns' : 'Roo.data'
448      }
449     },
450     colModel : [
451      {
452       xtype : 'ColumnModel',
453       dataIndex : 'id',
454       header : _this._strings['db478325306f02298b2980f40223a413'] /* #ref */,
455       renderer : function(v) { return String.format('{0}', v); },
456       width : 50,
457       xns : Roo.grid,
458       '|xns' : 'Roo.grid'
459      },
460      {
461       xtype : 'ColumnModel',
462       dataIndex : 'project_id_name',
463       header : _this._strings['9e727fdd3aec8274f46685441900280d'] /* Project */,
464       renderer : function(v) { return String.format('{0}', v); },
465       sortable : true,
466       width : 150,
467       xns : Roo.grid,
468       '|xns' : 'Roo.grid'
469      },
470      {
471       xtype : 'ColumnModel',
472       dataIndex : 'active_tickets',
473       header : _this._strings['5288ef9e03a2b0686856a301272e8e56'] /* #Tickets */,
474       renderer : function(v) { return String.format('{0}', v); },
475       width : 50,
476       xns : Roo.grid,
477       '|xns' : 'Roo.grid'
478      },
479      {
480       xtype : 'ColumnModel',
481       dataIndex : 'name',
482       header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
483       renderer : function(v) { return String.format('{0}', v); },
484       width : 200,
485       xns : Roo.grid,
486       '|xns' : 'Roo.grid'
487      },
488      {
489       xtype : 'ColumnModel',
490       dataIndex : 'description',
491       header : _this._strings['b5a7adde1af5c87d7fd797b6245c2a39'] /* Description */,
492       renderer : function(v) { return String.format('{0}', v); },
493       width : 200,
494       xns : Roo.grid,
495       '|xns' : 'Roo.grid'
496      },
497      {
498       xtype : 'ColumnModel',
499       dataIndex : 'startdate',
500       header : _this._strings['0460245609b5dc1fc4e3c72a84f95bb7'] /* Startdate */,
501       renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
502       sortable : true,
503       width : 75,
504       xns : Roo.grid,
505       '|xns' : 'Roo.grid'
506      },
507      {
508       xtype : 'ColumnModel',
509       dataIndex : 'duedate',
510       header : _this._strings['d5e96f1a04f3dd132b193765eee39b9e'] /* Duedate */,
511       renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
512       width : 75,
513       xns : Roo.grid,
514       '|xns' : 'Roo.grid'
515      },
516      {
517       xtype : 'ColumnModel',
518       dataIndex : 'on_hold',
519       header : _this._strings['b8cb81ab43044c454c1e69dbba646b68'] /* On-hold */,
520       renderer : function(v) { return String.format('{0}', v ? 'HOLD' : '' ); },
521       width : 75,
522       xns : Roo.grid,
523       '|xns' : 'Roo.grid'
524      },
525      {
526       xtype : 'ColumnModel',
527       dataIndex : 'completed',
528       header : _this._strings['07ca5050e697392c9ed47e6453f1453f'] /* Completed */,
529       renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
530       width : 75,
531       xns : Roo.grid,
532       '|xns' : 'Roo.grid'
533      }
534     ]
535    }
536   };  }
537 });