summaryrefslogtreecommitdiff
path: root/httemplate/elements/bill.html
diff options
context:
space:
mode:
authormark <mark>2010-07-12 22:55:25 +0000
committermark <mark>2010-07-12 22:55:25 +0000
commitcf69551b63fb966966938ca2b9c6201a5f40a1f9 (patch)
tree64e262e9c42d1b43269d9cc9b957e363e5f18be8 /httemplate/elements/bill.html
parent9569b2f1e6147f97bfacb41bc94c6605eb59206f (diff)
fix "Bill now" link, RT#9207
Diffstat (limited to 'httemplate/elements/bill.html')
-rw-r--r--httemplate/elements/bill.html14
1 files changed, 8 insertions, 6 deletions
diff --git a/httemplate/elements/bill.html b/httemplate/elements/bill.html
index bb2b3ed4a..64a1a6d2c 100644
--- a/httemplate/elements/bill.html
+++ b/httemplate/elements/bill.html
@@ -9,7 +9,6 @@ Example:
###
custnum => $custnum,
label => 'Bill Now!',
- formname => 'MyForm',
###
# recommended
@@ -20,18 +19,19 @@ Example:
# 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 @@ Example:
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'} || {};