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;");
+ }
}
}
}