fix progress hoohaw for internet exploder again, whew. also make sure error/finish...
[freeside.git] / httemplate / elements / progress-init.html
index a8268c1..ec485f4 100644 (file)
   }
 %>
 
-<SCRIPT TYPE="text/javascript" SRC="../elements/jsrsClient.js"></SCRIPT>
+<%= include('/elements/xmlhttp.html',
+              'method' => 'POST',
+              'url'    => $action,
+              'subs'   => [ 'start_job' ],
+              'key'    => $key,
+           )
+%>
 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT>
 <SCRIPT TYPE="text/javascript">
 function OLiframeContent(src, width, height, name) {
   return ('<iframe src="'+src+'" width="'+width+'" height="'+height+'"'
@@ -22,9 +29,13 @@ function OLiframeContent(src, width, height, name) {
 
 function <%=$key%>process () {
 
-  document.<%=$formname%>.submit.disabled=true;
+  //alert('<%=$key%>process for form <%=$formname%>');
+
+  if ( document.<%=$formname%>.submit.disabled == false ) {
+    document.<%=$formname%>.submit.disabled=true;
+  }
 
-  overlib( 'Submitting job to server...', WIDTH, 432, HEIGHT, 136, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
+  overlib( 'Submitting job to server...', WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
 
   var Hash = new Array();
   var x = 0;
@@ -35,8 +46,10 @@ function <%=$key%>process () {
        )
     {
         if ( field.type == 'select-multiple' ) {
+          //alert('select-multiple ' + field.name);
           for (var j=0; j < field.options.length; j++) {
             if ( field.options[j].selected ) {
+              //alert(field.name + ' => ' + field.options[j].value);
               Hash[x++] = field.name;
               Hash[x++] = field.options[j].value;
             }
@@ -53,14 +66,18 @@ function <%=$key%>process () {
     }
   }
 
-  jsrsPOST = true;
-  jsrsExecute( '<%= $action %>', <%=$key%>myCallback, 'start_job', Hash );
+  // jsrsPOST = true;
+  // jsrsExecute( '<%= $action %>', <%=$key%>myCallback, 'start_job', Hash );
+
+  //alert('start_job( ' + Hash + ', <%=$key%>myCallback )' );
+  //alert('start_job()' );
+  <%=$key%>start_job( Hash, <%=$key%>myCallback );
 
 }
 
 function <%=$key%>myCallback( jobnum ) {
 
-  overlib( OLiframeContent('<%=$p%>elements/progress-popup.html?jobnum=' + jobnum + ';<%=$url_or_message_link%>;formname=<%=$formname%>' , 432, 136, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
+  overlib( OLiframeContent('<%=$p%>elements/progress-popup.html?jobnum=' + jobnum + ';<%=$url_or_message_link%>;formname=<%=$formname%>' , 444, 168, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
 
 }