additional changes
authorJitendra Purohit <jitendra@fuzion.co.nz>
Wed, 27 Sep 2017 11:07:57 +0000 (16:37 +0530)
committerJitendra Purohit <jitendra@fuzion.co.nz>
Wed, 29 Nov 2017 09:06:51 +0000 (14:36 +0530)
CRM/Import/Parser.php
templates/CRM/common/importProgress.tpl

index b17821f0e4776ca1f76c35d0e55e43e3d5a95183..f21515f63f04757ac1d5b8630f9a79b2ee32a302 100644 (file)
@@ -287,7 +287,10 @@ abstract class CRM_Import_Parser {
   }
 
   /**
+   * Add progress bar to the import process. Calculates time remaining, status etc.
+   *
    * @param $statusID
+   *   status id of the import process saved in $config->uploadDir.
    * @param bool $startImport
    *   True when progress bar is to be initiated.
    * @param $startTimestamp
index 9323fd72a76216a063c35e616fda8854a9877466..a6fceb6c6b4e17e3b72193d6d7c8eb78331684fc 100644 (file)
@@ -26,6 +26,7 @@
 {literal}
 <script type="text/javascript">
 CRM.$(function($) {
+  var loop;
   $("form#Preview").on('submit', function (e) {
     verify();
   });
@@ -43,11 +44,6 @@ CRM.$(function($) {
     });
   }
 
-  function pollLoop() {
-    setIntermediate();
-    window.setTimeout(pollLoop, 10*1000); // 10 sec
-  }
-
   function verify() {
     if (!confirm('Backing up your database before importing is recommended, as there is no Undo for this. {/literal}{ts escape='js'}Are you sure you want to Import now{/ts}{literal}?')) {
       return false;
@@ -65,7 +61,7 @@ CRM.$(function($) {
     });
     $("#importProgressBar" ).progressbar({value:0});
     $("#importProgressBar").show( );
-    pollLoop( );
+    loop = window.setInterval(setIntermediate, 5)
   }
 });
 </script>