From a4e0d7b5ffaa63d9871592d8bcd07a1262053aa4 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Wed, 15 May 2013 18:40:53 -0700 Subject: [PATCH] CRM-12618 This includes Nicolas Ganivet patch to prevent editing of event fee for paid additional participants, and fix to hide Record Payment checkbox for them as well. ---------------------------------------- * CRM-12618: Event registration edit screen for additional registrants is incorrect http://issues.civicrm.org/jira/browse/CRM-12618 --- CRM/Event/Form/Participant.php | 12 ++++++++++++ templates/CRM/Event/Form/EventFees.tpl | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 757be992e0..e69e7f5b4b 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -233,6 +233,18 @@ class CRM_Event_Form_Participant extends CRM_Contact_Form_Task { $this->_paymentId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $this->_id, 'id', 'participant_id' ); + // CRM-12615 - Get payment information from the primary registration + if ((!$this->_paymentId) && ($this->_action == CRM_Core_Action::UPDATE)) { + $registered_by_id = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', + $this->_id, 'registered_by_id', 'id' + ); + if ($registered_by_id) { + $this->_paymentId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', + $registered_by_id, 'id', 'participant_id' + ); + $this->assign('registeredByParticipantId', $registered_by_id); + } + } } // get the option value for custom data type diff --git a/templates/CRM/Event/Form/EventFees.tpl b/templates/CRM/Event/Form/EventFees.tpl index c227b5ddf5..4e981e3bdc 100644 --- a/templates/CRM/Event/Form/EventFees.tpl +++ b/templates/CRM/Event/Form/EventFees.tpl @@ -48,7 +48,7 @@ {else} {assign var=isRecordPayment value=0 } -
{ts}No any active price fields found for this event!{/ts}
+
{ts}No active price fields found for this event!{/ts}
{/if} {/if} @@ -56,7 +56,7 @@ {/if} - { if $accessContribution and ! $participantMode and ($action neq 2 or !$rows.0.contribution_id or $onlinePendingContributionId) and $isRecordPayment } + { if $accessContribution and ! $participantMode and ($action neq 2 or !$rows.0.contribution_id or $onlinePendingContributionId) and $isRecordPayment and ! $registeredByParticipantId } {$form.record_contribution.label} {$form.record_contribution.html}
-- 2.25.1