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',
41 xtype: 'BorderLayout',
48 activate : function() {
51 _this.dialog = Pman.Dialog.CoreProject ;
54 _this.grid.footer.onClick('first');
62 tableName : 'Projects',
71 //_this.dialog = Pman.Dialog.FILL_IN
72 if (_this.panel.active) {
73 this.footer.onClick('first');
76 rowdblclick : function (_self, rowIndex, e)
78 if (!_this.dialog) return;
79 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
80 _this.grid.footer.onClick('first');
85 autoExpandColumn : 'name',
87 getTypes : function() {
89 [ 'U' , "Project (Unconfirmed)" ],
91 [ 'C' , "Project (Closed)" ],
92 [ 'N' , "Non-Project" ],
93 [ 'X' , "Non-Project (Closed)" ]
97 typeToString : function(v)
99 var ar = this.getTypes();
101 Roo.each(ar, function(a) {
113 beforeload : function (_self, o)
115 if (!_this.searchBox) {
118 o.params = o.params ? o.params : {};
119 o.params['query[project_search]'] = _this.searchBox.getValue();
120 o.params['query[project_filter]'] = _this.grid.filter;
124 sortInfo : { field : 'code', direction: 'ASC' },
129 url : baseURL + '/Roo/Projects.php'
134 totalProperty : 'total',
175 'name': 'file_location',
181 'dateFormat': 'Y-m-d'
188 'name': 'close_date',
190 'dateFormat': 'Y-m-d'
205 'name': 'client_id_code',
209 'name': 'client_id_name',
213 'name': 'client_id_remarks',
217 'name': 'client_id_owner_id',
221 'name': 'client_id_address',
225 'name': 'client_id_tel',
229 'name': 'client_id_fax',
233 'name': 'client_id_email',
237 'name': 'client_id_id',
241 'name': 'client_id_isOwner',
245 'name': 'client_id_logo_id',
249 'name': 'client_id_background_color',
253 'name': 'client_id_comptype',
257 'name': 'client_id_url',
261 'name': 'client_id_main_office_id',
265 'name': 'client_id_created_by',
269 'name': 'client_id_created_dt',
273 'name': 'client_id_updated_by',
277 'name': 'client_id_updated_dt',
281 'name': 'client_id_passwd',
285 'name': 'agency_id_code',
289 'name': 'agency_id_name',
293 'name': 'agency_id_remarks',
297 'name': 'agency_id_owner_id',
301 'name': 'agency_id_address',
305 'name': 'agency_id_tel',
309 'name': 'agency_id_fax',
313 'name': 'agency_id_email',
317 'name': 'agency_id_id',
321 'name': 'agency_id_isOwner',
325 'name': 'agency_id_logo_id',
329 'name': 'agency_id_background_color',
333 'name': 'agency_id_comptype',
337 'name': 'agency_id_url',
341 'name': 'agency_id_main_office_id',
345 'name': 'agency_id_created_by',
349 'name': 'agency_id_created_dt',
353 'name': 'agency_id_updated_by',
357 'name': 'agency_id_updated_dt',
361 'name': 'agency_id_passwd',
365 'name': 'team_id_id',
369 'name': 'team_id_name',
373 'name': 'team_id_type',
377 'name': 'team_id_leader',
381 'name': 'open_by_id',
385 'name': 'open_by_office_id',
389 'name': 'open_by_name',
393 'name': 'open_by_phone',
397 'name': 'open_by_fax',
401 'name': 'open_by_email',
405 'name': 'open_by_company_id',
409 'name': 'open_by_role',
413 'name': 'open_by_active',
417 'name': 'open_by_remarks',
421 'name': 'open_by_passwd',
425 'name': 'open_by_owner_id',
429 'name': 'open_by_lang',
433 'name': 'open_by_no_reset_sent',
437 'name': 'open_by_action_type',
441 'name': 'open_by_project_id',
445 'name': 'owner_id_id',
449 'name': 'owner_id_office_id',
453 'name': 'owner_id_name',
457 'name': 'owner_id_phone',
461 'name': 'owner_id_fax',
465 'name': 'owner_id_email',
469 'name': 'owner_id_company_id',
473 'name': 'owner_id_role',
477 'name': 'owner_id_active',
481 'name': 'owner_id_remarks',
485 'name': 'owner_id_passwd',
489 'name': 'owner_id_owner_id',
493 'name': 'owner_id_lang',
497 'name': 'owner_id_no_reset_sent',
501 'name': 'owner_id_action_type',
505 'name': 'owner_id_project_id',
512 xtype: 'PagingToolbar',
515 displayMsg : 'Displaying Projects {0} - {1} of {2}',
516 emptyMsg : 'No Projects found',
529 if (!_this.dialog) return;
530 _this.dialog.show( { id : 0 } , function() {
531 _this.grid.footer.onClick('first');
535 cls : 'x-btn-text-icon',
537 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
543 cls : 'x-btn-text-icon',
544 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
548 var s = _this.grid.getSelectionModel().getSelections();
549 if (!s.length || (s.length > 1)) {
550 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
553 if (!_this.dialog) return;
554 _this.dialog.show(s[0].data, function() {
555 _this.grid.footer.onClick('first');
574 render : function (_self)
576 _this.searchBox = _self;
578 specialkey : function (_self, e)
580 if(e.getKey() == 13) {
581 _this.grid.footer.onClick('first');
590 click : function (_self, e)
592 _this.grid.footer.onClick('first');
596 icon : rootURL + '/Pman/templates/images/search.gif'
602 click : function (_self, e)
604 _this.searchBox.setValue('');
605 _this.grid.footer.onClick('first');
609 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
624 toggle : function (_self)
626 if (st) { _this.grid.filter = 'P,N,U'; }
627 _this.grid.footer.onClick('first');
640 toggle : function (_self)
642 if (st) { _this.grid.filter = 'P,U'; }
643 _this.grid.footer.onClick('first');
656 toggle : function (_self)
658 if (st) { _this.grid.filter = 'N'; }
659 _this.grid.footer.onClick('first');
665 text : "Non-Projects",
672 toggle : function (_self, pressed)
674 if (st) { _this.grid.filter = 'X,C'; }
675 _this.grid.footer.onClick('first');
688 xtype: 'ColumnModel',
693 renderer : function(v) { return _this.grid.typeToString(v);},
697 xtype: 'ColumnModel',
699 dataIndex : 'client_id_name',
702 renderer : function(v) { return String.format('{0}', v); }
705 xtype: 'ColumnModel',
710 renderer : function(v) { return String.format('{0}', v); },
714 xtype: 'ColumnModel',
719 renderer : function(v) { return String.format('{0}', v); },
724 xtype: 'RowSelectionModel',
727 afterselectionchange : function (_self)
729 // load project members.
738 xtype: 'LayoutRegion',
742 xtype: 'LayoutRegion',
748 this.layout = this.panel.layout;