X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fbill_batch.cgi;h=b740bdc68ac9517e3c856b7f9a79cd725efff352;hp=cbd7f270a3800c33bd40b45ee5864e5574363375;hb=f30eaaf66cd0a947f388a03edd4522ba92a367bb;hpb=007fd3026ade508a9d88b436575a4797d003280a diff --git a/httemplate/search/bill_batch.cgi b/httemplate/search/bill_batch.cgi index cbd7f270a..b740bdc68 100755 --- a/httemplate/search/bill_batch.cgi +++ b/httemplate/search/bill_batch.cgi @@ -1,19 +1,32 @@ % my $batchnum = $cgi->param('download'); % if ( $batchnum =~ /^\d+$/ ) { -% $cgi->delete('download'); +% my $download = $p."misc/download-bill_batch.html?$batchnum"; Starting download... - + + + +
+Click here if your download does not start +
<& /elements/footer.html &> % } % else { -<% include( 'elements/search.html', +%# 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 ); +<& elements/search.html, 'title' => 'Invoice Batches', 'name_singular' => 'batch', 'query' => { 'table' => 'bill_batch', @@ -52,11 +65,28 @@ function refreshParent() { 'agent_virt' => 1, 'agent_null_right' => [ 'Process global invoice batches', 'Configuration' ], 'agent_pos' => 1, + 'html_foot' => include('.foot'), - ) - -%> +&> %} +<%def .foot> + + <%init> my $curuser = $FS::CurrentUser::CurrentUser; @@ -76,8 +106,6 @@ my $count_query = "SELECT COUNT(*) FROM bill_batch WHERE". # $extra_sql AND " #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; my $batchnum = $batch->batchnum; @@ -90,10 +118,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;