CRM-15834 - allow override of auto-renew membership end dates
authorDave Greenberg <dave@civicrm.org>
Fri, 20 Feb 2015 02:24:45 +0000 (18:24 -0800)
committerDave Greenberg <dave@civicrm.org>
Fri, 20 Feb 2015 02:24:45 +0000 (18:24 -0800)
----------------------------------------
* 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
templates/CRM/Member/Page/Tab.hlp

index 239e5a40107fceae9f8788c7615e13c96ca1b788..a8141185144b7e36b21204455b992050abc2257b 100644 (file)
           <br />
           <span class="description">{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}</span></td></tr>
         <tr class="crm-membership-form-block-end_date"><td class="label">{$form.end_date.label}</td>
-          <td>{if $isRecur && $endDate}{$endDate|crmDate}{else}{include file="CRM/common/jcalendar.tpl" elementName=end_date}{/if}
+          <td id="end-date-readonly">
+              {$endDate|crmDate}
+              <a href="#" class="crm-hover-button action-item override-date" id="show-end-date">
+                {ts}Over-ride end date{/ts}
+              </a>
+              {help id="override_end_date"}
+          </td>
+          <td id="end-date-editable">
+            {include file="CRM/common/jcalendar.tpl" elementName=end_date}
             <br />
-            <span class="description">{ts}Latest membership period expiration date. End Date will be automatically set based on Membership Type if you don't select a date.{/ts}</span></td></tr>
+            <span class="description">{ts}Latest membership period expiration date. End Date will be automatically set based on Membership Type if you don't select a date.{/ts}</span>
+          </td>
+        </tr>
         {if !empty($form.auto_renew)}
           <tr id="autoRenew" class="crm-membership-form-block-auto_renew">
             <td class="label"> {$form.auto_renew.label} {help id="id-auto_renew" file="CRM/Member/Form/Membership.hlp" action=$action} </td>
       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( ) {
         cj('#record-different-contact').hide();
       }
     }
+    
     </script>
     {/literal}
 
       }
     }
     {/literal}{/if}
-
+    
     {if $context eq 'standalone' and $outBound_option != 2 }
     {literal}
     CRM.$(function($) {
index 5a2921ebb3cd896b0c814ba1e480a5af96629495..8d3a41845a80230de513941182d31aec28312dcc 100644 (file)
 {htxt id="id-contribution_contact"}
   <p>{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}</p>
 {/htxt}
+
+{htxt id="override_end_date-title"}
+  {ts}Override End Date for Auto-renew Memberships{/ts}
+{/htxt}
+{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}