X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fbill.html;h=6ba8b7e60d8d19ff2d1ab279500bf5e41609f68e;hp=bb2b3ed4ae0000b8051daf8f6315aaa1ca1628b8;hb=11bbf29de447fe39e9d7155fe280a0df70fa8c3c;hpb=7903fffd694ccf7128da34023ecbbc5eb06e84e8 diff --git a/httemplate/elements/bill.html b/httemplate/elements/bill.html index bb2b3ed4a..6ba8b7e60 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, + \%args, + $formname, # use it as 'key' ) %> -<%$label%> +<%$label%> % foreach(@opt_keys) { @@ -42,12 +42,15 @@ Example: my %opt = @_; my $custnum = $opt{'custnum'}; my $label = $opt{'label'}; -my $formname = $opt{'formname'}; -my $key = $formname.'bill'.$custnum; -my $url = $opt{'url'} || ''; -my $message = $opt{'message'} || 'Finished!'; +# 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',random_id(4)).$custnum; my $bill_opts = $opt{'bill_opts'} || {}; my @opt_keys = keys(%$bill_opts); my @opt_vals = values(%$bill_opts); +my %args = ( 'message' => $opt{'message'} || mt('Customer billed') ); +$args{url} = $opt{url} if $opt{url}; +