Fixed url generation since it was not propogating the admin/dev routing items. Also modified the invoice at move in to exclude the customer list, and to transition directly to the receipt page afterwards.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@556 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-14 21:05:36 +00:00
parent 4472a124f5
commit 90bf9bac0a
2 changed files with 58 additions and 25 deletions

View File

@@ -91,7 +91,10 @@ function onRowSelect(grid_id, customer_id) {
// This is not intended as a long term solution, // This is not intended as a long term solution,
// but I need a way to enter data and then view // but I need a way to enter data and then view
// the results. This link will help. // the results. This link will help.
$("#receipt-customer-id").html('<A HREF="/pmgr/site/customers/view/' + $("#receipt-customer-id").html('<A HREF="' +
"<?php echo $html->url(array('controller' => 'customers',
'action' => 'view')); ?>"
+ "/" +
$(grid_id).getCell(customer_id, 'Customer-id').replace(/^#/,'') + $(grid_id).getCell(customer_id, 'Customer-id').replace(/^#/,'') +
'">' + '">' +
$(grid_id).getCell(customer_id, 'Customer-id') + $(grid_id).getCell(customer_id, 'Customer-id') +
@@ -406,7 +409,10 @@ Configure::write('debug', '0');
<?php if (isset($customer['id'])): ?> <?php if (isset($customer['id'])): ?>
$("#customer-id").val(<?php echo $customer['id']; ?>); $("#customer-id").val(<?php echo $customer['id']; ?>);
//$("#receipt-customer-id").html("<?php echo '#'.$customer['id']; ?>"); //$("#receipt-customer-id").html("<?php echo '#'.$customer['id']; ?>");
$("#receipt-customer-id").html('<A HREF="/pmgr/site/customers/view/' + $("#receipt-customer-id").html('<A HREF="' +
"<?php echo $html->url(array('controller' => 'customers',
'action' => 'view')); ?>"
+ "/" +
"<?php echo $customer['id']; ?>" + "<?php echo $customer['id']; ?>" +
'">#' + '">#' +
"<?php echo $customer['id']; ?>" + "<?php echo $customer['id']; ?>" +
@@ -421,6 +427,11 @@ Configure::write('debug', '0');
resetForm(); resetForm();
datepickerNow('TransactionStamp'); datepickerNow('TransactionStamp');
<?php if ($this->params['dev']): ?>
$('#output-debug').html('Post Output');
$('#output-debug').show();
<?php endif; ?>
}); });
--></script> --></script>

View File

