Skip to content

Commit

Permalink
Merge pull request #16337 from eileenmcnaughton/ev_static
Browse files Browse the repository at this point in the history
Change function buildEventFeeForm to non-static
  • Loading branch information
seamuslee001 authored Jan 22, 2020
2 parents 35667d5 + eeca033 commit 6baf465
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function preProcess() {
// when fee amount is included in form
if (!empty($_POST['hidden_feeblock']) || !empty($_POST['send_receipt'])) {
CRM_Event_Form_EventFees::preProcess($this);
self::buildEventFeeForm($this);
$this->buildEventFeeForm($this);
CRM_Event_Form_EventFees::setDefaultValues($this);
}

Expand Down Expand Up @@ -585,7 +585,7 @@ public function buildQuickForm() {
$this->assign('partiallyPaidStatusId', $partiallyPaidStatusId);

if ($this->_showFeeBlock) {
return self::buildEventFeeForm($this);
return $this->buildEventFeeForm($this);
}

//need to assign custom data type to the template
Expand Down Expand Up @@ -1653,24 +1653,21 @@ protected function getStatusMsg($params, $sent, $updateStatusMsg, $notSent) {
/**
* Build the form object.
*
* @param CRM_Core_Form $form
* @param \CRM_Event_Form_Participant $form
*
* @return bool
* @throws \CRM_Core_Exception
* @throws \Exception
*/
public static function buildEventFeeForm(&$form) {
public function buildEventFeeForm($form) {
if ($form->_eventId) {
$form->_isPaidEvent = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'is_monetary');
if ($form->_isPaidEvent) {
$form->addElement('hidden', 'hidden_feeblock', 1);
}

// make sure this is for backoffice registration.
if ($form->getName() == 'Participant') {
$eventfullMsg = CRM_Event_BAO_Participant::eventFullMessage($form->_eventId, $form->_pId);
$form->addElement('hidden', 'hidden_eventFullMsg', $eventfullMsg, ['id' => 'hidden_eventFullMsg']);
}
$eventfullMsg = CRM_Event_BAO_Participant::eventFullMessage($form->_eventId, $form->_pId);
$form->addElement('hidden', 'hidden_eventFullMsg', $eventfullMsg, ['id' => 'hidden_eventFullMsg']);
}

if ($form->_pId) {
Expand Down

0 comments on commit 6baf465

Please sign in to comment.