2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
11 <script type="text/javascript">
14 $("form#Preview").on('submit', function (e) {
15 if (!confirm("{/literal}{ts escape='js'}Backing up your database before importing is recommended, as there is no Undo for this. Are you sure you want to import now?{/ts}{literal}")) {
22 function setIntermediate() {
23 var dataUrl = {/literal}{$statusUrl|@json_encode}{literal};
24 $.getJSON(dataUrl, function(response) {
25 var dataStr = response.toString();
26 var result = dataStr.split(",");
27 $("#intermediate").html(result[1]);
28 $("#importProgressBar .ui-progressbar-value").show();
29 if (result[0] < 100) {
30 $("#importProgressBar .ui-progressbar-value").animate({width: result[0] + "%"}, 500);
31 $("#status").text(result[0] + "% Completed");
34 window.clearInterval(loop);
39 function showProgressBar() {
40 $("#id-processing").show( ).dialog({
46 closeOnEscape : false,
48 $("#id-processing").dialog().parents(".ui-dialog").find(".ui-dialog-titlebar").remove();
51 $("#importProgressBar" ).progressbar({value:0});
52 $("#importProgressBar").show( );
53 loop = window.setInterval(setIntermediate, 5000)
59 {* Import Progress Bar and Info *}
60 <div id="id-processing" class="hiddenElement">
61 <h3>Importing records...</h3><br />
62 <div id="status" style="margin-left:6px;"></div>
63 <div class="progressBar" id="importProgressBar" style="margin-left:6px;display:none;"></div>
64 <div id="intermediate"></div>
65 <div id="error_status"></div>