I believe the bug Shirley has been seeing is finally fixed. The problem is that an extra comma at the end of a javascript object literal blows up in IE7. FF and IE8 both handle it fine, which is why we hadn't noticed. Hopefully, this change includes all areas which had the extra comma.

git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@842 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-09-07 17:04:34 +00:00
parent 3642724b5e
commit 3e3dff31a8
3 changed files with 14 additions and 74 deletions

View File

@@ -25,12 +25,12 @@ Configure::write('debug', '0');
beforeSubmit: verifyRequest, // pre-submit callback beforeSubmit: verifyRequest, // pre-submit callback
success: showResponse, // post-submit callback success: showResponse, // post-submit callback
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postReceipt', 0)); ?>",
// other available options: // other available options:
//clearForm: true, // clear all form fields after successful submit //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
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postReceipt', 0)); ?>"
}; };
// bind form using 'ajaxForm' // bind form using 'ajaxForm'

View File

@@ -74,9 +74,9 @@ jQuery(document).ready(function(){
jQuery("#sidemenu").accordion jQuery("#sidemenu").accordion
({ fillSpace : true, ({ fillSpace : true,
event : "click hoverintent", event : "click hoverintent",
animated : "bounceslide", animated : "bounceslide"
JSCB JSCB
. (isset($active_section) ? "\tactive : $active_section,\n" : '') . . (isset($active_section) ? ",\n\t active : $active_section\n" : '') .
<<<JSCB <<<JSCB
}); });
} }

View File