@@ -64,9 +64,15 @@ function showResponse(responseText, statusText) {
if (!$("#repeat").attr("checked")) { if (!$("#repeat").attr("checked")) {
window.location.href = window.location.href =
<?php if (empty($movein)): ?>
"<?php echo $html->url(array('controller' => 'leases', "<?php echo $html->url(array('controller' => 'leases',
'action' => 'view')); ?>" 'action' => 'view')); ?>"
+ "/" + $("#lease-id").val(); + "/" + $("#lease-id").val();
<?php else: ?>
"<?php echo $html->url(array('controller' => 'customers',
'action' => 'receipt')); ?>"
+ "/" + $("#lease-id").val();
<?php endif; ?>
return; return;
} }
@@ -99,7 +105,10 @@ function onRowSelect(grid_id, lease_id) {
// This is not intended as a long term solution, // This is not intended as a long term solution,
// but I need a way to enter data and then view // but I need a way to enter data and then view
// the results. This link will help. // the results. This link will help.
$("#invoice-lease").html('<A HREF="/pmgr/site/leases/view/' + $("#invoice-lease").html('<A HREF="' +
"<?php echo $html->url(array('controller' => 'leases',
'action' => 'view')); ?>"
+ "/" +
$(grid_id).getCell(lease_id, 'Lease-id').replace(/^#/,'') + $(grid_id).getCell(lease_id, 'Lease-id').replace(/^#/,'') +
'">' + '">' +
$(grid_id).getCell(lease_id, 'Lease-number') + $(grid_id).getCell(lease_id, 'Lease-number') +
@@ -198,23 +207,24 @@ function addChargeSource(flash) {
// Re-Enable warnings // Re-Enable warnings
Configure::write('debug', $saved_debug_state); Configure::write('debug', $saved_debug_state);
echo $this->element('leases', array if (empty($movein))
('config' => array echo $this->element('leases', array
('grid_div_id' => 'leases-list', ('config' => array
'grid_div_class' => 'text-below', ('grid_div_id' => 'leases-list',
'caption' => ('<A HREF="#" ONCLICK="$(\'#leases-list .HeaderButton\').click();'. 'grid_div_class' => 'text-below',
' return false;">Select Lease</A>'), 'caption' => ('<A HREF="#" ONCLICK="$(\'#leases-list .HeaderButton\').click();'.
'grid_setup' => array('hiddengrid' => isset($lease['id'])), ' return false;">Select Lease</A>'),
'grid_events' => array('onSelectRow' => 'grid_setup' => array('hiddengrid' => isset($lease['id'])),
array('ids' => 'grid_events' => array('onSelectRow' =>
'if (ids != null){onRowSelect("#"+$(this).attr("id"), ids);}'), array('ids' =>
'onHeaderClick' => 'if (ids != null){onRowSelect("#"+$(this).attr("id"), ids);}'),
array('gridstate' => 'onHeaderClick' =>
'onGridState("#"+$(this).attr("id"), gridstate)'), array('gridstate' =>
), 'onGridState("#"+$(this).attr("id"), gridstate)'),
'nolinks' => true, ),
'limit' => 10, 'nolinks' => true,
))); 'limit' => 10,
)));
echo ('<DIV CLASS="invoice grid-selection-text">' . echo ('<DIV CLASS="invoice grid-selection-text">' .
@@ -266,10 +276,13 @@ echo $this->element('form_table',
/* echo '</fieldset>' . "\n"; */ /* echo '</fieldset>' . "\n"; */
echo "<BR>\n"; if (empty($movein)) {
echo $form->input('repeat', array('type' => 'checkbox', echo "<BR>\n";
'id' => 'repeat', echo $form->input('repeat', array('type' => 'checkbox',
'label' => 'Enter Multiple Invoices')) . "\n"; 'id' => 'repeat',
'label' => 'Enter Multiple Invoices')) . "\n";
}
echo $form->submit('Generate Invoice') . "\n"; echo $form->submit('Generate Invoice') . "\n";
?> ?>
@@ -386,7 +399,10 @@ Configure::write('debug', '0');
<?php if (isset($lease['id'])): ?> <?php if (isset($lease['id'])): ?>
$("#lease-id").val(<?php echo $lease['id']; ?>); $("#lease-id").val(<?php echo $lease['id']; ?>);
//$("#invoice-lease").html("<?php echo '#'.$lease['number']; ?>"); //$("#invoice-lease").html("<?php echo '#'.$lease['number']; ?>");
$("#invoice-lease").html('<A HREF="/pmgr/site/leases/view/' + $("#invoice-lease").html('<A HREF="' +
"<?php echo $html->url(array('controller' => 'leases',
'action' => 'view')); ?>"
+ "/" +
"<?php echo $lease['id']; ?>" + "<?php echo $lease['id']; ?>" +
'">#' + '">#' +
"<?php echo $lease['number']; ?>" + "<?php echo $lease['number']; ?>" +
@@ -400,6 +416,12 @@ Configure::write('debug', '0');
<?php else: ?> <?php else: ?>
onGridState(null, 'visible'); onGridState(null, 'visible');
<?php endif; ?> <?php endif; ?>
<?php if ($this->params['dev']): ?>
$('#output-debug').html('Post Output');
$('#output-debug').show();
<?php endif; ?>
}); });
--></script> --></script>