diff --git a/CRM/Twingle/Form/Profile.php b/CRM/Twingle/Form/Profile.php index e5cc6d4..0a7c065 100644 --- a/CRM/Twingle/Form/Profile.php +++ b/CRM/Twingle/Form/Profile.php @@ -209,6 +209,13 @@ class CRM_Twingle_Form_Profile extends CRM_Core_Form { array('class' => 'crm-select2 huge') ); + $this->add( + 'text', // field type + 'contribution_source', // field name + E::ts('Contribution source'), // field label + array() + ); + $this->addButtons(array( array( 'type' => 'submit', diff --git a/CRM/Twingle/Profile.php b/CRM/Twingle/Profile.php index 0a0702d..ce6aa54 100644 --- a/CRM/Twingle/Profile.php +++ b/CRM/Twingle/Profile.php @@ -188,6 +188,7 @@ class CRM_Twingle_Profile { 'postinfo_groups', 'donation_receipt_groups', 'campaign', + 'contribution_source', ); } @@ -244,6 +245,7 @@ class CRM_Twingle_Profile { 'postinfo_groups' => NULL, 'donation_receipt_groups' => NULL, 'campaign' => NULL, + 'contribution_source' => NULL, )); } diff --git a/api/v3/TwingleDonation/Submit.php b/api/v3/TwingleDonation/Submit.php index 4dd6e9a..7be943d 100644 --- a/api/v3/TwingleDonation/Submit.php +++ b/api/v3/TwingleDonation/Submit.php @@ -451,6 +451,9 @@ function civicrm_api3_twingle_donation_Submit($params) { if (!empty($campaign = $profile->getAttribute('campaign'))) { $contribution_data['campaign_id'] = $campaign; } + if (!empty($contribution_source = $profile->getAttribute('contribution_source'))) { + $contribution_data['source'] = $contribution_source; + } if ( CRM_Twingle_Submission::civiSepaEnabled() diff --git a/templates/CRM/Twingle/Form/Profile.tpl b/templates/CRM/Twingle/Form/Profile.tpl index 1841feb..2c9eee2 100644 --- a/templates/CRM/Twingle/Form/Profile.tpl +++ b/templates/CRM/Twingle/Form/Profile.tpl @@ -107,6 +107,11 @@ {$form.campaign.html} + + {$form.contribution_source.label} + {$form.contribution_source.html} + +