From 374a4dd609dd407e3b521be6eb19b2c2dfbb5cdf Mon Sep 17 00:00:00 2001 From: monishdeb Date: Fri, 9 May 2014 20:26:04 +0530 Subject: [PATCH] Set SC type to Gift by default --- CRM/Member/Form/Membership.php | 4 ++++ CRM/Member/Form/MembershipRenewal.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index d17da29d02..acd57ebd27 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -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(); diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index a624d31d39..4044d9b9cb 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -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' ); -- 2.25.1