Merge branch 'patch-19' of https://github.com/gjones2/Freeside
[freeside.git] / httemplate / elements / progress-init.html
index 20eb9bf..cef54b8 100644 (file)
@@ -11,7 +11,13 @@ 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>
 
@@ -36,11 +42,9 @@ sub process_whatever { #class method
   do_phase3;
   $job->update_statustext(60);
   # etc.
-  return 'BLAH BLAH NOBODY WILL EVER SEE THIS RETURN VALUE';
+  return 'this value will be ignored';
 }
 
-I am not responsible for errors in the above documentation.
-
 </%doc>
 <% include('/elements/xmlhttp.html',
               'method' => 'POST',
@@ -50,7 +54,7 @@ I am not responsible for errors in the above documentation.
            )
 %>
 
-<% include('/elements/init_overlib.html') %>
+<& /elements/init_overlib.html &>
 
 <SCRIPT TYPE="text/javascript">
 
@@ -104,7 +108,7 @@ function <%$key%>process () {
 
 function <%$key%>myCallback( jobnum ) {
 
-  overlib( OLiframeContent('<%$p%>elements/progress-popup.html?jobnum=' + jobnum + ';<%$url_or_message_link%>;formname=<%$formname%>' , 444, 168, '<% $popup_name %>'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
+  overlib( OLiframeContent('<%$fsurl%>elements/progress-popup.html?jobnum=' + jobnum + ';<%$url_or_message_link%>;formname=<%$formname%>' , 444, 168, '<% $popup_name %>'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
 
 }
 
@@ -120,6 +124,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";
 }