X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fprogress-popup.html;h=73440bbc386667214c53f6b3e16777fe2da5222e;hb=ea79c3b7eff3f274d9d7f923891853a72cc1474f;hp=cda704a12c7e3e5977d52a6b28beccb6195fa67b;hpb=7871134261d6ee6304ea7164966f6058cb3b6400;p=freeside.git diff --git a/httemplate/elements/progress-popup.html b/httemplate/elements/progress-popup.html index cda704a12..73440bbc3 100644 --- a/httemplate/elements/progress-popup.html +++ b/httemplate/elements/progress-popup.html @@ -2,6 +2,7 @@ % my $jobnum = $cgi->param('jobnum'); % my $url = $cgi->param('url'); % my $message = $cgi->param('message'); +% my $popup_url = $cgi->param('popup_url'); % my $formname = scalar($cgi->param('formname')); % @@ -31,32 +32,52 @@ function updateStatus( status_statustext ) { var statusArray = eval('(' + status_statustext + ')'); var status = statusArray[0]; var statustext = statusArray[1]; + var actiontext = statusArray[2]; //if ( status == 'progress' ) { //IE workaround, no i have no idea why if ( status.indexOf('progress') > -1 ) { + document.getElementById("progress_message").innerHTML = actiontext + '...'; document.getElementById("progress_percent").innerHTML = statustext + '%'; bar1.set(statustext); bar1.update; //jsrsExecute( '<%$p%>elements/jsrsServer.html', updateStatus, 'job_status', '<% $jobnum %>' ); job_status( '<% $jobnum %>', updateStatus ); } else if ( status.indexOf('complete') > -1 ) { -% if ( $message ) { +% if ( $message ) { +% +% my $onClick = $url +% ? "window.top.location.href = \\'$url\\';" +% : 'parent.nd(1);'; document.getElementById("progress_message").innerHTML = "<% $message %>"; document.getElementById("progress_bar").innerHTML = ''; - document.getElementById("progress_percent").innerHTML = ''; + document.getElementById("progress_percent").innerHTML = + ''; document.getElementById("progress_jobnum").innerHTML = ''; - if ( parent.document.<%$formname%>.submit.disabled == true ) { - parent.document.<%$formname%>.submit.disabled=false; - } + +% unless ( $url ) { + if ( parent.document.<%$formname%>.submit.disabled == true ) { + parent.document.<%$formname%>.submit.disabled=false; + } +% } + % } elsif ( $url ) { window.top.location.href = '<% $url %>'; +% } elsif ( $popup_url ) { + document.location.replace('<% $popup_url %>'); % } else { 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 + '';