* Get all the recurring contribution information and assign to the template
*/
private function addRecurringContributionsBlock() {
- $activeContributions = $this->getActiveRecurringContributions();
- $inactiveRecurringContributions = $this->getInactiveRecurringContributions();
+ list($activeContributions, $activeContributionsCount) = $this->getActiveRecurringContributions();
+ list($inactiveRecurringContributions, $inactiveContributionsCount) = $this->getInactiveRecurringContributions();
if (!empty($activeContributions) || !empty($inactiveRecurringContributions)) {
// assign vars to templates
$this->assign('action', $this->_action);
$this->assign('activeRecurRows', $activeContributions);
+ $this->assign('activeContributionsCount', $activeContributionsCount);
$this->assign('inactiveRecurRows', $inactiveRecurringContributions);
$this->assign('recur', TRUE);
}
* @return mixed
*/
private function buildRecurringContributionsArray($recurContributions) {
+ $liveRecurringContributionCount = 0;
foreach ($recurContributions as $recurId => $recurDetail) {
$action = array_sum(array_keys($this->recurLinks($recurId)));
// no action allowed if it's not active
$recurContributions[$recurId]['is_active'] = (!CRM_Contribute_BAO_Contribution::isContributionStatusNegative($recurDetail['contribution_status_id']));
+ if (empty($recurDetail['is_test'])) {
+ $liveRecurringContributionCount++;
+ }
+
// Get the name of the payment processor
if (!empty($recurDetail['payment_processor_id'])) {
$recurContributions[$recurId]['payment_processor'] = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessorName($recurDetail['payment_processor_id']);
}
}
- return $recurContributions;
+ return [$recurContributions, $liveRecurringContributionCount];
}
/**