From eb3b395797a4ac07aa0bc15e20948914dfde979f Mon Sep 17 00:00:00 2001 From: monishdeb Date: Thu, 29 Aug 2013 15:07:19 +0530 Subject: [PATCH] CRM-13309 fix ---------------------------------------- * CRM-13309: Participant Role on Event's Schedule Reminder form does not populate http://issues.civicrm.org/jira/browse/CRM-13309 --- CRM/Event/Form/ManageEvent/ScheduleReminders.php | 2 ++ templates/CRM/Event/Form/ManageEvent/ScheduleReminders.tpl | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/ScheduleReminders.php b/CRM/Event/Form/ManageEvent/ScheduleReminders.php index 756403f502..3cfb45fe3b 100755 --- a/CRM/Event/Form/ManageEvent/ScheduleReminders.php +++ b/CRM/Event/Form/ManageEvent/ScheduleReminders.php @@ -124,6 +124,8 @@ class CRM_Event_Form_ManageEvent_ScheduleReminders extends CRM_Event_Form_Manage $selectionOptions = CRM_Core_BAO_ActionSchedule::getSelection($this->_mappingID); extract($selectionOptions); + $this->assign('recipientMapping', json_encode($recipientMapping)); + $entity = $this->add('select', 'entity', ts('Recipient(s)'), $sel3[$this->_mappingID][0], TRUE); $entity->setMultiple(TRUE); diff --git a/templates/CRM/Event/Form/ManageEvent/ScheduleReminders.tpl b/templates/CRM/Event/Form/ManageEvent/ScheduleReminders.tpl index 9ffdfdb5d7..2f95866c12 100755 --- a/templates/CRM/Event/Form/ManageEvent/ScheduleReminders.tpl +++ b/templates/CRM/Event/Form/ManageEvent/ScheduleReminders.tpl @@ -197,12 +197,13 @@ }); function populateRecipient( ) { - var recipient = cj("#recipient option:selected").text(); + var recipientMapping = eval({/literal}{$recipientMapping}{literal}); + var recipient = cj("#recipient option:selected").val(); var postUrl = "{/literal}{crmURL p='civicrm/ajax/populateRecipient' h=0}{literal}"; - if(recipient == 'Participant Status' || recipient == 'Participant Role'){ + if(recipientMapping[recipient] == 'Participant Status' || recipientMapping[recipient] == 'participant_role'){ var elementID = '#recipient_listing'; cj( elementID ).html(''); - cj.post(postUrl, {recipient: recipient}, + cj.post(postUrl, {recipient: recipientMapping[recipient]}, function ( response ) { response = eval( response ); for (iota = 0; iota < response.length; iota++) { -- 2.25.1