@@ -24,36 +24,27 @@ Configure::write('debug', '0');
?> ?>
<script type="text/javascript"><!-- <script type="text/javascript"><!--
var debugmsg = new Array();
// prepare the form when the DOM is ready // prepare the form when the DOM is ready
$(document).ready(function() { $(document).ready(function() {
debugmsg.push('doc ready1');
var options = { var options = {
target: '#output-debug', // target element(s) to be updated with server response target: '#output-debug', // target element(s) to be updated with server response
beforeSubmit: verifyRequest, // pre-submit callback beforeSubmit: verifyRequest, // pre-submit callback
success: showResponse, // post-submit callback success: showResponse, // post-submit callback
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postInvoice', 0)); ?>",
// other available options: // other available options:
//clearForm: true, // clear all form fields after successful submit //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
url: "<?php echo $html->url(array('controller' => 'transactions',
'action' => 'postInvoice', 0)); ?>"
}; };
// bind form using 'ajaxForm' // bind form using 'ajaxForm'
if ($('#invoice-form').ajaxForm != null) { if ($('#invoice-form').ajaxForm != null)
debugmsg.push('bind ajaxForm');
$('#invoice-form').ajaxForm(options); $('#invoice-form').ajaxForm(options);
debugmsg.push('ajaxForm bound'); else
}
else {
debugmsg.push('remove repeat label');
$('#repeat, label[for=repeat]').remove(); $('#repeat, label[for=repeat]').remove();
}
}); });
// pre-submit callback // pre-submit callback
@@ -131,13 +122,11 @@ function showResponse(responseText, statusText) {
// Reset the form // Reset the form
function resetForm(nocharge) { function resetForm(nocharge) {
debugmsg.push('reset form: ' + nocharge);
$('#charge-entry-id').val(1); $('#charge-entry-id').val(1);
$('#charges').html(''); $('#charges').html('');
if (!nocharge) if (!nocharge)
addChargeSource(false); addChargeSource(false);
debugmsg.push('reset form done');
} }
@@ -163,7 +152,6 @@ function onRowSelect(grid_id, lease_id) {
} }
function onGridState(grid_id, state) { function onGridState(grid_id, state) {
debugmsg.push('on grid state: ' + grid_id + '; ' + state + '; lid=' + $("#lease-id").val());
if (state == 'visible') { if (state == 'visible') {
$(".lease-selection-invalid").hide(); $(".lease-selection-invalid").hide();
$(".lease-selection-valid").hide(); $(".lease-selection-valid").hide();
@@ -177,12 +165,10 @@ function onGridState(grid_id, state) {
$(".lease-selection-invalid").show(); $(".lease-selection-invalid").show();
} }
} }
debugmsg.push('on grid state done');
} }
function addChargeSource(flash) { function addChargeSource(flash) {
var id = $("#charge-entry-id").val(); var id = $("#charge-entry-id").val();
debugmsg.push('add charge source: flash=' + flash + '; id=' + id);
addDiv('charge-entry-id', 'charge', 'charges', flash, addDiv('charge-entry-id', 'charge', 'charges', flash,
// HTML section // HTML section
'<FIELDSET CLASS="charge subset">' + '<FIELDSET CLASS="charge subset">' +
@@ -218,14 +204,10 @@ function addChargeSource(flash) {
'</FIELDSET>' '</FIELDSET>'
); );
debugmsg.push('add div complete: id=' + id);
debugmsg.push('add datepicker1: id=' + id);
datepicker("Entry"+id+"EffectiveDate"); datepicker("Entry"+id+"EffectiveDate");
debugmsg.push('add datepicker2: id=' + id);
datepicker("Entry"+id+"ThroughDate"); datepicker("Entry"+id+"ThroughDate");
debugmsg.push('add charge source complete: id=' + id);
return id; return id;
} }
@@ -295,11 +277,6 @@ if (!empty($movein))
'type' => 'hidden', 'type' => 'hidden',
'value' => $customer['id'])); 'value' => $customer['id']));
echo $form->input("Message.text",
array('id' => 'message-text',
'type' => 'hidden',
'value' => 'not set'));
/* echo '<fieldset CLASS="invoice">' . "\n"; */ /* echo '<fieldset CLASS="invoice">' . "\n"; */
/* echo ' <legend>Invoice</legend>' . "\n"; */ /* echo ' <legend>Invoice</legend>' . "\n"; */
@@ -348,40 +325,13 @@ Configure::write('debug', '0');
?> ?>
<script type="text/javascript"><!-- <script type="text/javascript"><!--
$('#message-text').val('javascript working');
if (typeof(jQuery) != 'undefined')
debugmsg.push('jQuery loaded');
else
debugmsg.push('jQuery NOT loaded');
if ($().accordion)
debugmsg.push('accordion loaded');
else
debugmsg.push('accordion NOT loaded');
if ($().ajaxForm)
debugmsg.push('ajaxForm loaded');
else
debugmsg.push('ajaxForm NOT loaded');
var eatt = debugmsg;
eatt.push('early attempt');
$('#message-text').val(eatt.join("\n "));
$.fn.removeCol = function(col){ $.fn.removeCol = function(col){
if(!col){ col = 1; } if(!col){ col = 1; }
$('tr td:nth-child('+col+'), tr th:nth-child('+col+')', this).remove(); $('tr td:nth-child('+col+'), tr th:nth-child('+col+')', this).remove();
}; };
eatt.push('early attempt2');
$('#message-text').val(eatt.join("\n "));
$(document).ready(function(){ $(document).ready(function(){
debugmsg.push('doc ready2');
debugmsg.push('make transaction-stamp datepicker');
datepicker('TransactionStamp'); datepicker('TransactionStamp');
debugmsg.push('datepicker OK');
$("#lease-id").val(0); $("#lease-id").val(0);
$("#invoice-lease").html("INTERNAL ERROR"); $("#invoice-lease").html("INTERNAL ERROR");
@@ -393,14 +343,11 @@ Configure::write('debug', '0');
<?php if (empty($movein)): ?> <?php if (empty($movein)): ?>
debugmsg.push('movein empty');
resetForm(); resetForm();
debugmsg.push('transaction-stamp now');
datepickerNow('TransactionStamp'); datepickerNow('TransactionStamp');
<?php else: ?> <?php else: ?>
debugmsg.push('movein not empty');
var id; var id;
resetForm(true); resetForm(true);
@@ -482,13 +429,6 @@ Configure::write('debug', '0');
$('#output-debug').show(); $('#output-debug').show();
<?php endif; ?> <?php endif; ?>
$.post("<?php echo $html->url(array('controller' => 'util',
'action' => 'logmsg')); ?>",
{ 'messages[]' : debugmsg }
);
//$('#debug').html(debugmsg.join('<BR>'));
$('#message-text').val(debugmsg.join("\n "));
}); });
--></script> --></script>