From d06f3157b539f7d405d44f2a1bb02868183b4d8c Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Tue, 8 Apr 2014 13:42:46 -0700 Subject: [PATCH] CRM-13973 - Fix bugs in Change Selections form - admin price fields not displayed and protected property accessed causing fatal. ---------------------------------------- * CRM-13973: https://issues.civicrm.org/jira/browse/CRM-13973 --- CRM/Event/Form/ParticipantFeeSelection.php | 2 +- CRM/Event/Form/Registration/Register.php | 4 +++- templates/CRM/Event/Form/ParticipantFeeSelection.tpl | 2 +- templates/CRM/Price/Form/PriceSet.tpl | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CRM/Event/Form/ParticipantFeeSelection.php b/CRM/Event/Form/ParticipantFeeSelection.php index 0da0571278..72253cb29e 100644 --- a/CRM/Event/Form/ParticipantFeeSelection.php +++ b/CRM/Event/Form/ParticipantFeeSelection.php @@ -54,7 +54,7 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form { protected $fromEmailId = NULL; - protected $_eventId = NULL; + public $_eventId = NULL; public $_action = NULL; diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 9fcc1e6a6a..647873ce3c 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -596,8 +596,10 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { $form->add('hidden', 'priceSetId', $form->_priceSetId); foreach ($form->_feeBlock as $field) { + // public AND admin visibility fields are included for back-office registration and back-office change selections if (CRM_Utils_Array::value('visibility', $field) == 'public' || - $className == 'CRM_Event_Form_Participant' + $className == 'CRM_Event_Form_Participant' || + $className == 'CRM_Event_Form_ParticipantFeeSelection' ) { $fieldId = $field['id']; $elementName = 'price_' . $fieldId; diff --git a/templates/CRM/Event/Form/ParticipantFeeSelection.tpl b/templates/CRM/Event/Form/ParticipantFeeSelection.tpl index 59b7e09447..8b862babc8 100644 --- a/templates/CRM/Event/Form/ParticipantFeeSelection.tpl +++ b/templates/CRM/Event/Form/ParticipantFeeSelection.tpl @@ -122,7 +122,7 @@ CRM.$(function($) { - + {if $paymentInfo}
{$form.amount.label}{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" dontInclCal="true"}
{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" dontInclCal="true" context="participant"}
diff --git a/templates/CRM/Price/Form/PriceSet.tpl b/templates/CRM/Price/Form/PriceSet.tpl index e09f073d77..47d1437954 100644 --- a/templates/CRM/Price/Form/PriceSet.tpl +++ b/templates/CRM/Price/Form/PriceSet.tpl @@ -29,7 +29,7 @@ {/if} {foreach from=$priceSet.fields item=element key=field_id} - {* Skip 'Admin' visibility price fields since this tpl is used in online registration. *} + {* Skip 'Admin' visibility price fields WHEN this tpl is used in online registration. *} {if $element.visibility EQ 'public' || $context eq 'standalone' || $context eq 'advanced' || $context eq 'search' || $context eq 'participant' || $context eq 'dashboard' || $action eq 1024}
{if ($element.html_type eq 'CheckBox' || $element.html_type == 'Radio') && $element.options_per_line} -- 2.25.1