From e4444728b4d650bc2a872e0391fd1f151e67f44a Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Thu, 19 Feb 2015 18:24:45 -0800 Subject: [PATCH] CRM-15834 - allow override of auto-renew membership end dates ---------------------------------------- * CRM-15834: Allow end dates of auto-renew memberships to be edited https://issues.civicrm.org/jira/browse/CRM-15834 --- templates/CRM/Member/Form/Membership.tpl | 35 ++++++++++++++++++++++-- templates/CRM/Member/Page/Tab.hlp | 7 +++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/templates/CRM/Member/Form/Membership.tpl b/templates/CRM/Member/Form/Membership.tpl index 239e5a4010..a814118514 100644 --- a/templates/CRM/Member/Form/Membership.tpl +++ b/templates/CRM/Member/Form/Membership.tpl @@ -135,9 +135,19 @@
{ts}First day of current continuous membership period. Start Date will be automatically set based on Membership Type if you don't select a date.{/ts} {$form.end_date.label} - {if $isRecur && $endDate}{$endDate|crmDate}{else}{include file="CRM/common/jcalendar.tpl" elementName=end_date}{/if} + + {$endDate|crmDate} + + {ts}Over-ride end date{/ts} + + {help id="override_end_date"} + + + {include file="CRM/common/jcalendar.tpl" elementName=end_date}
- {ts}Latest membership period expiration date. End Date will be automatically set based on Membership Type if you don't select a date.{/ts} + {ts}Latest membership period expiration date. End Date will be automatically set based on Membership Type if you don't select a date.{/ts} + + {if !empty($form.auto_renew)} {$form.auto_renew.label} {help id="id-auto_renew" file="CRM/Member/Form/Membership.hlp" action=$action} @@ -432,6 +442,24 @@ cj('#is_different_contribution_contact').change( function() { setDifferentContactBlock(); }); + + // give option to override end-date for auto-renew memberships + {/literal} + {if $isRecur && $endDate} + cj('#end-date-readonly').show(); + cj('#end-date-editable').hide(); + {else} + cj('#end-date-readonly').hide(); + cj('#end-date-editable').show(); + {/if} + {literal} + + cj('#show-end-date').click( function( e ) { + e.preventDefault(); + cj('#end-date-readonly').hide(); + cj('#end-date-editable').show(); + }); + }); function setDifferentContactBlock( ) { @@ -443,6 +471,7 @@ cj('#record-different-contact').hide(); } } + {/literal} @@ -481,7 +510,7 @@ } } {/literal}{/if} - + {if $context eq 'standalone' and $outBound_option != 2 } {literal} CRM.$(function($) { diff --git a/templates/CRM/Member/Page/Tab.hlp b/templates/CRM/Member/Page/Tab.hlp index 5a2921ebb3..8d3a41845a 100644 --- a/templates/CRM/Member/Page/Tab.hlp +++ b/templates/CRM/Member/Page/Tab.hlp @@ -37,3 +37,10 @@ {htxt id="id-contribution_contact"}

{ts}Check this box if someone other than the member is paying for this membership (i.e. a gift membership or gift subscription), and you want to link the payment to the person who is actually paying. You will be able to select an existing contact or enter a new one. The resulting contribution record will be linked to the payer, and a soft credit for that contribution will be linked to this contact (the member).{/ts}

{/htxt} + +{htxt id="override_end_date-title"} + {ts}Override End Date for Auto-renew Memberships{/ts} +{/htxt} +{htxt id="override_end_date"} +

{ts}If CiviCRM's membership end-date is different from when the payment processor will next collect a payment, various problems can occur. Members may experience a gap in their membership, and the renewal date may get changed from what is manually entered. Use care when modifying the End Date value, and check the associated recurring payment in your payment processor system so they always match.{/ts}

+{/htxt} -- 2.25.1