[freeside-commits] freeside/httemplate/elements bill.html,1.2,1.3

Mark Wells mark at wavetail.420.am
Mon Jul 12 15:55:27 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv11826/httemplate/elements

Modified Files:
	bill.html 
Log Message:
fix "Bill now" link, RT#9207

Index: bill.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/bill.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- bill.html	10 Jul 2010 09:17:08 -0000	1.2
+++ bill.html	12 Jul 2010 22:55:25 -0000	1.3
@@ -9,7 +9,6 @@
             ###
             custnum   => $custnum,
             label     => 'Bill Now!',
-            formname  => 'MyForm',
 
             ###
             # recommended
@@ -20,18 +19,19 @@
             # optional, can contain any FS::cust_main::bill_and_collect options
             ###
             bill_opts => { 'batch_card' => 'yes' },
+            formname  => 'MyBillNowLink', # if for some reason you want this
 ) %>
 
 </%doc>
-<FORM STYLE="display:inline">
+<FORM NAME="<%$formname%>" STYLE="display:inline">
 <% include('/elements/progress-init.html',
           $formname,
           [ 'custnum', @opt_keys ],
           $p.'misc/bill.cgi',
           $url ? { url => $url } : { message => $message },
-          $key,
+          $formname, # use it as 'key'
 ) %>
-<A HREF="javascript:void(0);" onclick="javascript:<%$key%>process();"><%$label%></A>
+<A HREF="javascript:void(0);" onclick="javascript:<%$formname%>process();"><%$label%></A>
 <INPUT TYPE="hidden" NAME="custnum" VALUE="<%$custnum%>">
 % foreach(@opt_keys) {
 <INPUT TYPE="hidden" NAME="<%$_%>" VALUE="<%$bill_opts->{$_}%>">
@@ -42,8 +42,10 @@
 my %opt = @_;
 my $custnum   = $opt{'custnum'};
 my $label     = $opt{'label'};
-my $formname  = $opt{'formname'};
-my $key       = $formname.'bill'.$custnum;
+# formname no longer needs to be passed from outside, but we still 
+# need one and it needs to be unique
+my $formname  = $opt{'formname'} ||
+                'bill'.sprintf('%04d',int(rand(10000))).$custnum;
 my $url       = $opt{'url'} || '';
 my $message   = $opt{'message'} || 'Finished!';
 my $bill_opts = $opt{'bill_opts'} || {};



More information about the freeside-commits mailing list