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,
14 parent : Pman.Tab.Admin,
15 name : "Pman.Tab.AdminProjectManager",
17 permname: 'Core.Projects_All'
21 Pman.Tab.AdminProjectManager = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
34 xtype: 'NestedLayoutPanel',
40 xtype: 'BorderLayout',
47 activate : function() {
50 _this.dialog = Pman.Dialog.CoreProject ;
53 _this.grid.footer.onClick('first');
61 tableName : 'Projects',
70 //_this.dialog = Pman.Dialog.FILL_IN
71 if (_this.panel.active) {
72 this.footer.onClick('first');
75 rowdblclick : function (_self, rowIndex, e)
77 if (!_this.dialog) return;
78 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
79 _this.grid.footer.onClick('first');
84 autoExpandColumn : 'name',
86 getTypes : function() {
88 [ 'U' , "Project (Unconfirmed)" ],
90 [ 'C' , "Project (Closed)" ],
91 [ 'N' , "Non-Project" ],
92 [ 'X' , "Non-Project (Closed)" ]
96 typeToString : function(v)
98 var ar = this.getTypes();
100 Roo.each(ar, function(a) {
112 beforeload : function (_self, options)
114 if (!_this.searchBox) {
117 o.params = o.params ? o.params : {};
118 o.params['query[project_search]'] = _this.searchBox.getValue();
119 o.params['query[project_filter]'] = _this.grid.filter;
123 sortInfo : { field : 'code', direction: 'ASC' },
128 url : baseURL + '/Roo/Projects.php'
133 totalProperty : 'total',
174 'name': 'file_location',
180 'dateFormat': 'Y-m-d'
187 'name': 'close_date',
189 'dateFormat': 'Y-m-d'
204 'name': 'client_id_code',
208 'name': 'client_id_name',
212 'name': 'client_id_remarks',
216 'name': 'client_id_owner_id',
220 'name': 'client_id_address',
224 'name': 'client_id_tel',
228 'name': 'client_id_fax',
232 'name': 'client_id_email',
236 'name': 'client_id_id',
240 'name': 'client_id_isOwner',
244 'name': 'client_id_logo_id',
248 'name': 'client_id_background_color',
252 'name': 'client_id_comptype',
256 'name': 'client_id_url',
260 'name': 'client_id_main_office_id',
264 'name': 'client_id_created_by',
268 'name': 'client_id_created_dt',
272 'name': 'client_id_updated_by',
276 'name': 'client_id_updated_dt',
280 'name': 'client_id_passwd',
284 'name': 'agency_id_code',
288 'name': 'agency_id_name',
292 'name': 'agency_id_remarks',
296 'name': 'agency_id_owner_id',
300 'name': 'agency_id_address',
304 'name': 'agency_id_tel',
308 'name': 'agency_id_fax',
312 'name': 'agency_id_email',
316 'name': 'agency_id_id',
320 'name': 'agency_id_isOwner',
324 'name': 'agency_id_logo_id',
328 'name': 'agency_id_background_color',
332 'name': 'agency_id_comptype',
336 'name': 'agency_id_url',
340 'name': 'agency_id_main_office_id',
344 'name': 'agency_id_created_by',
348 'name': 'agency_id_created_dt',
352 'name': 'agency_id_updated_by',
356 'name': 'agency_id_updated_dt',
360 'name': 'agency_id_passwd',
364 'name': 'team_id_id',
368 'name': 'team_id_name',
372 'name': 'team_id_type',
376 'name': 'team_id_leader',
380 'name': 'open_by_id',
384 'name': 'open_by_office_id',
388 'name': 'open_by_name',
392 'name': 'open_by_phone',
396 'name': 'open_by_fax',
400 'name': 'open_by_email',
404 'name': 'open_by_company_id',
408 'name': 'open_by_role',
412 'name': 'open_by_active',
416 'name': 'open_by_remarks',
420 'name': 'open_by_passwd',
424 'name': 'open_by_owner_id',
428 'name': 'open_by_lang',
432 'name': 'open_by_no_reset_sent',
436 'name': 'open_by_action_type',
440 'name': 'open_by_project_id',
444 'name': 'owner_id_id',
448 'name': 'owner_id_office_id',
452 'name': 'owner_id_name',
456 'name': 'owner_id_phone',
460 'name': 'owner_id_fax',
464 'name': 'owner_id_email',
468 'name': 'owner_id_company_id',
472 'name': 'owner_id_role',
476 'name': 'owner_id_active',
480 'name': 'owner_id_remarks',
484 'name': 'owner_id_passwd',
488 'name': 'owner_id_owner_id',
492 'name': 'owner_id_lang',
496 'name': 'owner_id_no_reset_sent',
500 'name': 'owner_id_action_type',
504 'name': 'owner_id_project_id',
511 xtype: 'PagingToolbar',
514 displayMsg : 'Displaying Projects {0} - {1} of {2}',
515 emptyMsg : 'No Projects found',
528 if (!_this.dialog) return;
529 _this.dialog.show( { id : 0 } , function() {
530 _this.grid.footer.onClick('first');
534 cls : 'x-btn-text-icon',
536 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
542 cls : 'x-btn-text-icon',
543 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
547 var s = _this.grid.getSelectionModel().getSelections();
548 if (!s.length || (s.length > 1)) {
549 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
552 if (!_this.dialog) return;
553 _this.dialog.show(s[0].data, function() {
554 _this.grid.footer.onClick('first');
573 render : function (_self)
575 _this.searchBox = _self;
577 specialkey : function (_self, e)
579 if(e.getKey() == 13) {
580 _this.grid.footer.onClick('first');
589 click : function (_self, e)
591 _this.grid.footer.onClick('first');
595 icon : rootURL + '/Pman/templates/images/search.gif'
601 click : function (_self, e)
603 _this.searchBox.setValue('');
604 _this.grid.footer.onClick('first');
608 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
623 toggle : function (_self)
625 if (st) { _this.grid.filter = 'P,N,U'; }
626 _this.grid.footer.onClick('first');
639 toggle : function (_self)
641 if (st) { _this.grid.filter = 'P,U'; }
642 _this.grid.footer.onClick('first');
655 toggle : function (_self)
657 if (st) { _this.grid.filter = 'N'; }
658 _this.grid.footer.onClick('first');
664 text : "Non-Projects",
671 toggle : function (_self, pressed)
673 if (st) { _this.grid.filter = 'X,C'; }
674 _this.grid.footer.onClick('first');
687 xtype: 'ColumnModel',
692 renderer : function(v) { return _this.grid.typeToString(v);}
695 xtype: 'ColumnModel',
700 renderer : function(v) { return String.format('{0}', v); }
703 xtype: 'ColumnModel',
708 renderer : function(v) { return String.format('{0}', v); }
711 xtype: 'ColumnModel',
715 dataIndex : 'client_id',
716 renderer : function(v) { return String.format('{0}', v); }
720 xtype: 'RowSelectionModel',
723 afterselectionchange : function (_self)
725 // load project members.
734 xtype: 'LayoutRegion',
738 xtype: 'LayoutRegion',
744 this.layout = this.panel.layout;