1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 Roo.onReady(function(){
8 var viewpanel = new Roo.XComponent({
9 part : ["Hebe","Members"],
10 order : '001-Pman.Tab.Members',
13 name : "unnamed module",
21 xtype: 'NestedLayoutPanel',
24 xtype: 'BorderLayout',
31 activate : function() {
34 _this.grid.footer.onClick('first');
42 tableName : 'members',
51 //_this.dialog = Pman.Dialog.FILL_IN
52 if (_this.panel.active) {
53 this.footer.onClick('first');
56 rowdblclick : function (_self, rowIndex, e)
59 Roo.log(this.getDataSource().getAt(rowIndex).json.code);
60 _this.selectedCode = this.getDataSource().getAt(rowIndex).json.id;
61 _this.member_cp.region.showPanel(1);
63 /*if (!_this.dialog) return;
65 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
66 _this.grid.footer.onClick('first');
69 rowclick : function (_self, rowIndex, e)
71 _this.selectedCode = this.getDataSource().getAt(rowIndex).json.id;
79 beforeload : function (_self, options)
81 options.params = options.params || {};
82 //options.params._search = _this.searchBox.getValue();
84 options.params['find[code]'] = _this.searchBox.getValue();
85 for(var k in _this.pages) {
86 if (!_this.pages[k].pressed) {
91 //options.params['find[code]'] = _this.searchBox.getValue();
94 options.params['find[type]'] = 'CN';
97 options.params['find[type]'] = 'X';
106 sortInfo : { field : 'code', direction: 'ASC' },
111 url : baseURL + '/Roo/members.php'
116 totalProperty : 'total',
129 'name': 'member_type',
141 'name': 'card_issued',
143 'dateFormat': 'Y-m-d'
162 'name': 'birth_date',
164 'dateFormat': 'Y-m-d'
175 'name': 'nationality',
183 'name': 'correspond',
191 'name': 'email_bills',
195 'name': 'email_promo',
213 'dateFormat': 'Y-m-d'
216 'name': 'application_number',
224 'name': 'use_autopay',
236 'name': 'limit_amount',
240 'name': 'account_name',
244 'name': 'bill_address',
248 'name': 'outstanding',
252 'name': 'year_total',
256 'name': 'month_total',
260 'name': 'brought_forward',
268 'name': 'last_payment_due',
270 'dateFormat': 'Y-m-d'
275 'dateFormat': 'Y-m-d'
278 'name': 'deposit_note',
282 'name': 'has_wireless',
290 'name': 'status_name',
294 'name': 'status_short_name',
298 'name': 'member_type_id',
302 'name': 'member_type_charge_code',
306 'name': 'member_type_name',
313 xtype: 'PagingToolbar',
317 displayMsg : "Displaying members{0} - {1} of {2}",
318 emptyMsg : "No members found"
328 render : function (_self)
330 _this.searchBox= _self;
332 specialkey : function (_self, e)
334 _this.grid.footer.onClick('first');
342 click : function (_self, e)
344 _this.grid.footer.onClick('first');
348 icon : rootURL + '/Pman/templates/images/search.gif'
354 click : function (_self, e)
356 _this.searchBox.setValue('');
358 _this.grid.footer.onClick('first');
362 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
372 render : function (_self)
374 _this.pages = _this.pages || {};
375 _this.pages['members'] = _self;
377 click : function (_self, e)
379 _this.grid.footer.onClick('first');
385 toggleGroup : 'pages'
391 render : function (_self)
393 _this.pages = _this.pages || {};
394 _this.pages['contractors'] = _self;
396 click : function (_self, e)
398 _this.grid.footer.onClick('first');
403 text : "Contractors",
404 toggleGroup : 'pages'
410 render : function (_self)
412 _this.pages = _this.pages || {};
413 _this.pages['staff'] = _self;
415 click : function (_self, e)
417 _this.grid.footer.onClick('first');
423 toggleGroup : 'pages'
435 // if (!_this.dialog) return;
437 for(var k in _this.pages) {
438 if (!_this.pages[k].pressed) {
443 Pman.Dialog.Member.show( { id : 0 } , function() { _this.grid.footer.onClick('first'); });
446 Pman.Dialog.Contractor.show( { id : 0 } , function() { _this.grid.footer.onClick('first'); });
449 Pman.Dialog.Member.show( { member_code : 'X' } , function() { _this.grid.footer.onClick('first'); });
454 /* _this.dialog.show( { id : 0 } , function() {
455 _this.grid.footer.onClick('first');
459 cls : 'x-btn-text-icon',
461 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
467 xtype: 'ColumnModel',
472 renderer : function(v) { return String.format('{0}', v); }
475 xtype: 'ColumnModel',
480 renderer : function(v) { return String.format('{0}', v); }
483 xtype: 'ColumnModel',
485 dataIndex : 'name_zh',
488 renderer : function(v) { return String.format('{0}', v); }
491 xtype: 'ColumnModel',
493 dataIndex : 'status_name',
496 renderer : function(v) { return String.format('{0}', v); }
499 xtype: 'ColumnModel',
501 dataIndex : 'member_type_name',
502 header : 'Member type',
504 renderer : function(v) { return String.format('{0}', v); }
507 xtype: 'ColumnModel',
509 dataIndex : 'hkarea',
512 renderer : function(v) { return String.format('{0}', v); }
515 xtype: 'ColumnModel',
517 dataIndex : 'correspond_address',
520 renderer : function(v) { return String.format('{0}', v).replace(/\n/g,'<br/>'); }
526 xtype: 'ContentPanel',
529 render : function (_self)
531 _this.member_cp = _self;
534 activate : function (_self)
537 var id = _this.form.findField('id').getValue() * 1;
542 _this.cp.region.showPanel(0);
549 if(!_this.selectedCode){
550 //_this.panel.layout.getRegion('center').showPanel(0);
554 url: baseURL + '/backend/members_view/'+_this.selectedCode+'.html?body_only=1',
570 actioncomplete : function(_self,action)
572 if (action.type == 'setdata') {
578 if (action.type == 'load') {
583 if (action.type =='submit') {
588 rendered : function (form)
596 style : 'margin:10px;',
618 click : function (_self, e)
621 for(var k in _this.pages) {
622 if (!_this.pages[k].pressed) {
627 Pman.Dialog.Contractor.show( { id : _this.selectedCode } , function() { _this.grid.footer.onClick('first'); });
631 Pman.Dialog.Member.show( { id : _this.selectedCode } , function() { _this.grid.footer.onClick('first'); });
648 xtype: 'ContentPanel',
651 render : function (_self)
653 _this.accounting_cp = _self;
654 (function () { _this.member_cp.region.showPanel(0)} ).defer(100);
657 activate : function (_self)
660 var id = _this.form.findField('id').getValue() * 1;
665 _this.cp.region.showPanel(0);
673 /* if(is_contractor){
674 _this.member_cp.region.showPanel(0);
677 if(!_this.selectedCode){
678 //_this.panel.layout.getRegion('center').showPanel(0);
681 _this.accounting_cp.load({
682 url: baseURL + '/edit2/member_accounts/'+_this.selectedCode+'.html?body_only=1',
691 title : "Accounting",
697 actioncomplete : function(_self,action)
699 if (action.type == 'setdata') {
705 if (action.type == 'load') {
710 if (action.type =='submit') {
715 rendered : function (form)
723 style : 'margin:10px;',
741 click : function (_self, e)
743 _this.accounting_cp.load({
744 url: baseURL + '/edit2/member_accounts/'+_this.selectedCode+'.html?body_only=1',
752 text : "Edit Bank Details",
753 toggleGroup : 'pages'
759 click : function (_self, e)
761 _this.accounting_cp.load({
762 url: baseURL + '/edit2/account_transaction/'+_this.selectedCode+'.html?body_only=1&isCredit=0',
770 text : "Add Bill or Charge",
771 toggleGroup : 'pages'
777 click : function (_self, e)
779 _this.accounting_cp.load({
780 url: baseURL + '/edit2/account_transaction/'+_this.selectedCode+'.html?body_only=1',
788 text : "Credit Member",
789 toggleGroup : 'pages'
795 click : function (_self, e)
797 _this.accounting_cp.load({
798 url: baseURL + '/backend/PromoCredits/'+_this.selectedCode+'.html?body_only=1',
806 text : "Promotional Credits",
807 toggleGroup : 'pages'
813 click : function (_self, e)
815 _this.accounting_cp.load({
816 url: baseURL + '/Accounts/viewBill/'+_this.selectedCode+'.html?body_only=1&isCredit=0',
825 toggleGroup : 'pages'
831 click : function (_self, e)
833 _this.accounting_cp.load({
834 url: baseURL + '/browse2/account_transaction.html?find[member]='+_this.selectedCode+'&find[payments]=no&body_only=1',
842 text : "Transactions",
843 toggleGroup : 'pages'
849 click : function (_self, e)
851 _this.accounting_cp.load({
852 url: baseURL + '/browse2/account_transaction.html?find[member]='+_this.selectedCode+'&find[payments]=yes&body_only=1',
861 toggleGroup : 'pages'
868 xtype: 'LayoutRegion',
877 viewpanel.render('view');