While working on payments, commented out the form reset stuff so I don't have to keep reentering the data with every post. Also, changed the customer ID to be passed outside of 'Customer', which appears to cake as a model that needs to be updated. Finally, added a bogus parameter, until I can figure out why the Model::set() function fails to recognize model fields if the first item in the model array is another Model. This bogus field just ensures Model::set uses all the fields, and bogus is ultimately ignored since it's not a member of LedgerEntry.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@169 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-19 16:17:14 +00:00
parent f7bcfef665
commit 3c067f6586

View File

@@ -84,10 +84,10 @@ $grid_setup['onSelectRow'] = array
// other available options:
//url: url, // override for form's 'action' attribute
//type: type, // 'get' or 'post', override for form's 'method' attribute
//type: 'get', // 'get' or 'post', override for form's 'method' attribute
//dataType: null, // 'xml', 'script', or 'json' (expected server response type)
//clearForm: true, // clear all form fields after successful submit
resetForm: true, // reset the form after successful submit
//resetForm: true, // reset the form after successful submit
// $.ajax options can be used here too, for example:
//timeout: 3000,
@@ -132,7 +132,7 @@ $grid_setup['onSelectRow'] = array
if (statusText == 'success') {
// get a clean slate
resetPaymentForm();
//resetPaymentForm();
}
else {
alert('not successful??');
@@ -175,6 +175,7 @@ $grid_setup['onSelectRow'] = array
foreach ($types AS $type => $name) {
$div = '<DIV>';
$div .= '<INPUT TYPE="hidden" NAME="data[LedgerEntry][%{id}][bogus]" VALUE="1">';
$div .= '<INPUT TYPE="radio" NAME="data[LedgerEntry][%{id}][MonetarySource][monetary_type_id]"';
$div .= ' ONCLICK="switchPaymentType(%{id}, \\\''.$type.'\\\')"';
$div .= ' CLASS="payment-type-%{id}" ID="payment-type-'.$type.'-%{id}"';
@@ -422,7 +423,7 @@ echo $form->create(null, array('id' => 'payment-form',
***************************************************/
?>
<input type="hidden" id="customer-id" name="data[Customer][id]" value="<?php echo $customer['id']; ?>">
<input type="hidden" id="customer-id" name="data[customer_id]" value="<?php echo $customer['id']; ?>">
<fieldset CLASS="payment superset">
<legend>Payments</legend>