CRM-17241 - modify template and PHP for membership renewal to support renewing multip...
authorJon goldberg <jon@palantetech.coop>
Fri, 2 Oct 2015 20:22:48 +0000 (16:22 -0400)
committerJon goldberg <jon@palantetech.coop>
Fri, 2 Oct 2015 20:22:48 +0000 (16:22 -0400)
CRM/Member/Form/MembershipRenewal.php
templates/CRM/Member/Form/MembershipRenewal.tpl

index e1174be2fd73b165a271edca17c3a0feb66583d0..697ed171c8a92c4242085f1a25f7db9867c88002 100644 (file)
@@ -348,6 +348,10 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
     $this->add('select', 'financial_type_id', ts('Financial Type'),
       array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType()
     );
+
+    $this->add('text', 'num_terms', ts('Extend Membership by'), array('onchange' => "setPaymentBlock();"), TRUE);
+    $this->addRule('num_terms', ts('Please enter a whole number for how many periods to renew.'), 'integer');
+
     if (CRM_Core_Permission::access('CiviContribute') && !$this->_mode) {
       $this->addElement('checkbox', 'record_contribution', ts('Record Renewal Payment?'), NULL, array('onclick' => "checkPayment();"));
 
@@ -356,9 +360,6 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
 
       $this->addDate('receive_date', ts('Received'), FALSE, array('formatType' => 'activityDateTime'));
 
-      $this->add('text', 'num_terms', ts('Extend Membership by'), array('onchange' => "setPaymentBlock();"), TRUE);
-      $this->addRule('num_terms', ts('Please enter a whole number for how many periods to renew.'), 'integer');
-
       $this->add('select', 'payment_instrument_id', ts('Payment Method'),
         array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(),
         FALSE, array('onChange' => "return showHideByValue('payment_instrument_id','4','checkNumber','table-row','select',false);")
index 04024f844340283346a5b203d5c2b1222d82b6b8..1e51bcc1ce7bdefc8d4c94f11b4e13c32c00a6c1 100644 (file)
         <td class="label">{$form.renewal_date.label}</td>
         <td>{include file="CRM/common/jcalendar.tpl" elementName=renewal_date}</td>
       </tr>
+      <tr id="defaultNumTerms" class="crm-member-membershiprenew-form-block-default-num_terms">
+        <td colspan="2" class="description">
+          {ts}Renewal extends membership end date by one membership period{/ts}
+          &nbsp; <a id="changeTermsLink" href='#'
+                    onclick='changeNumTerms(); return false;'>{ts}change{/ts}</a>
+        </td>
+      </tr>
+      <tr id="changeNumTerms" class="crm-member-membershiprenew-form-block-change-num_terms">
+        <td class="label">{$form.num_terms.label}</td>
+        <td>{$form.num_terms.html|crmAddClass:two} {ts}membership periods{/ts}<br/>
+          <span
+            class="description">{ts}Extend the membership end date by this many membership periods. Make sure the appropriate corresponding fee is entered below.{/ts}</span>
+        </td>
+      </tr>
       {if $accessContribution and ! $membershipMode}
         <tr class="crm-member-membershiprenew-form-block-record_contribution">
           <td class="label">{$form.record_contribution.label}</td>
           <td colspan="2">
             <fieldset>
               <legend>{ts}Renewal Payment and Receipt{/ts}</legend>
-              <table class="form-layout-compressed">
-                <tr id="defaultNumTerms" class="crm-member-membershiprenew-form-block-default-num_terms">
-                  <td colspan="2" class="description">
-                    {ts}Renewal extends membership end date by one membership period{/ts}
-                    &nbsp; <a id="changeTermsLink" href='#'
-                              onclick='changeNumTerms(); return false;'>{ts}change{/ts}</a>
-                  </td>
-                </tr>
-                <tr id="changeNumTerms" class="crm-member-membershiprenew-form-block-change-num_terms">
-                  <td class="label">{$form.num_terms.label}</td>
-                  <td>{$form.num_terms.html|crmAddClass:two} {ts}membership periods{/ts}<br/>
-                    <span
-                      class="description">{ts}Extend the membership end date by this many membership periods. Make sure the appropriate corresponding fee is entered below.{/ts}</span>
-                  </td>
-                </tr>
       {/if}
       {include file="CRM/Member/Form/MembershipCommon.tpl"}
       {if $emailExists and $outBound_option != 2}