From 847f8123cdc7c1ae8ac50e4302de6e7b09f57430 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 15 Aug 2014 11:58:07 +0100 Subject: [PATCH] Cleanup tpl js for switching to a price set --- .../Form/ContributionPage/Amount.tpl | 82 +++++++------------ templates/CRM/Event/Form/ManageEvent/Fee.tpl | 59 ++++--------- templates/CRM/Member/Form/MembershipBlock.tpl | 53 +++--------- 3 files changed, 58 insertions(+), 136 deletions(-) diff --git a/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl b/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl index 187f834238..161b044798 100644 --- a/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl +++ b/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl @@ -25,11 +25,6 @@ *} {capture assign="adminPriceSets"}{crmURL p='civicrm/admin/price' q="reset=1"}{/capture}
-{if $isQuick} -
- {ts}Once you switch to using a Price Set, you won't be able to switch back to your existing settings below except by re-entering them. Are you sure you want to switch to a Price Set?{/ts} -
-{/if}
{ts}Use this form to configure Contribution Amount options. You can give contributors the ability to enter their own contribution amounts - and/or provide a fixed list of amounts. For fixed amounts, you can enter a label for each 'level' of contribution (e.g. Friend, Sustainer, etc.). If you allow people to enter their own dollar amounts, you can also set minimum and maximum values. Depending on your choice of Payment Processor, you may be able to offer a recurring contribution option.{/ts} {docURL page="user/contributions/payment-processors"}
@@ -203,24 +198,24 @@ {/literal}{/foreach} {/if} {literal} - cj( document ).ready( function( ) { - cj("#popupContainer").hide(); - function checked_payment_processors() { - var ids = []; - cj('.crm-contribution-contributionpage-amount-form-block-payment_processor input[type="checkbox"]').each(function(){ - if(cj(this).prop('checked')) { - var id = cj(this).attr('id').split('_')[2]; - ids.push(id); - } - }); - return ids; - } + CRM.$(function($) { + $("#popupContainer").hide(); + function checked_payment_processors() { + var ids = []; + $('.crm-contribution-contributionpage-amount-form-block-payment_processor input[type="checkbox"]').each(function(){ + if($(this).prop('checked')) { + var id = $(this).attr('id').split('_')[2]; + ids.push(id); + } + }); + return ids; + } // show/hide recurring block - cj('.crm-contribution-contributionpage-amount-form-block-payment_processor input[type="checkbox"]').change(function(){ - showRecurring( checked_payment_processors() ) + $('.crm-contribution-contributionpage-amount-form-block-payment_processor input[type="checkbox"]').change(function(){ + showRecurring( checked_payment_processors() ); }); - showRecurring( checked_payment_processors() ) + showRecurring( checked_payment_processors() ); }); var element_other_amount = document.getElementsByName('is_allow_other_amount'); if (! element_other_amount[0].checked) { @@ -355,39 +350,20 @@ {if $isQuick} {literal} {/literal} {/if} diff --git a/templates/CRM/Event/Form/ManageEvent/Fee.tpl b/templates/CRM/Event/Form/ManageEvent/Fee.tpl index fd5c965cf7..d5d33c1ac5 100644 --- a/templates/CRM/Event/Form/ManageEvent/Fee.tpl +++ b/templates/CRM/Event/Form/ManageEvent/Fee.tpl @@ -33,14 +33,9 @@
{/if}
-{if $isQuick} -
- {ts}Once you switch to using a Price Set, you won't be able to switch back to your existing settings below except by re-entering them. Are you sure you want to switch to a Price Set?{/ts} -
-{/if} -
+
{include file="CRM/common/formButtons.tpl" location="top"} -
+
@@ -345,42 +340,20 @@ {if $isQuick} {literal} {/literal} {/if} diff --git a/templates/CRM/Member/Form/MembershipBlock.tpl b/templates/CRM/Member/Form/MembershipBlock.tpl index 8685015023..51f82127a4 100644 --- a/templates/CRM/Member/Form/MembershipBlock.tpl +++ b/templates/CRM/Member/Form/MembershipBlock.tpl @@ -25,11 +25,6 @@ *} {* Configure Membership signup/renewal block for an Online Contribution page *}
-{if $isQuick} -
- {ts}Once you switch to using a Price Set, you won't be able to switch back to your existing settings below except by re-entering them. Are you sure you want to switch to a Price Set?{/ts} -
-{/if}
{ts}Use this form to enable and configure a Membership Signup and Renewal section for this Online Contribution Page. If you're not using this page for membership signup, leave the Enabled box un-checked..{/ts} {docURL page="user/membership/setup"}
@@ -185,42 +180,20 @@ {if $isQuick} {literal} {/literal} {/if} -- 2.25.1