combine ticket notification scrips, #15353
[freeside.git] / httemplate / elements / progress-popup.html
index 8a55efb..2d27388 100644 (file)
@@ -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'));
 %
 
@@ -62,12 +63,22 @@ function updateStatus( status_statustext ) {
 %   }
 
 % } elsif ( $url ) { 
-
+    parent.nd(1);
     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 = '<FONT SIZE="+1" COLOR="#FF0000">Error: ' + statustext + '</FONT>';