diff --git a/languages/en_us/Vtiger.php b/languages/en_us/Vtiger.php index 6d0caecee296a588c379b49ebdba50049328d54f..e44eabc3c7211c16adbc9ad9cc95e6dac339d283 100644 --- a/languages/en_us/Vtiger.php +++ b/languages/en_us/Vtiger.php @@ -1312,6 +1312,7 @@ $languageStrings = array( 'LBL_VTIGER6_RETIREMENT_NOTICE' => 'This version will be retired on Feb 15th 2016', 'ModTracker' => 'Updates', 'LBL_MAIL_SENT_SUCCESSFULLY' => 'Mail Sent Successfully', + 'LBL_MAIL_SAVED_SUCCESSFULLY' => 'Mail Saved Successfully', 'LBL_FAILED_TO_SEND' => 'Failed to Send', 'LBL_ESSENTIALS' => 'Essentials', diff --git a/layouts/v7/modules/Emails/SendEmailResult.tpl b/layouts/v7/modules/Emails/SendEmailResult.tpl index 7f8e0a20bd64a23dd36abdf3c6c1b5b7ac83bc32..135c42d1362171804a2d545468af0d1172f27212 100644 --- a/layouts/v7/modules/Emails/SendEmailResult.tpl +++ b/layouts/v7/modules/Emails/SendEmailResult.tpl @@ -16,7 +16,11 @@ <div class="modal-body"> {if $SUCCESS} <div class="mailSentSuccessfully" data-relatedload="{$RELATED_LOAD}"> - {vtranslate('LBL_MAIL_SENT_SUCCESSFULLY')} + {if $FLAG eq 'SENT'} + {vtranslate('LBL_MAIL_SENT_SUCCESSFULLY')} + {else} + {vtranslate('LBL_MAIL_SAVED_SUCCESSFULLY')} + {/if} </div> {if $FLAG} <input type="hidden" id="flag" value="{$FLAG}"> diff --git a/layouts/v7/resources/helper.js b/layouts/v7/resources/helper.js index 79b3564f922a4c71abb2fb106d294dfaa1e91664..599f06a7cfa97513e4bd9605f4132f351a9566de 100644 --- a/layouts/v7/resources/helper.js +++ b/layouts/v7/resources/helper.js @@ -446,10 +446,10 @@ jQuery.Class("Vtiger_Helper_Js",{ var cb = params.cb; var container = jQuery('.myModal'); - container.on('hidden.bs.modal',function() { + container.one('hidden.bs.modal',function() { container.html(''); window.onbeforeunload = null; - }); + }); if(typeof cb === "function") { container.off('shown.bs.modal'); @@ -793,6 +793,13 @@ jQuery.Class("Vtiger_Helper_Js",{ if(typeof params === "undefined") { params = {}; } + + // we should hide all existing modal's + var hideModals = (typeof params.hideModals !== 'undefined') ? params.hideModals : true; + if(hideModals) { + this.hideModal(); + } + var defaultParams = app.helper.defaultModalParams(); params = jQuery.extend(defaultParams,params); @@ -800,9 +807,16 @@ jQuery.Class("Vtiger_Helper_Js",{ if(jQuery('#popupModal').length) return; var container = jQuery('<div id="popupModal" class="modal"></div>'); - container.on('hidden.bs.modal',function() { - container.html('').remove(); - }); + container.on('hidden.bs.modal',function() { + /** + * if tabindex = -1 then browser will set focus to that element. + * Loading another modal(this has tabindex = -1) on a modal is not moving the focus to new modal. + * We can't remove tabindex from the modals in tpl. So, this is a work around(removing index on show and adding on hide). + */ + jQuery('#helpPageOverlay').attr('tabindex','-1'); + container.html(''); + window.onbeforeunload = null; + }); if(typeof cb === "function") { container.off('shown.bs.modal');