From 2179c63d6fde866b3309201ef5b212549af862cc Mon Sep 17 00:00:00 2001 From: monishdeb Date: Wed, 31 Jul 2013 13:37:14 +0530 Subject: [PATCH] CRM-12270 fix ---------------------------------------- * CRM-12270: Batch Change Participant Status task sends confirmation email and marks contribution completed when participant status is updated FROM "Pending Pay Later" to "Attended" or "Registered" http://issues.civicrm.org/jira/browse/CRM-12270 --- CRM/Event/Form/Task/Batch.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index 80ffa00872..0c3d211f3d 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -269,6 +269,7 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { */ public function postProcess() { $params = $this->exportValues(); + $statusClasses = CRM_Event_PseudoConstant::participantStatusClass(); if (isset($params['field'])) { foreach ($params['field'] as $key => $value) { @@ -296,6 +297,7 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { //need to send mail when status change $statusChange = FALSE; + $relatedStatusChange = FALSE; if (CRM_Utils_Array::value('participant_status', $value)) { $value['status_id'] = $value['participant_status']; $fromStatusId = CRM_Utils_Array::value($key, $this->_fromStatusIds); @@ -304,6 +306,9 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { } if ($fromStatusId != $value['status_id']) { + $relatedStatusChange = TRUE; + } + if ($statusClasses[$fromStatusId] != $statusClasses[$value['status_id']]) { $statusChange = TRUE; } } @@ -320,7 +325,8 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { //need to trigger mails when we change status if ($statusChange) { CRM_Event_BAO_Participant::transitionParticipants(array($key), $value['status_id'], $fromStatusId); - + } + if ($relatedStatusChange) { //update related contribution status, CRM-4395 self::updatePendingOnlineContribution($key, $value['status_id']); } -- 2.25.1