From c460c1967e378f5c9c96625db16f2c9dd7aaca40 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 15 May 2017 06:29:42 +0530 Subject: [PATCH] CRM-20573, fixed notice error ---------------------------------------- * CRM-20573: User deprecated function: Deprecated function on View Participabt form https://issues.civicrm.org/jira/browse/CRM-20573 --- CRM/Event/Form/Participant.php | 7 ++++--- CRM/Event/Form/ParticipantView.php | 7 ++++--- CRM/Event/Form/Task/Batch.php | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 144122ab17..5785e77fa7 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -265,9 +265,10 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } // get the option value for custom data type - $this->_roleCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantRole', 'name'); - $this->_eventNameCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantEventName', 'name'); - $this->_eventTypeCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantEventType', 'name'); + $customDataType = CRM_Core_OptionGroup::values('custom_data_type', FALSE, FALSE, FALSE, NULL, 'name'); + $this->_roleCustomDataTypeID = array_search('ParticipantRole', $customDataType); + $this->_eventNameCustomDataTypeID = array_search('ParticipantEventName', $customDataType); + $this->_eventTypeCustomDataTypeID = array_search('ParticipantEventType', $customDataType); $this->assign('roleCustomDataTypeID', $this->_roleCustomDataTypeID); $this->assign('eventNameCustomDataTypeID', $this->_eventNameCustomDataTypeID); $this->assign('eventTypeCustomDataTypeID', $this->_eventTypeCustomDataTypeID); diff --git a/CRM/Event/Form/ParticipantView.php b/CRM/Event/Form/ParticipantView.php index 2115adeefa..9229166142 100644 --- a/CRM/Event/Form/ParticipantView.php +++ b/CRM/Event/Form/ParticipantView.php @@ -133,9 +133,10 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form { } // get the option value for custom data type - $roleCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantRole', 'name'); - $eventNameCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantEventName', 'name'); - $eventTypeCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantEventType', 'name'); + $customDataType = CRM_Core_OptionGroup::values('custom_data_type', FALSE, FALSE, FALSE, NULL, 'name'); + $roleCustomDataTypeID = array_search('ParticipantRole', $customDataType); + $eventNameCustomDataTypeID = array_search('ParticipantEventName', $customDataType); + $eventTypeCustomDataTypeID = array_search('ParticipantEventType', $customDataType); $allRoleIDs = explode(CRM_Core_DAO::VALUE_SEPARATOR, $values[$participantID]['role_id']); $groupTree = array(); $finalTree = array(); diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index 515ce6d04b..dfde705859 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -158,9 +158,10 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { //fix for CRM-2752 // get the option value for custom data type - $this->_roleCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantRole', 'name'); - $this->_eventNameCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantEventName', 'name'); - $this->_eventTypeCustomDataTypeID = CRM_Core_OptionGroup::getValue('custom_data_type', 'ParticipantEventType', 'name'); + $customDataType = CRM_Core_OptionGroup::values('custom_data_type', FALSE, FALSE, FALSE, NULL, 'name'); + $this->_roleCustomDataTypeID = array_search('ParticipantRole', $customDataType); + $this->_eventNameCustomDataTypeID = array_search('ParticipantEventName', $customDataType); + $this->_eventTypeCustomDataTypeID = array_search('ParticipantEventType', $customDataType); // build custom data getFields array $customFieldsRole = CRM_Core_BAO_CustomField::getFields('Participant', FALSE, FALSE, NULL, $this->_roleCustomDataTypeID); -- 2.25.1