From 453ed6d15b2be7893ecff0793622270ef7cdef7e Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Mon, 3 Jun 2013 18:35:19 +0530 Subject: [PATCH] CRM-12752, check ids instead of label for showing notification checkbox, also code cleanup --- CRM/Event/Form/Participant.php | 14 ++++++++++++++ templates/CRM/Event/Form/Participant.tpl | 24 ++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index f79e29d43f..ba3d0875ee 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -887,6 +887,20 @@ loadCampaign( {$this->_eID}, {$eventCampaigns} ); $confirmJS = array('onclick' => "return confirmStatus( {$participantStatusId}, {$contributionStatusId} );"); } + // get the participant status names to build special status array which is used to show notification + // checkbox below participant status select + $participantStatusName = CRM_Event_PseudoConstant::participantStatus(); + $notificationStatuses = array( + 'Cancelled', + 'Pending from waitlist', + 'Pending from approval', + 'Expired', + ); + + // get the required status and then implode only ids + $notificationStatusIds = implode(',', array_keys(array_intersect($participantStatusName, $notificationStatuses))); + $this->assign('notificationStatusIds', $notificationStatusIds); + $this->_participantStatuses = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'); $this->add('select', 'status_id', ts('Participant Status'), array( diff --git a/templates/CRM/Event/Form/Participant.tpl b/templates/CRM/Event/Form/Participant.tpl index d9d6c3992c..1f77e35f77 100644 --- a/templates/CRM/Event/Form/Participant.tpl +++ b/templates/CRM/Event/Form/Participant.tpl @@ -571,22 +571,20 @@ {* include jscript to warn if unsaved form field changes *} {include file="CRM/common/formNavigate.tpl"} -{/if} {* end of eventshow condition*} - {/literal} +{/if} {* end of main event block*} + -- 2.25.1