php warnings
[Pman.MTrack] / Pman.Tab.MtrackCal.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.MtrackCal = new Roo.XComponent({
8
9  _strings : {
10   '1243daf593fa297e07ab03bf06d925af' :"Searching...",
11   '340c2ee497b85d5954b01c64de7f44f6' :"Select Person ",
12   '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' :"Person ",
13   '25f7347236b51a5eae4ba01a7862cb55' :"Schedule"
14  },
15
16   part     :  ["MTrack", "MtrackCal" ],
17   order    : '100-Pman.Tab.MtrackCal',
18   region   : 'center',
19   parent   : 'Pman.Tab.DocumentsTab',
20   name     : "Pman.Tab.MtrackCal",
21   disabled : false, 
22   permname : '', 
23   _tree : function()
24   {
25    var _this = this;
26    var MODULE = this;
27    return {
28    region : 'center',
29    title : _this._strings['25f7347236b51a5eae4ba01a7862cb55'] /* Schedule */,
30    xns : Roo,
31    '|xns' : 'Roo',
32    xtype : 'GridPanel',
33    listeners : {
34     activate : function (_self)
35      {
36          if (!_this.cal) {
37              return;
38          }
39          _this.cal.setDate(new Date());
40      }
41    },
42    grid : {
43     xns : Roo.grid,
44     '|xns' : 'Roo.grid',
45     xtype : 'Calendar',
46     listeners : {
47      eventclick : function (_self, Ev,r )
48       {
49           // show the dialog..
50           // reload the calendar on exit.
51           Roo.log(Ev);
52           Roo.log(r);
53             Pman.Dialog.MTrackTicket.show({ id : r.data.id } , function(res) {
54               // update the record..
55               // redra
56               Roo.log("ticket updated");
57               // start / end times? - not sent through, so it should not update..
58               for(k in res) {
59                   r.data[k] = res[k];
60               }
61               
62               _this.cal.renderEvents();
63               
64           
65           });
66       },
67      eventrender : function (_self, rec)
68       {
69           
70           rec.data.time = ''; // not needed
71           rec.data.title = rec.data.developer_id_name + ' ' + rec.data.project_id_name;
72           rec.data.qtip  = '#' + rec.data.id + ' ' + rec.data.summary;
73           
74           if (!rec.data.estimated) {
75               rec.data.cls = "Greys-q3-6 fc-black-text  "; // grey...
76           } else {
77               rec.data.cls = 'fc-black-text RdYlGn-q' + rec.data.priority_id_seqid +'-7'
78           }
79           
80                           
81       },
82      render : function (grid)
83       {
84           
85           _this.cal = grid;
86       }
87     },
88     eventStore : {
89      xns : Roo.data,
90      '|xns' : 'Roo.data',
91      xtype : 'Store',
92      listeners : {
93       beforeload : function (_self, o)
94        {
95            if (!_this.personSel) {
96                return false;
97            }
98        
99           o = o || {};
100            o.params = o.params || {};
101            o.params._future_schedule = 1;
102            o.params['query[viewtype]']= 'active';
103            o.params.limit= 999;
104            o.params.sort = 'summary';
105            o.params.dir = 'ASC';
106            var pid = _this.personSel.getValue();
107            if (pid*1) {
108                o.params['filter[developer_id]'] = pid;
109            }
110           try { 
111                 o.params['filter[project_id]']   = Pman.Tab.DocumentsTab.panel.getProjectId();
112            } catch(e) {
113               
114            }
115            _this.cal.setDate(new Date());
116            
117        }
118      },
119      proxy : {
120       method : 'GET',
121       url : baseURL + '/Roo/mtrack_ticket',
122       xns : Roo.data,
123       '|xns' : 'Roo.data',
124       xtype : 'HttpProxy'
125      },
126      reader : {
127       id : 'id',
128       root : 'data',
129       totalProperty : 'total',
130       xns : Roo.data,
131       '|xns' : 'Roo.data',
132       xtype : 'JsonReader'
133      }
134     },
135     toolbar : {
136      xns : Roo,
137      '|xns' : 'Roo',
138      xtype : 'Toolbar',
139      items  : [
140       {
141        allowBlank : true,
142        displayField : 'name',
143        editable : true,
144        emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person  */,
145        fieldLabel : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person  */,
146        forceSelection : true,
147        listWidth : 600,
148        loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
149        minChars : 2,
150        name : 'person_id_name',
151        pageSize : 20,
152        qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person  */,
153        queryParam : 'query[name]',
154        selectOnFocus : true,
155        tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) &lt;{email}&gt; </div>',
156        triggerAction : 'all',
157        typeAhead : true,
158        valueField : 'id',
159        width : 150,
160        xns : Roo.form,
161        '|xns' : 'Roo.form',
162        xtype : 'ComboBox',
163        listeners : {
164         render : function (_self)
165          {
166            _this.personSel = _self;
167          },
168         select : function (combo, record, index)
169          {
170            _this.cal.load();
171            
172          }
173        },
174        store : {
175         sortInfo : { field : 'name' , direction : 'ASC' },
176         xns : Roo.data,
177         '|xns' : 'Roo.data',
178         xtype : 'Store',
179         listeners : {
180          beforeload : function (_self, o)
181           {
182               o.params = o.params || {};
183               o.company_id = Pman.Login.authUser.company_id;
184               o.params['query[role]'] = 'DEVELOPER';
185           }
186         },
187         proxy : {
188          method : 'GET',
189          url : baseURL + '/Roo/Person.php',
190          xns : Roo.data,
191          '|xns' : 'Roo.data',
192          xtype : 'HttpProxy'
193         },
194         reader : {
195          fields : [
196              {
197                  'name': 'id',
198                  'type': 'int'
199              },
200              {
201                  'name': 'office_id',
202                  'type': 'int'
203              },
204              {
205                  'name': 'name',
206                  'type': 'string'
207              },
208              {
209                  'name': 'phone',
210                  'type': 'string'
211              },
212              {
213                  'name': 'fax',
214                  'type': 'string'
215              },
216              {
217                  'name': 'email',
218                  'type': 'string'
219              },
220              {
221                  'name': 'company_id',
222                  'type': 'int'
223              },
224              {
225                  'name': 'role',
226                  'type': 'string'
227              },
228              {
229                  'name': 'active',
230                  'type': 'int'
231              },
232              {
233                  'name': 'remarks',
234                  'type': 'string'
235              },
236              {
237                  'name': 'passwd',
238                  'type': 'string'
239              },
240              {
241                  'name': 'owner_id',
242                  'type': 'int'
243              },
244              {
245                  'name': 'lang',
246                  'type': 'string'
247              },
248              {
249                  'name': 'no_reset_sent',
250                  'type': 'int'
251              },
252              {
253                  'name': 'action_type',
254                  'type': 'string'
255              },
256              {
257                  'name': 'project_id',
258                  'type': 'int'
259              },
260              {
261                  'name': 'deleted_by',
262                  'type': 'int'
263              },
264              {
265                  'name': 'deleted_dt',
266                  'type': 'date',
267                  'dateFormat': 'Y-m-d'
268              },
269              {
270                  'name': 'office_id_id',
271                  'type': 'int'
272              },
273              {
274                  'name': 'office_id_company_id',
275                  'type': 'int'
276              },
277              {
278                  'name': 'office_id_name',
279                  'type': 'string'
280              },
281              {
282                  'name': 'office_id_address',
283                  'type': 'string'
284              },
285              {
286                  'name': 'office_id_phone',
287                  'type': 'string'
288              },
289              {
290                  'name': 'office_id_fax',
291                  'type': 'string'
292              },
293              {
294                  'name': 'office_id_email',
295                  'type': 'string'
296              },
297              {
298                  'name': 'office_id_role',
299                  'type': 'string'
300              },
301              {
302                  'name': 'company_id_code',
303                  'type': 'string'
304              },
305              {
306                  'name': 'company_id_name',
307                  'type': 'string'
308              },
309              {
310                  'name': 'company_id_remarks',
311                  'type': 'string'
312              },
313              {
314                  'name': 'company_id_owner_id',
315                  'type': 'int'
316              },
317              {
318                  'name': 'company_id_address',
319                  'type': 'string'
320              },
321              {
322                  'name': 'company_id_tel',
323                  'type': 'string'
324              },
325              {
326                  'name': 'company_id_fax',
327                  'type': 'string'
328              },
329              {
330                  'name': 'company_id_email',
331                  'type': 'string'
332              },
333              {
334                  'name': 'company_id_id',
335                  'type': 'int'
336              },
337              {
338                  'name': 'company_id_isOwner',
339                  'type': 'int'
340              },
341              {
342                  'name': 'company_id_logo_id',
343                  'type': 'int'
344              },
345              {
346                  'name': 'company_id_background_color',
347                  'type': 'string'
348              },
349              {
350                  'name': 'company_id_comptype',
351                  'type': 'string'
352              },
353              {
354                  'name': 'company_id_url',
355                  'type': 'string'
356              },
357              {
358                  'name': 'company_id_main_office_id',
359                  'type': 'int'
360              },
361              {
362                  'name': 'company_id_created_by',
363                  'type': 'int'
364              },
365              {
366                  'name': 'company_id_created_dt',
367                  'type': 'date'
368              },
369              {
370                  'name': 'company_id_updated_by',
371                  'type': 'int'
372              },
373              {
374                  'name': 'company_id_updated_dt',
375                  'type': 'date'
376              },
377              {
378                  'name': 'company_id_passwd',
379                  'type': 'string'
380              },
381              {
382                  'name': 'company_id_dispatch_port',
383                  'type': 'string'
384              },
385              {
386                  'name': 'company_id_province',
387                  'type': 'string'
388              },
389              {
390                  'name': 'company_id_country',
391                  'type': 'string'
392              },
393              {
394                  'name': 'project_id_id',
395                  'type': 'int'
396              },
397              {
398                  'name': 'project_id_name',
399                  'type': 'string'
400              },
401              {
402                  'name': 'project_id_remarks',
403                  'type': 'string'
404              },
405              {
406                  'name': 'project_id_owner_id',
407                  'type': 'int'
408              },
409              {
410                  'name': 'project_id_code',
411                  'type': 'string'
412              },
413              {
414                  'name': 'project_id_active',
415                  'type': 'int'
416              },
417              {
418                  'name': 'project_id_type',
419                  'type': 'string'
420              },
421              {
422                  'name': 'project_id_client_id',
423                  'type': 'int'
424              },
425              {
426                  'name': 'project_id_team_id',
427                  'type': 'int'
428              },
429              {
430                  'name': 'project_id_file_location',
431                  'type': 'string'
432              },
433              {
434                  'name': 'project_id_open_date',
435                  'type': 'date'
436              },
437              {
438                  'name': 'project_id_open_by',
439                  'type': 'int'
440              },
441              {
442                  'name': 'project_id_close_date',
443                  'type': 'date'
444              },
445              {
446                  'name': 'project_id_countries',
447                  'type': 'string'
448              },
449              {
450                  'name': 'project_id_languages',
451                  'type': 'string'
452              },
453              {
454                  'name': 'project_id_agency_id',
455                  'type': 'int'
456              },
457              {
458                  'name': 'owner_id_id',
459                  'type': 'int'
460              },
461              {
462                  'name': 'owner_id_office_id',
463                  'type': 'int'
464              },
465              {
466                  'name': 'owner_id_name',
467                  'type': 'string'
468              },
469              {
470                  'name': 'owner_id_phone',
471                  'type': 'string'
472              },
473              {
474                  'name': 'owner_id_fax',
475                  'type': 'string'
476              },
477              {
478                  'name': 'owner_id_email',
479                  'type': 'string'
480              },
481              {
482                  'name': 'owner_id_company_id',
483                  'type': 'int'
484              },
485              {
486                  'name': 'owner_id_role',
487                  'type': 'string'
488              },
489              {
490                  'name': 'owner_id_active',
491                  'type': 'int'
492              },
493              {
494                  'name': 'owner_id_remarks',
495                  'type': 'string'
496              },
497              {
498                  'name': 'owner_id_passwd',
499                  'type': 'string'
500              },
501              {
502                  'name': 'owner_id_owner_id',
503                  'type': 'int'
504              },
505              {
506                  'name': 'owner_id_lang',
507                  'type': 'string'
508              },
509              {
510                  'name': 'owner_id_no_reset_sent',
511                  'type': 'int'
512              },
513              {
514                  'name': 'owner_id_action_type',
515                  'type': 'string'
516              },
517              {
518                  'name': 'owner_id_project_id',
519                  'type': 'int'
520              },
521              {
522                  'name': 'owner_id_deleted_by',
523                  'type': 'int'
524              },
525              {
526                  'name': 'owner_id_deleted_dt',
527                  'type': 'date'
528              }
529          ],
530          id : 'id',
531          root : 'data',
532          totalProperty : 'total',
533          xns : Roo.data,
534          '|xns' : 'Roo.data',
535          xtype : 'JsonReader'
536         }
537        }
538       },
539       {
540        cls : 'x-btn-icon',
541        icon : rootURL + '/Pman/templates/images/search.gif',
542        xns : Roo.Toolbar,
543        '|xns' : 'Roo.Toolbar',
544        xtype : 'Button',
545        listeners : {
546         click : function (_self, e)
547          {
548              _this.cal.load();
549          }
550        }
551       }
552      ]
553     }
554    }
555   };  }
556 });