}
/**
+ * 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
{literal}
<script type="text/javascript">
CRM.$(function($) {
+ var loop;
$("form#Preview").on('submit', function (e) {
verify();
});
});
}
- 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;
});
$("#importProgressBar" ).progressbar({value:0});
$("#importProgressBar").show( );
- pollLoop( );
+ loop = window.setInterval(setIntermediate, 5)
}
});
</script>