From cf69551b63fb966966938ca2b9c6201a5f40a1f9 Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 12 Jul 2010 22:55:25 +0000 Subject: [PATCH] fix "Bill now" link, RT#9207 --- httemplate/elements/bill.html | 14 ++++++++------ httemplate/view/cust_main/billing.html | 1 - 2 files changed, 8 insertions(+), 7 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 ) %> -
+ <% include('/elements/progress-init.html', $formname, [ 'custnum', @opt_keys ], $p.'misc/bill.cgi', $url ? { url => $url } : { message => $message }, - $key, + $formname, # use it as 'key' ) %> -<%$label%> +<%$label%> % foreach(@opt_keys) { @@ -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'} || {}; diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index f1d00a19c..54c180bdd 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -9,7 +9,6 @@ Billing information (<% include('/elements/bill.html', custnum => $cust_main->custnum, label => 'Bill now', - formname => 'billnow', url => $p.'view/cust_main.cgi?'.$cust_main->custnum, ) %>) % } -- 2.11.0