Pman.Tab.AdminProjectManager.bjs
[Pman.Admin] / Pman.Tab.AdminProjectManager.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.AdminProjectManager = new Roo.XComponent({
8
9  _strings : {
10   '54e1d44609e3abed11f6e1eb6ae54988' :"Projects",
11   '8115b8afd5b2953d9fa63eb0db9559fc' :"No Projects found",
12   'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
13   '13348442cc6a27032d2b4aa28b75a5d3' :"Search",
14   '7dce122004969d56ae2e0245cb754d35' :"Edit",
15   '577d7068826de925ea2aec01dbadf5e4' :"Client",
16   '917d465e9a9e8b16a8da50a1ca8156ca' :"Show:",
17   '0f111c111475c934057e6f8bb8314d56' :"Non-Projects",
18   '03f4a47830f97377a35321051685071e' :"Closed",
19   'f45e7cfb0824b6d381ade7d81bb81615' :"Displaying Projects {0} - {1} of {2}",
20   'b1c94ca2fbc3e78fc30069c8d0f01680' :"All",
21   'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
22   'ca0dbad92a874b2f69b549293387925e' :"Code",
23   '49ee3087348e8d44e1feda1917443987' :"Name",
24   '93573647a6041adaabd942e88cc29e23' :"Projects / Members"
25  },
26
27   part     :  ["Admin", "ProjectManager" ],
28   order    : '002-Pman.Tab.AdminProjectManager',
29   region   : 'center',
30   parent   : 'Pman.Tab.Admin',
31   name     : "Pman.Tab.AdminProjectManager",
32   disabled : false, 
33   permname : 'Core.Projects_All', 
34   _tree : function()
35   {
36    var _this = this;
37    var MODULE = this;
38    return {
39    fitContainer : true,
40    fitToFrame : true,
41    region : 'center',
42    title : _this._strings['93573647a6041adaabd942e88cc29e23'] /* Projects / Members */,
43    xns : Roo,
44    '|xns' : 'Roo',
45    xtype : 'NestedLayoutPanel',
46    layout : {
47     xns : Roo,
48     '|xns' : 'Roo',
49     xtype : 'BorderLayout',
50     center : {
51      xns : Roo,
52      '|xns' : 'Roo',
53      xtype : 'LayoutRegion'
54     },
55     east : {
56      split : true,
57      width : 300,
58      xns : Roo,
59      '|xns' : 'Roo',
60      xtype : 'LayoutRegion'
61     },
62     items  : [
63      {
64       background : true,
65       fitContainer : true,
66       fitToframe : true,
67       region : 'center',
68       tableName : 'Projects',
69       title : _this._strings['54e1d44609e3abed11f6e1eb6ae54988'] /* Projects */,
70       xns : Roo,
71       '|xns' : 'Roo',
72       xtype : 'GridPanel',
73       listeners : {
74        activate : function() {
75             _this.panel = this;
76             try {
77                 _this.dialog =  Pman.Dialog.CoreProject ; 
78             } catch(e) {}
79             if (_this.grid) {
80                 _this.grid.footer.onClick('first');
81             }
82         }
83       },
84       grid : {
85        autoExpandColumn : 'name',
86        filter : 'P,U',
87        getTypes : function() {
88            return [
89                [  'U' , "Project (Unconfirmed)" ],
90                [  'P' , "Project" ],
91                [  'C' , "Project (Closed)" ],
92                [  'N' , "Non-Project" ],
93                [  'X' , "Non-Project (Closed)" ]
94        
95            ];
96        },
97        loadMask : true,
98        typeToString : function(v)
99        {
100            var ar = this.getTypes();
101            var ret = '';
102            Roo.each(ar, function(a) {
103                if (a[0] == v) {
104                    ret = a[1];
105                    return false;
106                }
107            });
108            return ret;
109        },
110        xns : Roo.grid,
111        '|xns' : 'Roo.grid',
112        xtype : 'Grid',
113        listeners : {
114         render : function() 
115          {
116              _this.grid = this; 
117              //_this.dialog = Pman.Dialog.FILL_IN
118              if (_this.panel.active) {
119                 this.footer.onClick('first');
120              }
121          },
122         rowdblclick : function (_self, rowIndex, e)
123          {
124              if (!_this.dialog) {
125                   return;
126               }
127              _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
128                  _this.grid.footer.onClick('first');
129              }); 
130          }
131        },
132        footer : {
133         displayInfo : true,
134         displayMsg : _this._strings['f45e7cfb0824b6d381ade7d81bb81615'] /* Displaying Projects {0} - {1} of {2} */,
135         emptyMsg : _this._strings['8115b8afd5b2953d9fa63eb0db9559fc'] /* No Projects found */,
136         pageSize : 25,
137         xns : Roo,
138         '|xns' : 'Roo',
139         xtype : 'PagingToolbar'
140        },
141        toolbar : {
142         xns : Roo,
143         '|xns' : 'Roo',
144         xtype : 'Toolbar',
145         items  : [
146          {
147           cls : 'x-btn-text-icon',
148           icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
149           text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
150           xns : Roo.Toolbar,
151           '|xns' : 'Roo.Toolbar',
152           xtype : 'Button',
153           listeners : {
154            click : function()
155             {
156                 if (!_this.dialog) {
157                     return;
158                 }
159                 _this.dialog.show( { id : 0 } , function() {
160                     _this.grid.footer.onClick('first');
161                }); 
162             }
163           }
164          },
165          {
166           cls : 'x-btn-text-icon',
167           icon : Roo.rootURL + 'images/default/tree/leaf.gif',
168           text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
169           xns : Roo.Toolbar,
170           '|xns' : 'Roo.Toolbar',
171           xtype : 'Button',
172           listeners : {
173            click : function()
174             {
175                 var s = _this.grid.getSelectionModel().getSelections();
176                 if (!s.length || (s.length > 1))  {
177                     Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
178                     return;
179                 }
180                 if (!_this.dialog) {
181                     return;
182                 }
183                 _this.dialog.show(s[0].data, function() {
184                     _this.grid.footer.onClick('first');
185                 }); 
186                 
187             }
188           }
189          },
190          {
191           xns : Roo.Toolbar,
192           '|xns' : 'Roo.Toolbar',
193           xtype : 'Separator'
194          },
195          {
196           text : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'] /* Search */,
197           xns : Roo.Toolbar,
198           '|xns' : 'Roo.Toolbar',
199           xtype : 'TextItem'
200          },
201          {
202           xns : Roo.form,
203           '|xns' : 'Roo.form',
204           xtype : 'TextField',
205           listeners : {
206            render : function (_self)
207             {
208                 _this.searchBox = _self;
209             },
210            specialkey : function (_self, e)
211             {
212                 if(e.getKey() == 13) {
213                       _this.grid.footer.onClick('first');
214                 }
215             }
216           }
217          },
218          {
219           cls : 'x-btn-icon',
220           icon : rootURL + '/Pman/templates/images/search.gif',
221           xns : Roo.Toolbar,
222           '|xns' : 'Roo.Toolbar',
223           xtype : 'Button',
224           listeners : {
225            click : function (_self, e)
226             {
227             _this.grid.footer.onClick('first');
228             }
229           }
230          },
231          {
232           cls : 'x-btn-icon',
233           icon : rootURL + '/Pman/templates/images/edit-clear.gif',
234           xns : Roo.Toolbar,
235           '|xns' : 'Roo.Toolbar',
236           xtype : 'Button',
237           listeners : {
238            click : function (_self, e)
239             {
240             _this.searchBox.setValue('');
241                 _this.grid.footer.onClick('first');
242             }
243           }
244          },
245          {
246           xns : Roo.Toolbar,
247           '|xns' : 'Roo.Toolbar',
248           xtype : 'Separator'
249          },
250          {
251           text : _this._strings['917d465e9a9e8b16a8da50a1ca8156ca'] /* Show: */,
252           xns : Roo.Toolbar,
253           '|xns' : 'Roo.Toolbar',
254           xtype : 'TextItem'
255          },
256          {
257           enableToggle : true,
258           pressed : false,
259           text : _this._strings['b1c94ca2fbc3e78fc30069c8d0f01680'] /* All */,
260           toggleGroup : 'pgrp',
261           xns : Roo.Toolbar,
262           '|xns' : 'Roo.Toolbar',
263           xtype : 'Button',
264           listeners : {
265            toggle : function (_self,st)
266             {
267                 if (st) { _this.grid.filter = 'P,N,U'; } 
268                 _this.grid.footer.onClick('first');
269                  
270             }
271           }
272          },
273          {
274           enableToggle : true,
275           pressed : true,
276           text : _this._strings['54e1d44609e3abed11f6e1eb6ae54988'] /* Projects */,
277           toggleGroup : 'pgrp',
278           xns : Roo.Toolbar,
279           '|xns' : 'Roo.Toolbar',
280           xtype : 'Button',
281           listeners : {
282            toggle : function (_self,st)
283             {
284                 if (st) { _this.grid.filter = 'P,U'; } 
285                 _this.grid.footer.onClick('first');
286                  
287             }
288           }
289          },
290          {
291           enableToggle : true,
292           pressed : false,
293           text : _this._strings['0f111c111475c934057e6f8bb8314d56'] /* Non-Projects */,
294           toggleGroup : 'pgrp',
295           xns : Roo.Toolbar,
296           '|xns' : 'Roo.Toolbar',
297           xtype : 'Button',
298           listeners : {
299            toggle : function (_self,st)
300             {
301                 if (st) { _this.grid.filter = 'N'; } 
302                 _this.grid.footer.onClick('first');
303                  
304             }
305           }
306          },
307          {
308           enableToggle : true,
309           pressed : false,
310           text : _this._strings['03f4a47830f97377a35321051685071e'] /* Closed */,
311           toggleGroup : 'pgrp',
312           xns : Roo.Toolbar,
313           '|xns' : 'Roo.Toolbar',
314           xtype : 'Button',
315           listeners : {
316            toggle : function (_self, st)
317             {
318                     if (st) { _this.grid.filter = 'X,C'; } 
319                             _this.grid.footer.onClick('first');
320                     
321             }
322           }
323          }
324         ]
325        },
326        dataSource : {
327         remoteSort : true,
328         sortInfo : { field : 'code', direction: 'ASC' },
329         xns : Roo.data,
330         '|xns' : 'Roo.data',
331         xtype : 'Store',
332         listeners : {
333          beforeload : function (_self, o)
334           {
335               if (!_this.searchBox) {
336                   return false;
337               }  
338               o.params = o.params ? o.params : {};
339               o.params['query[project_search]'] = _this.searchBox.getValue();
340               o.params['query[project_filter]'] = _this.grid.filter;
341           }
342         },
343         proxy : {
344          method : 'GET',
345          url : baseURL + '/Roo/core_project.php',
346          xns : Roo.data,
347          '|xns' : 'Roo.data',
348          xtype : 'HttpProxy'
349         },
350         reader : {
351          fields : [
352              {
353                  'name': 'id',
354                  'type': 'int'
355              },
356              {
357                  'name': 'name',
358                  'type': 'string'
359              },
360              {
361                  'name': 'remarks',
362                  'type': 'string'
363              },
364              {
365                  'name': 'owner_id',
366                  'type': 'int'
367              },
368              {
369                  'name': 'code',
370                  'type': 'string'
371              },
372              {
373                  'name': 'active',
374                  'type': 'int'
375              },
376              {
377                  'name': 'type',
378                  'type': 'string'
379              },
380              {
381                  'name': 'client_id',
382                  'type': 'int'
383              },
384              {
385                  'name': 'team_id',
386                  'type': 'int'
387              },
388              {
389                  'name': 'file_location',
390                  'type': 'string'
391              },
392              {
393                  'name': 'open_date',
394                  'type': 'date',
395                  'dateFormat': 'Y-m-d'
396              },
397              {
398                  'name': 'open_by',
399                  'type': 'int'
400              },
401              {
402                  'name': 'close_date',
403                  'type': 'date',
404                  'dateFormat': 'Y-m-d'
405              },
406              {
407                  'name': 'countries',
408                  'type': 'string'
409              },
410              {
411                  'name': 'languages',
412                  'type': 'string'
413              },
414              {
415                  'name': 'agency_id',
416                  'type': 'int'
417              },
418              {
419                  'name': 'client_id_code',
420                  'type': 'string'
421              },
422              {
423                  'name': 'client_id_name',
424                  'type': 'string'
425              },
426              {
427                  'name': 'client_id_remarks',
428                  'type': 'string'
429              },
430              {
431                  'name': 'client_id_owner_id',
432                  'type': 'int'
433              },
434              {
435                  'name': 'client_id_address',
436                  'type': 'string'
437              },
438              {
439                  'name': 'client_id_tel',
440                  'type': 'string'
441              },
442              {
443                  'name': 'client_id_fax',
444                  'type': 'string'
445              },
446              {
447                  'name': 'client_id_email',
448                  'type': 'string'
449              },
450              {
451                  'name': 'client_id_id',
452                  'type': 'int'
453              },
454              {
455                  'name': 'client_id_isOwner',
456                  'type': 'int'
457              },
458              {
459                  'name': 'client_id_logo_id',
460                  'type': 'int'
461              },
462              {
463                  'name': 'client_id_background_color',
464                  'type': 'string'
465              },
466              {
467                  'name': 'client_id_comptype',
468                  'type': 'string'
469              },
470              {
471                  'name': 'client_id_url',
472                  'type': 'string'
473              },
474              {
475                  'name': 'client_id_main_office_id',
476                  'type': 'int'
477              },
478              {
479                  'name': 'client_id_created_by',
480                  'type': 'int'
481              },
482              {
483                  'name': 'client_id_created_dt',
484                  'type': 'date'
485              },
486              {
487                  'name': 'client_id_updated_by',
488                  'type': 'int'
489              },
490              {
491                  'name': 'client_id_updated_dt',
492                  'type': 'date'
493              },
494              {
495                  'name': 'client_id_passwd',
496                  'type': 'string'
497              },
498              {
499                  'name': 'agency_id_code',
500                  'type': 'string'
501              },
502              {
503                  'name': 'agency_id_name',
504                  'type': 'string'
505              },
506              {
507                  'name': 'agency_id_remarks',
508                  'type': 'string'
509              },
510              {
511                  'name': 'agency_id_owner_id',
512                  'type': 'int'
513              },
514              {
515                  'name': 'agency_id_address',
516                  'type': 'string'
517              },
518              {
519                  'name': 'agency_id_tel',
520                  'type': 'string'
521              },
522              {
523                  'name': 'agency_id_fax',
524                  'type': 'string'
525              },
526              {
527                  'name': 'agency_id_email',
528                  'type': 'string'
529              },
530              {
531                  'name': 'agency_id_id',
532                  'type': 'int'
533              },
534              {
535                  'name': 'agency_id_isOwner',
536                  'type': 'int'
537              },
538              {
539                  'name': 'agency_id_logo_id',
540                  'type': 'int'
541              },
542              {
543                  'name': 'agency_id_background_color',
544                  'type': 'string'
545              },
546              {
547                  'name': 'agency_id_comptype',
548                  'type': 'string'
549              },
550              {
551                  'name': 'agency_id_url',
552                  'type': 'string'
553              },
554              {
555                  'name': 'agency_id_main_office_id',
556                  'type': 'int'
557              },
558              {
559                  'name': 'agency_id_created_by',
560                  'type': 'int'
561              },
562              {
563                  'name': 'agency_id_created_dt',
564                  'type': 'date'
565              },
566              {
567                  'name': 'agency_id_updated_by',
568                  'type': 'int'
569              },
570              {
571                  'name': 'agency_id_updated_dt',
572                  'type': 'date'
573              },
574              {
575                  'name': 'agency_id_passwd',
576                  'type': 'string'
577              },
578              {
579                  'name': 'team_id_id',
580                  'type': 'int'
581              },
582              {
583                  'name': 'team_id_name',
584                  'type': 'string'
585              },
586              {
587                  'name': 'team_id_type',
588                  'type': 'int'
589              },
590              {
591                  'name': 'team_id_leader',
592                  'type': 'int'
593              },
594              {
595                  'name': 'open_by_id',
596                  'type': 'int'
597              },
598              {
599                  'name': 'open_by_office_id',
600                  'type': 'int'
601              },
602              {
603                  'name': 'open_by_name',
604                  'type': 'string'
605              },
606              {
607                  'name': 'open_by_phone',
608                  'type': 'string'
609              },
610              {
611                  'name': 'open_by_fax',
612                  'type': 'string'
613              },
614              {
615                  'name': 'open_by_email',
616                  'type': 'string'
617              },
618              {
619                  'name': 'open_by_company_id',
620                  'type': 'int'
621              },
622              {
623                  'name': 'open_by_role',
624                  'type': 'string'
625              },
626              {
627                  'name': 'open_by_active',
628                  'type': 'int'
629              },
630              {
631                  'name': 'open_by_remarks',
632                  'type': 'string'
633              },
634              {
635                  'name': 'open_by_passwd',
636                  'type': 'string'
637              },
638              {
639                  'name': 'open_by_owner_id',
640                  'type': 'int'
641              },
642              {
643                  'name': 'open_by_lang',
644                  'type': 'string'
645              },
646              {
647                  'name': 'open_by_no_reset_sent',
648                  'type': 'int'
649              },
650              {
651                  'name': 'open_by_action_type',
652                  'type': 'string'
653              },
654              {
655                  'name': 'open_by_project_id',
656                  'type': 'int'
657              },
658              {
659                  'name': 'owner_id_id',
660                  'type': 'int'
661              },
662              {
663                  'name': 'owner_id_office_id',
664                  'type': 'int'
665              },
666              {
667                  'name': 'owner_id_name',
668                  'type': 'string'
669              },
670              {
671                  'name': 'owner_id_phone',
672                  'type': 'string'
673              },
674              {
675                  'name': 'owner_id_fax',
676                  'type': 'string'
677              },
678              {
679                  'name': 'owner_id_email',
680                  'type': 'string'
681              },
682              {
683                  'name': 'owner_id_company_id',
684                  'type': 'int'
685              },
686              {
687                  'name': 'owner_id_role',
688                  'type': 'string'
689              },
690              {
691                  'name': 'owner_id_active',
692                  'type': 'int'
693              },
694              {
695                  'name': 'owner_id_remarks',
696                  'type': 'string'
697              },
698              {
699                  'name': 'owner_id_passwd',
700                  'type': 'string'
701              },
702              {
703                  'name': 'owner_id_owner_id',
704                  'type': 'int'
705              },
706              {
707                  'name': 'owner_id_lang',
708                  'type': 'string'
709              },
710              {
711                  'name': 'owner_id_no_reset_sent',
712                  'type': 'int'
713              },
714              {
715                  'name': 'owner_id_action_type',
716                  'type': 'string'
717              },
718              {
719                  'name': 'owner_id_project_id',
720                  'type': 'int'
721              }
722          ],
723          id : 'id',
724          root : 'data',
725          totalProperty : 'total',
726          xns : Roo.data,
727          '|xns' : 'Roo.data',
728          xtype : 'JsonReader'
729         }
730        },
731        sm : {
732         singleSelect : true,
733         xns : Roo.grid,
734         '|xns' : 'Roo.grid',
735         xtype : 'RowSelectionModel',
736         listeners : {
737          afterselectionchange : function (_self)
738           {
739               // load project members.
740           }
741         }
742        },
743        colModel : [
744         {
745          dataIndex : 'type',
746          header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
747          renderer : function(v) { return _this.grid.typeToString(v);},
748          sortable : true,
749          width : 70,
750          xns : Roo.grid,
751          '|xns' : 'Roo.grid',
752          xtype : 'ColumnModel'
753         },
754         {
755          dataIndex : 'client_id_name',
756          header : _this._strings['577d7068826de925ea2aec01dbadf5e4'] /* Client */,
757          renderer : function(v) { return String.format('{0}', v); },
758          width : 75,
759          xns : Roo.grid,
760          '|xns' : 'Roo.grid',
761          xtype : 'ColumnModel'
762         },
763         {
764          dataIndex : 'code',
765          header : _this._strings['ca0dbad92a874b2f69b549293387925e'] /* Code */,
766          renderer : function(v) { return String.format('{0}', v); },
767          sortable : true,
768          width : 120,
769          xns : Roo.grid,
770          '|xns' : 'Roo.grid',
771          xtype : 'ColumnModel'
772         },
773         {
774          dataIndex : 'name',
775          header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
776          renderer : function(v) { return String.format('{0}', v); },
777          sortable : true,
778          width : 200,
779          xns : Roo.grid,
780          '|xns' : 'Roo.grid',
781          xtype : 'ColumnModel'
782         }
783        ]
784       }
785      }
786     ]
787    }
788   };  }
789 });