1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 // register the module first
8 Pman.on('beforeload', function()
11 modKey : '002-Pman.Tab.AdminProjectManager',
12 module : Pman.Tab.AdminProjectManager,
13 moduleName : 'Pman.Tab.AdminProjectManager',
15 parent : Pman.Tab.Admin,
16 name : "Pman.Tab.AdminProjectManager",
18 permname: 'Core.Projects_All'
22 Pman.Tab.AdminProjectManager = new Roo.util.Observable({
28 add : function(parentLayout, region)
32 this.parentLayout = parentLayout;
34 this.panel = parentLayout.addxtype({
35 xtype: 'NestedLayoutPanel',
40 title : "Projects / Members",
42 xtype: 'BorderLayout',
49 activate : function() {
52 _this.dialog = Pman.Dialog.CoreProject ;
55 _this.grid.footer.onClick('first');
63 tableName : 'Projects',
72 //_this.dialog = Pman.Dialog.FILL_IN
73 if (_this.panel.active) {
74 this.footer.onClick('first');
77 rowdblclick : function (_self, rowIndex, e)
79 if (!_this.dialog) return;
80 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
81 _this.grid.footer.onClick('first');
86 autoExpandColumn : 'name',
88 getTypes : function() {
90 [ 'U' , "Project (Unconfirmed)" ],
92 [ 'C' , "Project (Closed)" ],
93 [ 'N' , "Non-Project" ],
94 [ 'X' , "Non-Project (Closed)" ]
98 typeToString : function(v)
100 var ar = this.getTypes();
102 Roo.each(ar, function(a) {
114 beforeload : function (_self, o)
116 if (!_this.searchBox) {
119 o.params = o.params ? o.params : {};
120 o.params['query[project_search]'] = _this.searchBox.getValue();
121 o.params['query[project_filter]'] = _this.grid.filter;
125 sortInfo : { field : 'code', direction: 'ASC' },
130 url : baseURL + '/Roo/Projects.php'
135 totalProperty : 'total',
176 'name': 'file_location',
182 'dateFormat': 'Y-m-d'
189 'name': 'close_date',
191 'dateFormat': 'Y-m-d'
206 'name': 'client_id_code',
210 'name': 'client_id_name',
214 'name': 'client_id_remarks',
218 'name': 'client_id_owner_id',
222 'name': 'client_id_address',
226 'name': 'client_id_tel',
230 'name': 'client_id_fax',
234 'name': 'client_id_email',
238 'name': 'client_id_id',
242 'name': 'client_id_isOwner',
246 'name': 'client_id_logo_id',
250 'name': 'client_id_background_color',
254 'name': 'client_id_comptype',
258 'name': 'client_id_url',
262 'name': 'client_id_main_office_id',
266 'name': 'client_id_created_by',
270 'name': 'client_id_created_dt',
274 'name': 'client_id_updated_by',
278 'name': 'client_id_updated_dt',
282 'name': 'client_id_passwd',
286 'name': 'agency_id_code',
290 'name': 'agency_id_name',
294 'name': 'agency_id_remarks',
298 'name': 'agency_id_owner_id',
302 'name': 'agency_id_address',
306 'name': 'agency_id_tel',
310 'name': 'agency_id_fax',
314 'name': 'agency_id_email',
318 'name': 'agency_id_id',
322 'name': 'agency_id_isOwner',
326 'name': 'agency_id_logo_id',
330 'name': 'agency_id_background_color',
334 'name': 'agency_id_comptype',
338 'name': 'agency_id_url',
342 'name': 'agency_id_main_office_id',
346 'name': 'agency_id_created_by',
350 'name': 'agency_id_created_dt',
354 'name': 'agency_id_updated_by',
358 'name': 'agency_id_updated_dt',
362 'name': 'agency_id_passwd',
366 'name': 'team_id_id',
370 'name': 'team_id_name',
374 'name': 'team_id_type',
378 'name': 'team_id_leader',
382 'name': 'open_by_id',
386 'name': 'open_by_office_id',
390 'name': 'open_by_name',
394 'name': 'open_by_phone',
398 'name': 'open_by_fax',
402 'name': 'open_by_email',
406 'name': 'open_by_company_id',
410 'name': 'open_by_role',
414 'name': 'open_by_active',
418 'name': 'open_by_remarks',
422 'name': 'open_by_passwd',
426 'name': 'open_by_owner_id',
430 'name': 'open_by_lang',
434 'name': 'open_by_no_reset_sent',
438 'name': 'open_by_action_type',
442 'name': 'open_by_project_id',
446 'name': 'owner_id_id',
450 'name': 'owner_id_office_id',
454 'name': 'owner_id_name',
458 'name': 'owner_id_phone',
462 'name': 'owner_id_fax',
466 'name': 'owner_id_email',
470 'name': 'owner_id_company_id',
474 'name': 'owner_id_role',
478 'name': 'owner_id_active',
482 'name': 'owner_id_remarks',
486 'name': 'owner_id_passwd',
490 'name': 'owner_id_owner_id',
494 'name': 'owner_id_lang',
498 'name': 'owner_id_no_reset_sent',
502 'name': 'owner_id_action_type',
506 'name': 'owner_id_project_id',
513 xtype: 'PagingToolbar',
516 displayMsg : 'Displaying Projects {0} - {1} of {2}',
517 emptyMsg : 'No Projects found',
530 if (!_this.dialog) return;
531 _this.dialog.show( { id : 0 } , function() {
532 _this.grid.footer.onClick('first');
536 cls : 'x-btn-text-icon',
538 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
544 cls : 'x-btn-text-icon',
545 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
549 var s = _this.grid.getSelectionModel().getSelections();
550 if (!s.length || (s.length > 1)) {
551 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
554 if (!_this.dialog) return;
555 _this.dialog.show(s[0].data, function() {
556 _this.grid.footer.onClick('first');
575 render : function (_self)
577 _this.searchBox = _self;
579 specialkey : function (_self, e)
581 if(e.getKey() == 13) {
582 _this.grid.footer.onClick('first');
591 click : function (_self, e)
593 _this.grid.footer.onClick('first');
597 icon : rootURL + '/Pman/templates/images/search.gif'
603 click : function (_self, e)
605 _this.searchBox.setValue('');
606 _this.grid.footer.onClick('first');
610 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
625 toggle : function (_self,st)
627 if (st) { _this.grid.filter = 'P,N,U'; }
628 _this.grid.footer.onClick('first');
641 toggle : function (_self,st)
643 if (st) { _this.grid.filter = 'P,U'; }
644 _this.grid.footer.onClick('first');
657 toggle : function (_self,st)
659 if (st) { _this.grid.filter = 'N'; }
660 _this.grid.footer.onClick('first');
666 text : "Non-Projects",
673 toggle : function (_self, st)
675 if (st) { _this.grid.filter = 'X,C'; }
676 _this.grid.footer.onClick('first');
689 xtype: 'ColumnModel',
694 renderer : function(v) { return _this.grid.typeToString(v);},
698 xtype: 'ColumnModel',
700 dataIndex : 'client_id_name',
703 renderer : function(v) { return String.format('{0}', v); }
706 xtype: 'ColumnModel',
711 renderer : function(v) { return String.format('{0}', v); },
715 xtype: 'ColumnModel',
720 renderer : function(v) { return String.format('{0}', v); },
725 xtype: 'RowSelectionModel',
728 afterselectionchange : function (_self)
730 // load project members.
739 xtype: 'LayoutRegion',
743 xtype: 'LayoutRegion',
750 this.layout = this.panel.layout;