Set SC type to Gift by default
authormonishdeb <monish.deb@webaccess.co.in>
Fri, 9 May 2014 14:56:04 +0000 (20:26 +0530)
committermonishdeb <monish.deb@webaccess.co.in>
Fri, 9 May 2014 14:56:04 +0000 (20:26 +0530)
CRM/Member/Form/Membership.php
CRM/Member/Form/MembershipRenewal.php

index d17da29d02ee1459a629bf88a4c2018c395a1433..acd57ebd27e9d2be6c4fae5e09b9412f1e55eedc 100644 (file)
@@ -360,6 +360,10 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
       }
     }
 
+    //set Soft Credit Type to Gift by default
+    $scTypes = CRM_Core_OptionGroup::values("soft_credit_type");
+    $defaults['soft_credit_type_id'] = CRM_Utils_Array::value(ts('Gift'), array_flip($scTypes));
+
     if (!empty($defaults['record_contribution']) && !$this->_mode) {
       $contributionParams = array('id' => $defaults['record_contribution']);
       $contributionIds = array();
index a624d31d39b1f568b07976814f414767a6d2d4f5..4044d9b9cba6f3a44a8f863cf984fbdaa07e0542 100644 (file)
@@ -260,6 +260,10 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
     $defaults['num_terms'] = 1;
     $defaults['send_receipt'] = 0;
 
+    //set Soft Credit Type to Gift by default
+    $scTypes = CRM_Core_OptionGroup::values("soft_credit_type");
+    $defaults['soft_credit_type_id'] = CRM_Utils_Array::value(ts('Gift'), array_flip($scTypes));
+
     $renewalDate = CRM_Utils_Date::processDate(CRM_Utils_Array::value('renewal_date', $defaults),
       NULL, NULL, 'Y-m-d'
     );