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',
39 xtype: 'BorderLayout',
46 activate : function() {
49 _this.dialog = Pman.Dialog.CoreProject ;
52 _this.grid.footer.onClick('first');
60 tableName : 'Projects',
69 //_this.dialog = Pman.Dialog.FILL_IN
70 if (_this.panel.active) {
71 this.footer.onClick('first');
74 rowdblclick : function (_self, rowIndex, e)
76 if (!_this.dialog) return;
77 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
78 _this.grid.footer.onClick('first');
83 autoExpandColumn : 'name',
85 getTypes : function() {
87 [ 'U' , "Project (Unconfirmed)" ],
89 [ 'C' , "Project (Closed)" ],
90 [ 'N' , "Non-Project" ],
91 [ 'X' , "Non-Project (Closed)" ]
95 typeToString : function(v)
97 var ar = this.getTypes();
99 Roo.each(ar, function(a) {
111 beforeload : function (_self, options)
113 if (!_this.searchBox) {
116 o.params = o.params ? o.params : {};
117 o.params['query[project_search]'] = _this.searchBox.getValue();
118 o.params['query[project_filter]'] = _this.filter;
122 sortInfo : { field : 'code', direction: 'ASC' },
127 url : baseURL + '/Roo/Projects.php'
132 totalProperty : 'total',
173 'name': 'file_location',
179 'dateFormat': 'Y-m-d'
186 'name': 'close_date',
188 'dateFormat': 'Y-m-d'
203 'name': 'client_id_code',
207 'name': 'client_id_name',
211 'name': 'client_id_remarks',
215 'name': 'client_id_owner_id',
219 'name': 'client_id_address',
223 'name': 'client_id_tel',
227 'name': 'client_id_fax',
231 'name': 'client_id_email',
235 'name': 'client_id_id',
239 'name': 'client_id_isOwner',
243 'name': 'client_id_logo_id',
247 'name': 'client_id_background_color',
251 'name': 'client_id_comptype',
255 'name': 'client_id_url',
259 'name': 'client_id_main_office_id',
263 'name': 'client_id_created_by',
267 'name': 'client_id_created_dt',
271 'name': 'client_id_updated_by',
275 'name': 'client_id_updated_dt',
279 'name': 'client_id_passwd',
283 'name': 'agency_id_code',
287 'name': 'agency_id_name',
291 'name': 'agency_id_remarks',
295 'name': 'agency_id_owner_id',
299 'name': 'agency_id_address',
303 'name': 'agency_id_tel',
307 'name': 'agency_id_fax',
311 'name': 'agency_id_email',
315 'name': 'agency_id_id',
319 'name': 'agency_id_isOwner',
323 'name': 'agency_id_logo_id',
327 'name': 'agency_id_background_color',
331 'name': 'agency_id_comptype',
335 'name': 'agency_id_url',
339 'name': 'agency_id_main_office_id',
343 'name': 'agency_id_created_by',
347 'name': 'agency_id_created_dt',
351 'name': 'agency_id_updated_by',
355 'name': 'agency_id_updated_dt',
359 'name': 'agency_id_passwd',
363 'name': 'team_id_id',
367 'name': 'team_id_name',
371 'name': 'team_id_type',
375 'name': 'team_id_leader',
379 'name': 'open_by_id',
383 'name': 'open_by_office_id',
387 'name': 'open_by_name',
391 'name': 'open_by_phone',
395 'name': 'open_by_fax',
399 'name': 'open_by_email',
403 'name': 'open_by_company_id',
407 'name': 'open_by_role',
411 'name': 'open_by_active',
415 'name': 'open_by_remarks',
419 'name': 'open_by_passwd',
423 'name': 'open_by_owner_id',
427 'name': 'open_by_lang',
431 'name': 'open_by_no_reset_sent',
435 'name': 'open_by_action_type',
439 'name': 'open_by_project_id',
443 'name': 'owner_id_id',
447 'name': 'owner_id_office_id',
451 'name': 'owner_id_name',
455 'name': 'owner_id_phone',
459 'name': 'owner_id_fax',
463 'name': 'owner_id_email',
467 'name': 'owner_id_company_id',
471 'name': 'owner_id_role',
475 'name': 'owner_id_active',
479 'name': 'owner_id_remarks',
483 'name': 'owner_id_passwd',
487 'name': 'owner_id_owner_id',
491 'name': 'owner_id_lang',
495 'name': 'owner_id_no_reset_sent',
499 'name': 'owner_id_action_type',
503 'name': 'owner_id_project_id',
510 xtype: 'PagingToolbar',
513 displayMsg : 'Displaying Projects {0} - {1} of {2}',
514 emptyMsg : 'No Projects found',
527 if (!_this.dialog) return;
528 _this.dialog.show( { id : 0 } , function() {
529 _this.grid.footer.onClick('first');
533 cls : 'x-btn-text-icon',
535 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
541 cls : 'x-btn-text-icon',
542 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
546 var s = _this.grid.getSelectionModel().getSelections();
547 if (!s.length || (s.length > 1)) {
548 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
551 if (!_this.dialog) return;
552 _this.dialog.show(s[0].data, function() {
553 _this.grid.footer.onClick('first');
572 render : function (_self)
574 _this.searchBox = _self;
576 specialkey : function (_self, e)
578 if(e.getKey() == 13) {
579 _this.grid.footer.onClick('first');
588 click : function (_self, e)
590 _this.grid.footer.onClick('first');
594 icon : rootURL + '/Pman/templates/images/search.gif'
600 click : function (_self, e)
602 _this.searchBox.setValue('');
603 _this.grid.footer.onClick('first');
607 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
617 xtype: 'ColumnModel',
622 renderer : function(v) { return _this.grid.typeToString(v);}
625 xtype: 'ColumnModel',
630 renderer : function(v) { return String.format('{0}', v); }
633 xtype: 'ColumnModel',
638 renderer : function(v) { return String.format('{0}', v); }
641 xtype: 'ColumnModel',
645 dataIndex : 'client_id',
646 renderer : function(v) { return String.format('{0}', v); }
653 xtype: 'LayoutRegion',
657 xtype: 'LayoutRegion',
663 this.layout = this.panel.layout;