From 4d123b63f0602be5e49a8d35e7df5647e07237f5 Mon Sep 17 00:00:00 2001 From: abijah Date: Wed, 8 Jul 2009 20:40:44 +0000 Subject: [PATCH] Moved all grid elements onto the grid helper. Basic testing done, but more testing needs to be done. git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@262 97e9348a-65ac-dc4b-aefc-98561f571b83 --- views/accounts/deposit.ctp | 22 +++-- views/accounts/view.ctp | 28 ++++-- views/contacts/view.ctp | 9 +- views/customers/receipt.ctp | 39 ++++---- views/customers/view.ctp | 26 ++++-- views/elements/accounts.ctp | 31 ++----- views/elements/contacts.ctp | 24 ++--- views/elements/customers.ctp | 29 ++---- views/elements/ledger_entries.ctp | 133 +++++++++++++--------------- views/elements/ledgers.ctp | 30 ++----- views/elements/maps.ctp | 21 ++--- views/elements/monetary_sources.ctp | 21 ++--- views/elements/transactions.ctp | 24 ++--- views/elements/units.ctp | 32 ++----- views/helpers/grid.php | 15 +++- views/leases/invoice.ctp | 19 ++-- views/leases/move_in.ctp | 40 +++++---- views/leases/view.ctp | 15 ++-- views/ledger_entries/view.ctp | 34 ++++--- views/ledgers/view.ctp | 16 ++-- views/transactions/view.ctp | 17 ++-- views/units/view.ctp | 23 +++-- 22 files changed, 327 insertions(+), 321 deletions(-) diff --git a/views/accounts/deposit.ctp b/views/accounts/deposit.ctp index fd402d4..d60924e 100644 --- a/views/accounts/deposit.ctp +++ b/views/accounts/deposit.ctp @@ -48,14 +48,20 @@ foreach ($tillableAccount AS $acct) { echo "\n"; $grid_div_id = 'ledger_entries'.$acct['CurrentLedger']['id'].'-list'; - echo $this->element('ledger_entries', - array('grid_div_id' => $grid_div_id, - 'caption' => ('Items in '.$acct['Account']['name'].' Ledger'), - 'ledger_id' => $acct['CurrentLedger']['id'], - 'no_account' => true, - 'grid_setup' => $grid_setup, - )); + echo $this->element('ledger_entries', array + (// Element configuration + 'ledger_id' => $acct['CurrentLedger']['id'], + 'no_account' => true, + + // Grid configuration + 'config' => array + ( + 'grid_div_id' => $grid_div_id, + 'caption' => ('Items in '.$acct['Account']['name'].' Ledger'), + 'grid_setup' => $grid_setup, + ), + )); } $options = array(); diff --git a/views/accounts/view.ctp b/views/accounts/view.ctp index cf21063..a041e52 100644 --- a/views/accounts/view.ctp +++ b/views/accounts/view.ctp @@ -55,20 +55,32 @@ echo '
' . "\n"; * Ledgers */ -echo $this->element('ledgers', - array('caption' => $account['Account']['name'] . " Ledgers", - 'ledgers' => $account['Ledger'])); +echo $this->element('ledgers', array + ('config' => array + ('caption' => $account['Account']['name'] . " Ledgers", + 'rows' => $account['Ledger'], + ))); /********************************************************************** * Current Ledger */ -echo $this->element('ledger_entries', - array('caption' => "Current Ledger: (#{$account['Account']['id']}-{$account['CurrentLedger']['sequence']})", - 'ledger_id' => $account['CurrentLedger']['id'], - 'account_type' => $account['Account']['type'], - )); +echo $this->element('ledger_entries', array + (// Element configuration + 'ledger_id' => $account['CurrentLedger']['id'], + 'account_type' => $account['Account']['type'], + + // Grid configuration + 'config' => array + ('caption' => + "Current Ledger: (" . + "#{$account['Account']['id']}" . + "-" . + "{$account['CurrentLedger']['sequence']}" . + ")", + ), + )); /* End "detail supporting" div */ echo '
' . "\n"; diff --git a/views/contacts/view.ctp b/views/contacts/view.ctp index 6ceacdf..dcf2f0c 100644 --- a/views/contacts/view.ctp +++ b/views/contacts/view.ctp @@ -121,9 +121,12 @@ echo $this->element('table', /********************************************************************** * Customers */ -echo $this->element('customers', array('heading' => '', - 'caption' => 'Related Customers', - 'customers' => $contact['Customer'])); + +echo $this->element('customers', array + ('config' => array + ('caption' => 'Related Customers', + 'rows' => $contact['Customer'], + ))); /* End "detail supporting" div */ diff --git a/views/customers/receipt.ctp b/views/customers/receipt.ctp index a22f50a..111d48b 100644 --- a/views/customers/receipt.ctp +++ b/views/customers/receipt.ctp @@ -323,15 +323,16 @@ function updateCharges(id) { ; // align //echo '
' . "\n"; -echo $this->element('customers', - array('grid_div_id' => 'customers-list', - 'grid_div_class' => 'text-below', - 'caption' => ('Select Customer'), - 'grid_setup' => $grid_setup, - 'nolinks' => true, - 'limit' => 10, - )); +echo $this->element('customers', array + ('config' => array + ('grid_div_id' => 'customers-list', + 'grid_div_class' => 'text-below', + 'caption' => ('Select Customer'), + 'grid_setup' => $grid_setup, + 'nolinks' => true, + 'limit' => 10, + ))); echo ('

' . '