Skip to content

Commit

Permalink
Add override that allows users to alter membership type on an auto-re…
Browse files Browse the repository at this point in the history
…new membership
  • Loading branch information
wmortada committed Mar 6, 2020
1 parent abdb0d2 commit 595ae4d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
30 changes: 29 additions & 1 deletion templates/CRM/Member/Form/Membership.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,16 @@
</tr>
<tr class="crm-membership-form-block-membership_type_id">
<td class="label">{$form.membership_type_id.label}</td>
<td><span id='mem_type_id'>{$form.membership_type_id.html}</span>
<td id="mem_type_id-readonly">
<span id="membership_type_id_0-readonly"></span> : <span id="membership_type_id_1-readonly"></span>
<span id="mem-type-override">
<a href="#" class="crm-hover-button action-item override-mem-type" id="show-mem-type">
{ts}Override organization and type{/ts}
</a>
{help id="override_membership_type"}
</span>
</td>
<td id="mem_type_id-editable"><span id='mem_type_id'>{$form.membership_type_id.html}</span>
{if $hasPriceSets}
<span id='totalAmountORPriceSet'> {ts}OR{/ts}</span>
<span id='selectPriceSet'>{$form.price_set_id.html}</span>
Expand Down Expand Up @@ -352,6 +361,25 @@
setDifferentContactBlock();
});
// give option to override membership type for auto-renew memberships - dev/core#1331
{/literal}
{if $isRecur}
cj('#membership_type_id_0-readonly').text(cj('#membership_type_id_0 option:selected').text());
cj('#membership_type_id_1-readonly').text(cj('#membership_type_id_1 option:selected').text());
cj('#mem_type_id-readonly').show();
cj('#mem_type_id-editable').hide();
{else}
cj('#mem_type_id-readonly').hide();
cj('#mem_type_id-editable').show();
{/if}
{literal}
cj('#show-mem-type').click( function( e ) {
e.preventDefault();
cj('#mem_type_id-readonly').hide();
cj('#mem_type_id-editable').show();
});
// give option to override end-date for auto-renew memberships
{/literal}
{if $isRecur && $endDate}
Expand Down
7 changes: 7 additions & 0 deletions templates/CRM/Member/Page/Tab.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@
{htxt id="override_end_date"}
<p>{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}</p>
{/htxt}

{htxt id="override_membership_type-title"}
{ts}Override Membership Type for Auto-renew Memberships{/ts}
{/htxt}
{htxt id="override_membership_type"}
<p>{ts}This membership is set to renew automatically. Take care when you change the membership type. Make sure that you also change the related payment at the payment processor. Otherwise future payments may be for the wrong amount.{/ts}</p>
{/htxt}

0 comments on commit 595ae4d

Please sign in to comment.