From 145e7ee0b767e95c229657680ae477bb693ac7fc Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 1 Apr 2008 06:34:17 +0000 Subject: popup iframes don't have predictable names anymore, so locate submit buttons by id instead --- httemplate/edit/cust_credit.cgi | 44 +++++++++++++---------------------------- 1 file changed, 14 insertions(+), 30 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi index 36109cf5d..c9ca31ff3 100755 --- a/httemplate/edit/cust_credit.cgi +++ b/httemplate/edit/cust_credit.cgi @@ -4,7 +4,7 @@
- + @@ -20,18 +20,19 @@ Credit Amount - $ + $ % %#print qq! 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, + ) %> @@ -43,7 +44,7 @@ Credit
-
+
@@ -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); -- cgit v1.2.1