freeside/httemplate/elements progress-popup.html,1.1,1.2 progress-init.html,1.1,1.2

ivan ivan at pouncequick.420.am
Thu Feb 24 06:22:06 PST 2005


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory pouncequick:/tmp/cvs-serv22292/httemplate/elements

Modified Files:
	progress-popup.html progress-init.html 
Log Message:
add progressbar to service definition add - duplicate checking can take a while, closes: Bug#1126

Index: progress-init.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/progress-init.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- progress-init.html	20 Feb 2005 08:44:40 -0000	1.1
+++ progress-init.html	24 Feb 2005 14:22:02 -0000	1.2
@@ -1,44 +1,58 @@
-<% my( $formname, $fields, $action, $success_url ) = @_; %>
+<%
+  my( $formname, $fields, $action, $success_url, $key ) = @_;
+  $key = '' unless defined $key;
+%>
 
 <SCRIPT TYPE="text/javascript" SRC="../elements/jsrsClient.js"></SCRIPT>
 <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
 <SCRIPT TYPE="text/javascript">
 function OLiframeContent(src, width, height, name) {
   return ('<iframe src="'+src+'" width="'+width+'" height="'+height+'"'
-   +(name?' name="'+name+'" id="'+name+'"':'')+' scrolling="no">'
+   +(name?' name="'+name+'" id="'+name+'"':'')+' scrolling="auto">'
    +'<div>[iframe not supported]</div></iframe>');
 }
 
-function process () {
+function <%=$key%>process () {
 
-  document.OneTrueForm.submit.disabled=true;
+  document.<%=$formname%>.submit.disabled=true;
 
-  overlib( 'Submitting job to server...', WIDTH, 420, HEIGHT, 128, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
+  overlib( 'Submitting job to server...', WIDTH, 432, HEIGHT, 136, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
 
   var Hash = new Array();
   var x = 0;
   var fieldName;
-  for (var i = 0; i<document.OneTrueForm.elements.length; i++) {
-    fieldName = document.OneTrueForm.elements[i].name;
-//            (fieldName.indexOf('rate') > -1)
-//         || (fieldName.indexOf('min_') > -1) 
-//        || (fieldName.indexOf('sec_') > -1) 
-    if ( <%= join(' || ', map { "(fieldName.indexOf('$_') > -1)" } @$fields ) %>
+  for (var i = 0; i<document.<%=$formname%>.elements.length; i++) {
+    field  = document.<%=$formname%>.elements[i];
+    if ( <%= join(' || ', map { "(field.name.indexOf('$_') > -1)" } @$fields ) %>
        )
     {
-        Hash[x++] = fieldName;
-        Hash[x++] = document.OneTrueForm.elements[i].value;
+        if ( field.type == 'select-multiple' ) {
+          for (var j=0; j < field.options.length; j++) {
+            if ( field.options[j].selected ) {
+              Hash[x++] = field.name;
+              Hash[x++] = field.options[j].value;
+            }
+          }
+        } else if (    ( field.type != 'radio'  && field.type != 'checkbox' )
+                    || ( ( field.type == 'radio' || field.type == 'checkbox' )
+                         && document.<%=$formname%>.elements[i].checked
+                       )
+                  )
+        {
+          Hash[x++] = field.name;
+          Hash[x++] = field.value;
+        }
     }
   }
 
   jsrsPOST = true;
-  jsrsExecute( '<%= $action %>', myCallback, 'start_job', Hash );
+  jsrsExecute( '<%= $action %>', <%=$key%>myCallback, 'start_job', Hash );
 
 }
 
-function myCallback( jobnum ) {
+function <%=$key%>myCallback( jobnum ) {
 
-  overlib( OLiframeContent('<%=$p%>elements/progress-popup.html?jobnum=' + jobnum + ';url=<%=$success_url%>' , 420, 128, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
+  overlib( OLiframeContent('<%=$p%>elements/progress-popup.html?jobnum=' + jobnum + ';url=<%=$success_url%>;formname=<%=$formname%>' , 432, 136, 'progress_popup'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 );
 
 }
 

Index: progress-popup.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/progress-popup.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- progress-popup.html	20 Feb 2005 08:44:40 -0000	1.1
+++ progress-popup.html	24 Feb 2005 14:22:02 -0000	1.2
@@ -1,6 +1,7 @@
 <%
-  my( $jobnum ) = $cgi->param('jobnum');
-  my( $url ) = $cgi->param('url');
+  my $jobnum = $cgi->param('jobnum');
+  my $url = $cgi->param('url');
+  my $formname = scalar($cgi->param('formname'));
 %>
 <HTML>
   <HEAD>
@@ -34,7 +35,7 @@
     document.getElementById("progress_bar").innerHTML = '';
     document.getElementById("progress_percent").innerHTML = '<INPUT TYPE="button" VALUE="OK" onClick="parent.nd(1);">';
     document.getElementById("progress_jobnum").innerHTML = '';
-    parent.document.OneTrueForm.submit.disabled=false;
+    parent.document.<%=$formname%>.submit.disabled=false;
   } else {
     alert('XXX unknown status returned from server: ' + status);
   }




More information about the freeside-commits mailing list