combine ticket notification scrips, #15353
[freeside.git] / httemplate / elements / progress-init.html
index 8b8da66..2ec248e 100644 (file)
@@ -11,6 +11,12 @@ In misc/something.html:
              $p.'misc/process_something.html',
              { url => $p.'where_to_go_next.html' },
          #or { message => 'Finished!' },
+         #or { url => $p.'where_to_go.html',
+               message => 'Finished' },
+         # which displays the message, then waits for confirmation before 
+         # redirecting to the URL.
+         #or { popup_url => $p.'popup_contents.html' }
+         # which loads that URL into the popup after completion
          ) %>
   </FORM>
   <SCRIPT TYPE="text/javascript>process();</SCRIPT>
@@ -48,7 +54,10 @@ sub process_whatever { #class method
            )
 %>
 
-<% include('/elements/init_overlib.html') %>
+% if (!$noinit) { 
+<& /elements/init_overlib.html &>
+%   $noinit = 1;
+% }
 
 <SCRIPT TYPE="text/javascript">
 
@@ -108,6 +117,9 @@ function <%$key%>myCallback( jobnum ) {
 
 </SCRIPT>
 
+<%once>
+my $noinit = 0;
+</%once>
 <%init>
 
 my( $formname, $fields, $action, $url_or_message, $key ) = @_;
@@ -118,6 +130,9 @@ if ( ref($url_or_message) ) { #its a message or something
   $url_or_message_link = 'message='. uri_escape( $url_or_message->{'message'} );
   $url_or_message_link .= ';url='.   uri_escape( $url_or_message->{'url'} )
     if $url_or_message->{'url'};
+  $url_or_message_link = 'popup_url=' .uri_escape( $url_or_message->{'popup_url'} )
+    if $url_or_message->{'popup_url'};
+
 } else {
   $url_or_message_link = "url=$url_or_message";
 }