diff options
author | ivan <ivan> | 2008-04-01 06:34:17 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-04-01 06:34:17 +0000 |
commit | 145e7ee0b767e95c229657680ae477bb693ac7fc (patch) | |
tree | 3ebedb066ab55bd2c8042702351443416e58f91d | |
parent | 613d148f17c40763986df9e53fe7476b3e49af9c (diff) |
popup iframes don't have predictable names anymore, so locate submit buttons by id instead
-rwxr-xr-x | httemplate/edit/cust_credit.cgi | 44 | ||||
-rw-r--r-- | httemplate/misc/cancel_cust.html | 4 | ||||
-rwxr-xr-x | httemplate/misc/cancel_pkg.html | 4 |
3 files changed, 18 insertions, 34 deletions
diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi index 36109cf..c9ca31f 100755 --- a/httemplate/edit/cust_credit.cgi +++ b/httemplate/edit/cust_credit.cgi @@ -4,7 +4,7 @@ <FORM NAME="credit_popup" ACTION="<% $p1 %>process/cust_credit.cgi" METHOD=POST> <INPUT TYPE="hidden" NAME="crednum" VALUE=""> -<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>"> +<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum |h %>"> <INPUT TYPE="hidden" NAME="paybatch" VALUE=""> <INPUT TYPE="hidden" NAME="_date" VALUE="<% $_date %>"> <INPUT TYPE="hidden" NAME="credited" VALUE=""> @@ -20,18 +20,19 @@ Credit <TR> <TD ALIGN="right">Amount</TD> - <TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="amount" VALUE="<% $amount %>" SIZE=8 MAXLENGTH=8></TD> + <TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="amount" VALUE="<% $amount |h %>" SIZE=8 MAXLENGTH=8></TD> </TR> % %#print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="$refund">Also post refund!; % -<% include('/elements/tr-select-reason.html', - 'field' => 'reasonnum', - 'reason_class' => 'R', - 'control_button' => 'document.credit_popup.submit', - ) +<% include( '/elements/tr-select-reason.html', + 'field' => 'reasonnum', + 'reason_class' => 'R', + 'control_button' => "document.getElementById('confirm_credit_button')", + 'cgi' => $cgi, + ) %> <TR> @@ -43,7 +44,7 @@ Credit <BR> -<CENTER><INPUT TYPE="submit" VALUE="Enter credit"></CENTER> +<CENTER><INPUT TYPE="submit" ID="confirm_credit_button" VALUE="Enter credit" DISABLED></CENTER> </FORM> </BODY> @@ -58,27 +59,10 @@ my $conf = new FS::Conf; die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Post credit'); -my($custnum, $amount, $reason); -if ( $cgi->param('error') ) { - #$cust_credit = new FS::cust_credit ( { - # map { $_, scalar($cgi->param($_)) } fields('cust_credit') - #} ); - $custnum = $cgi->param('custnum'); - $amount = $cgi->param('amount'); - #$refund = $cgi->param('refund'); - $reason = $cgi->param('reason'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $custnum = $1; - $amount = ''; - #$refund = 'yes'; - $reason = ''; -} -my $_date = time; - -my $otaker = getotaker; - -my $p1 = popurl(1); +my $custnum = $cgi->param('custnum'); +my $amount = $cgi->param('amount'); +my $_date = time; +my $otaker = getotaker; +my $p1 = popurl(1); </%init> diff --git a/httemplate/misc/cancel_cust.html b/httemplate/misc/cancel_cust.html index 74362f8..5c2e036 100644 --- a/httemplate/misc/cancel_cust.html +++ b/httemplate/misc/cancel_cust.html @@ -18,7 +18,7 @@ 'field' => 'reasonnum', 'reason_class' => 'C', 'cgi' => $cgi, - 'control_button' => 'document.cust_cancel_popup.submit', + 'control_button' => "document.getElementById('confirm_cancel_cust_button')", ) %> @@ -26,7 +26,7 @@ <BR> <P ALIGN="CENTER"> -<INPUT TYPE="submit" NAME="submit" VALUE="Cancel customer" disabled='true'> <INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();"> +<INPUT TYPE="submit" NAME="submit" ID="confirm_cancel_cust_button" VALUE="Cancel customer" DISABLED> <INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();"> </FORM> </BODY> diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html index 8dffba7..e0e5fd1 100755 --- a/httemplate/misc/cancel_pkg.html +++ b/httemplate/misc/cancel_pkg.html @@ -43,14 +43,14 @@ 'field' => 'reasonnum', 'reason_class' => $class, 'curr_value' => $reasonnum, - 'control_button' => 'document.sc_popup.submit', + 'control_button' => "document.getElementById('confirm_cancel_pkg_button')", ) %> </TABLE> <BR> -<INPUT TYPE="submit" NAME="submit" VALUE="<% $submit %>" disabled='true'> +<INPUT TYPE="submit" NAME="submit" ID="confirm_cancel_pkg_button" VALUE="<% $submit %>" DISABLED> </FORM> </BODY> |