summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authormark <mark>2010-06-08 22:25:01 +0000
committermark <mark>2010-06-08 22:25:01 +0000
commitb7dbecfb82aea90a4289089927d0b17436b2ed5a (patch)
tree8f22377f952d54aba7efcde11a2cd3f2e8a8cf40 /httemplate/elements
parent3d0320979331ac4b68fc07fd4203d74c1b05aff4 (diff)
RT#947: batch download of invoice PDFs
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/menu.html2
-rw-r--r--httemplate/elements/progress-init.html44
2 files changed, 46 insertions, 0 deletions
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 5ce49c3a7..ef105b1d6 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -357,6 +357,8 @@ $tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Ente
$tools_menu{'Process payment batches'} = [ $fsurl.'search/pay_batch.cgi?magic=_date;open=1;intransit=1', 'Process credit card and electronic check batches' ]
if ( $conf->exists('batch-enable') || $conf->config('batch-enable_payby') )
&& $curuser->access_right('Process batches');
+$tools_menu{'Process invoice batches'} = [ $fsurl.'search/bill_batch.cgi' ]
+ if ( $conf->exists('invoice_print_pdf') );
$tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ]
if $curuser->access_right('Job queue');
$tools_menu{'Ticketing'} = [ \%tools_ticketing, 'Ticketing tools' ]
diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html
index 194fc7480..20eb9bfa6 100644
--- a/httemplate/elements/progress-init.html
+++ b/httemplate/elements/progress-init.html
@@ -1,3 +1,47 @@
+<%doc>
+Example:
+In misc/something.html:
+
+ <FORM NAME="MyForm">
+ <INPUT TYPE="hidden" NAME="recordnum" VALUE="42">
+ <INPUT TYPE="hidden" NAME="what_to_do" VALUE="delete">
+ <% include( '/elements/progress-init.html',
+ 'MyForm',
+ [ 'recordnum', 'what_to_do' ],
+ $p.'misc/process_something.html',
+ { url => $p.'where_to_go_next.html' },
+ #or { message => 'Finished!' },
+ );
+ </FORM>
+ <SCRIPT TYPE="text/javascript>process();</SCRIPT>
+
+In misc/process_something.html:
+
+<%init>
+my $server = FS::UI::Web::JSRPC->new('FS::something::process_whatever', $cgi);
+</%init>
+<% $server->process %>
+
+In FS/something.pm:
+
+sub process_whatever { #class method
+ my $job = shift;
+ my $param = thaw(base64_decode(shift));
+ # param = { 'recordnum' => 42, 'what_to_do' => delete }
+ # make use of this as you like
+ do_phase1;
+ $job->update_statustext(20);
+ do_phase2;
+ $job->update_statustext(40);
+ do_phase3;
+ $job->update_statustext(60);
+ # etc.
+ return 'BLAH BLAH NOBODY WILL EVER SEE THIS RETURN VALUE';
+}
+
+I am not responsible for errors in the above documentation.
+
+</%doc>
<% include('/elements/xmlhttp.html',
'method' => 'POST',
'url' => $action,