X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fbill_batch.cgi;h=3cdb3e3b8735906a982a89c3ddf567df6c431df7;hb=3124e61950c0a502018cc5fb0f5977f20958a87f;hp=a181aab570510779ed0fdf20e28bf4360562d5fb;hpb=873ec8e0528b7a944aec88936538fe9a04cd0b3f;p=freeside.git
diff --git a/httemplate/search/bill_batch.cgi b/httemplate/search/bill_batch.cgi
index a181aab57..3cdb3e3b8 100755
--- a/httemplate/search/bill_batch.cgi
+++ b/httemplate/search/bill_batch.cgi
@@ -1,18 +1,31 @@
% my $batchnum = $cgi->param('download');
% if ( $batchnum =~ /^\d+$/ ) {
-% $cgi->delete('download');
+% my $download = $p."misc/download-bill_batch.html?$batchnum";
Starting download...
-
+
+
+
+
<& /elements/footer.html &>
% }
% else {
+%# delete existing download cookie
+% my $cookie = CGI::Cookie->new(
+% -name => 'bill_batch_download',
+% -value => 0,
+% -expires => '-1d',
+% );
+% $r->headers_out->add( 'Set-Cookie' => $cookie->as_string );
<% include( 'elements/search.html',
'title' => 'Invoice Batches',
'name_singular' => 'batch',
@@ -49,10 +62,29 @@ function refreshParent() {
'',
],
'really_disable_download' => 1,
+ 'html_foot' => include('.foot'),
)
%>
%}
+<%def .foot>
+
+%def>
<%init>
die "access denied"
@@ -65,7 +97,6 @@ my $count_query = 'SELECT COUNT(*) FROM bill_batch';
my $extra_sql = ''; # may add something here later
my $link = [ "${p}view/bill_batch.cgi?batchnum=", 'batchnum' ];
-my $download_id = int(rand(1000000));
sub download_link {
my $batch = shift;
@@ -79,10 +110,10 @@ sub download_link {
"Download$batchnum",
[ 'batchnum', 'close' ],
$p.'misc/process/bill_batch-print.html',
- { url => $p."search/bill_batch.cgi?download=$batchnum" },
+ { popup_url => $p."search/bill_batch.cgi?download=$batchnum" },
"batch$batchnum" #key
);
- $html .= '' .
+ $html .= '' .
($batch->status eq 'O' ? 'Download and close' : 'Download');
$html .= '';
return $html;