[freeside-commits] freeside/httemplate/edit cust_credit.cgi, 1.21, 1.22
Ivan,,,
ivan at wavetail.420.am
Mon Mar 31 23:34:19 PDT 2008
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv32513/edit
Modified Files:
cust_credit.cgi
Log Message:
popup iframes don't have predictable names anymore, so locate submit buttons by id instead
Index: cust_credit.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_credit.cgi,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cust_credit.cgi 13 Jan 2008 21:35:52 -0000 1.21
+++ cust_credit.cgi 1 Apr 2008 06:34:17 -0000 1.22
@@ -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 @@
<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 @@
<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 @@
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>
More information about the freeside-commits
mailing list