From 4f3c361db4ad2bb7278a6be2ad0f6444089de11f Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 21 Jul 2015 19:29:06 +1200 Subject: [PATCH] CRM-16559 allow recurring contributions to go against pledges for supporting processors Conflicts: CRM/Contribute/Form/Contribution.php CRM/Core/Payment.php CRM/Core/Payment/PayPalImpl.php --- CRM/Contribute/Form/Contribution.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 7c4d8a0058..17c75b62b4 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -548,10 +548,23 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP if ($this->_mode) { if (CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, TRUE) == TRUE) { if (!empty($this->_recurPaymentProcessors)) { - CRM_Contribute_Form_Contribution_Main::buildRecur($this); - $this->setDefaults(array('is_recur' => 0)); - $this->assign('buildRecurBlock', TRUE); - $recurJs = array('onChange' => "buildRecurBlock( this.value ); return false;"); + $buildRecurBlock = TRUE; + if ($this->_ppID) { + // ppID denotes a pledge payment. + foreach ($this->_paymentProcessors as $processor) { + if (!empty($processor['is_recur']) && !empty($processor['object']) && $processor['object']->supports('recurContributionsForPledges')) { + $buildRecurBlock = TRUE; + break; + } + $buildRecurBlock = FALSE; + } + } + if ($buildRecurBlock) { + CRM_Contribute_Form_Contribution_Main::buildRecur($this); + $this->setDefaults(array('is_recur' => 0)); + $this->assign('buildRecurBlock', TRUE); + $recurJs = array('onChange' => "buildRecurBlock( this.value ); return false;"); + } } } } -- 2.25.1