From 1702ffad58949ebe9e4769afeb9fe9c93249cf69 Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 1 Jun 2010 19:58:28 +0000 Subject: add progressbar, redirection, and improve links RT#8274 --- httemplate/elements/progress-popup.html | 8 ++++++++ httemplate/search/report_newtax.html | 11 +++++++++-- httemplate/search/report_queued_newtax.cgi | 12 +++--------- 3 files changed, 20 insertions(+), 11 deletions(-) (limited to 'httemplate') diff --git a/httemplate/elements/progress-popup.html b/httemplate/elements/progress-popup.html index 8a55efb4a..a29210201 100644 --- a/httemplate/elements/progress-popup.html +++ b/httemplate/elements/progress-popup.html @@ -69,6 +69,14 @@ function updateStatus( status_statustext ) { alert('job done but no url or message specified'); % } + } else if ( status.indexOf('done') > -1 ) { + + document.getElementById("progress_message").innerHTML = "Loading report"; + document.getElementById("progress_bar").innerHTML = ''; + document.getElementById("progress_percent").innerHTML = ''; + document.getElementById("progress_jobnum").innerHTML = ''; + window.top.location.href = statustext.substr(8, statustext.length-18); + } else if ( status.indexOf('error') > -1 ) { document.getElementById("progress_message").innerHTML = 'Error: ' + statustext + ''; document.getElementById("progress_bar").innerHTML = ''; diff --git a/httemplate/search/report_newtax.html b/httemplate/search/report_newtax.html index 2588b48d3..da39b0c4d 100755 --- a/httemplate/search/report_newtax.html +++ b/httemplate/search/report_newtax.html @@ -1,6 +1,6 @@ <% include('/elements/header.html', 'Tax Report' ) %> -
+ @@ -10,10 +10,17 @@
-
+
+<% include( '/elements/progress-init.html', + 'newtax', + [ qw( agentnum beginning ending ) ], + 'report_queued_newtax.cgi', + ) +%> + <% include('/elements/footer.html') %> <%init> diff --git a/httemplate/search/report_queued_newtax.cgi b/httemplate/search/report_queued_newtax.cgi index 1d5813ece..a375fce62 100755 --- a/httemplate/search/report_queued_newtax.cgi +++ b/httemplate/search/report_queued_newtax.cgi @@ -1,16 +1,10 @@ -<% include("/elements/header.html", "Queue Tax Report") %> -<% include("/elements/error.html") %> -% unless ($error) { -
- Report queued. Check the job queue for status. -
-% } -<% include("/elements/footer.html") %> +<% $server->process %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); -my $error = FS::tax_rate::queue_liability_report($cgi); +my $server = + new FS::UI::Web::JSRPC 'FS::tax_rate::queue_liability_report', $cgi; -- cgit v1.2.1