diff options
author | mark <mark> | 2010-07-06 12:18:11 +0000 |
---|---|---|
committer | mark <mark> | 2010-07-06 12:18:11 +0000 |
commit | 4a5fcee4c1aa3ca07ac0a7921f9bd0e645ddc788 (patch) | |
tree | 7bd4b6a1ccfd7d79ef5c91fb54d59bad00bdd6a7 /httemplate/elements | |
parent | f52e5491164eb407549716ebfd36fae6f692b1c1 (diff) |
"Bill now" link uses job queue/progressbar, RT#8995
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/bill.html | 49 | ||||
-rw-r--r-- | httemplate/elements/progress-init.html | 6 |
2 files changed, 51 insertions, 4 deletions
diff --git a/httemplate/elements/bill.html b/httemplate/elements/bill.html new file mode 100644 index 000000000..335779a0f --- /dev/null +++ b/httemplate/elements/bill.html @@ -0,0 +1,49 @@ +<%doc> +Clickable link to bill a customer. + +Example: +<FORM name="MyForm"> +<% include( '/elements/bill.html', + ### + # required + ### + custnum => $custnum, + label => 'Bill Now!', + formname => 'MyForm', + + ### + # recommended + ### + url => $p.'view/cust_main.cgi?'.$custnum, + + ### + # optional, can contain any FS::cust_main::bill_and_collect options + ### + bill_opts => { 'batch_card' => 'yes' }, +) %> +</FORM> +</%doc> +<% include('/elements/progress-init.html', + $formname, + [ 'custnum', @opt_keys ], + $p.'misc/bill.cgi', + $url ? { url => $url } : { message => $message }, + $key, +) %> +<A HREF="javascript:void(0);" onclick="javascript:<%$key%>process();"><%$label%></A> +<INPUT TYPE="hidden" NAME="custnum" VALUE="<%$custnum%>"> +% foreach(@opt_keys) { +<INPUT TYPE="hidden" NAME="<%$_%>" VALUE="<%$bill_opts->{$_}%>"> +% } +<%init> +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!'; +my $bill_opts = $opt{'bill_opts'} || {}; +my @opt_keys = keys(%$bill_opts); +my @opt_vals = values(%$bill_opts); +</%init> diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 20eb9bfa6..8b8da66c8 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -11,7 +11,7 @@ In misc/something.html: $p.'misc/process_something.html', { url => $p.'where_to_go_next.html' }, #or { message => 'Finished!' }, - ); + ) %> </FORM> <SCRIPT TYPE="text/javascript>process();</SCRIPT> @@ -36,11 +36,9 @@ sub process_whatever { #class method do_phase3; $job->update_statustext(60); # etc. - return 'BLAH BLAH NOBODY WILL EVER SEE THIS RETURN VALUE'; + return 'this value will be ignored'; } -I am not responsible for errors in the above documentation. - </%doc> <% include('/elements/xmlhttp.html', 'method' => 'POST', |