From 90aa3a9ab7296295e7502fbee263c92448cc4164 Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Wed, 29 Nov 2017 14:28:33 +0530 Subject: [PATCH] add ts and minor fixes --- templates/CRM/common/importProgress.tpl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/templates/CRM/common/importProgress.tpl b/templates/CRM/common/importProgress.tpl index a6fceb6c6b..b5600befd6 100644 --- a/templates/CRM/common/importProgress.tpl +++ b/templates/CRM/common/importProgress.tpl @@ -28,7 +28,12 @@ CRM.$(function($) { var loop; $("form#Preview").on('submit', function (e) { - verify(); + 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}")) { + e.preventDefault(); + } + else { + showProgressBar(); + } }); function setIntermediate() { var dataUrl = "{/literal}{$statusUrl}{literal}"; @@ -41,13 +46,13 @@ CRM.$(function($) { $("#importProgressBar .ui-progressbar-value").animate({width: result[0] + "%"}, 500); $("#status").text(result[0] + "% Completed"); } + else { + window.clearInterval(loop); + } }); } - 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; - } + function showProgressBar() { $("#id-processing").show( ).dialog({ modal : true, width : 450, -- 2.25.1