CRM-20889: Toggle check_number field on backoffice form as payment form fields
authordeb.monish <monish.deb@jmaconsulting.biz>
Mon, 17 Jul 2017 12:09:12 +0000 (17:39 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Wed, 13 Sep 2017 08:36:12 +0000 (14:06 +0530)
CRM/Contribute/Form/Contribution.php
CRM/Core/Payment/Manual.php
templates/CRM/Contribute/Form/AdditionalPayment.tpl
templates/CRM/Contribute/Form/Contribution.tpl
templates/CRM/Event/Form/EventFees.tpl
templates/CRM/Member/Form/MembershipCommon.tpl

index 44161e6cd32ec141eb97fa2cd2a23537c7a460f5..85f0630e08cb77836fc552133294ef85e9d51999 100644 (file)
@@ -248,8 +248,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       return;
     }
 
-    $this->assign('showCheckNumber', TRUE);
-
     $this->_fromEmails = CRM_Core_BAO_Email::getFromEmail();
 
     if (in_array('CiviPledge', CRM_Core_Config::singleton()->enableComponents) && !$this->_formType) {
@@ -704,7 +702,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
     if ($this->_online) {
       $this->assign('hideCalender', TRUE);
     }
-    $checkNumber = $this->add('text', 'check_number', ts('Check Number'), $attributes['contribution_check_number']);
 
     $this->addDateTime('receipt_date', ts('Receipt Date'), FALSE, array('formatType' => 'activityDateTime'));
     $this->addDateTime('cancel_date', ts('Cancelled / Refunded Date'), FALSE, array('formatType' => 'activityDateTime'));
@@ -839,7 +836,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       if ($totalAmount) {
         $totalAmount->freeze();
       }
-      $checkNumber->freeze();
       $paymentInstrument->freeze();
       $trxnId->freeze();
       $financialType->freeze();
index 5e1e8540bb505957b17cfa63d019b99ee3aeee35..833609ad53e78b8400b67c06256e42b01d94c7e0 100644 (file)
@@ -93,10 +93,7 @@ class CRM_Core_Payment_Manual extends CRM_Core_Payment {
       return array('credit_card_type', 'pan_truncation');
     }
     elseif ($paymentInstrument === 'Check') {
-      // Really we should render check_number here, but we need to review how we edit
-      // check_numebr since we expose it as editable on the contribution form,
-      // even though it should only be editable from a transation specific form.
-      return array();
+      return array('check_number');
     }
     return array();
   }
index f0c916c3090ab8df54756b5394b8808a47be45d6..d1c5b7d5a6aee79a3d8e78696a7f787a1c7e18ff 100644 (file)
             <td >{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
             </td>
           </tr>
-          {if $showCheckNumber || !$isOnline}
-            <tr id="checkNumber" class="crm-payment-form-block-check_number">
-              <td class="label">{$form.check_number.label}</td>
-              <td>{$form.check_number.html}</td>
-            </tr>
-          {/if}
           <tr class="crm-payment-form-block-trxn_id">
             <td class="label">{$form.trxn_id.label}</td>
             <td>{$form.trxn_id.html} {help id="id-trans_id"}</td>
index 151574ac1b977b85dc1d2a35534a11f14fc87e2b..1f1233130d218adec443f6b785bc46269366a26e 100644 (file)
             <td {$valueStyle}>{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
             </td>
           </tr>
-          {if $showCheckNumber || !$isOnline}
-            <tr id="checkNumber" class="crm-contribution-form-block-check_number">
-              <td class="label">{$form.check_number.label}</td>
-              <td>{$form.check_number.html}</td>
-            </tr>
-          {/if}
           <tr class="crm-contribution-form-block-trxn_id">
             <td class="label">{$form.trxn_id.label}</td>
             <td {$valueStyle}>{$form.trxn_id.html} {help id="id-trans_id"}</td>
index c42ae433ddcbb17798a49972fcb2d51f54816d57..09d92e517b9322e1246791e11caa3a03a5006918 100644 (file)
 
 {/if}
 
-{include file='CRM/Core/BillingBlockWrapper.tpl'}
+{if $action neq 2}
+  {include file='CRM/Core/BillingBlockWrapper.tpl'}
+{/if}
 
 {if ($email OR $batchEmail) and $outBound_option != 2}
     <fieldset id="send_confirmation_receipt"><legend>{if $paid}{ts}Registration Confirmation and Receipt{/ts}{else}{ts}Registration Confirmation{/ts}{/if}</legend>
index caf862471bc08106d10e0bb04cba8393ecfc2417..fcad577e7fdd2e6846122fcc74a72c42042e94fc 100644 (file)
           <td class="label">{$form.payment_instrument_id.label}<span class='marker'>*</span></td>
           <td>{$form.payment_instrument_id.html} {help id="payment_instrument_id" file="CRM/Contribute/Page/Tab.hlp"}</td>
         </tr>
-        <tr id="checkNumber" class="crm-{$formClass}-form-block-check_number">
-          <td class="label">{$form.check_number.label}</td>
-          <td>{$form.check_number.html|crmAddClass:six}</td>
-        </tr>
 
         {if $action neq 2 }
           <tr class="crm-{$formClass}-form-block-trxn_id">
           <td class="label">{$form.contribution_status_id.label}</td>
           <td>{$form.contribution_status_id.html}</td>
         </tr>
+
+        <tr class="crm-membership-form-block-billing">
+          <td colspan="2">
+            {include file='CRM/Core/BillingBlockWrapper.tpl'}
+          </td>
+        </tr>
       </table>
     </fieldset></td></tr>
   {/if}
     <td>{$form.payment_processor_id.html}</td>
   </tr>
 {/if}
-<tr class="crm-membership-form-block-billing">
-  <td colspan="2">
-    {include file='CRM/Core/BillingBlockWrapper.tpl'}
-  </td>
-</tr>