Skip to content

Commit

Permalink
Merge pull request #29234 from eileenmcnaughton/add_notice
Browse files Browse the repository at this point in the history
Notice fixes on AdditionalParticipant page
  • Loading branch information
eileenmcnaughton authored Feb 5, 2024
2 parents fd7cc45 + 0cfa0cf commit 8bbff81
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CRM/Event/Form/Registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ public function preProcess() {
}
$this->_availableRegistrations = $this->get('availableRegistrations');
$this->_participantIDS = $this->get('participantIDs');
// Required for currency formatting in the JS layer
// this is a temporary fix intended to resolve a regression quickly
// And assigning moneyFormat for js layer formatting
// will only work until that is done.
// https://github.com/civicrm/civicrm-core/pull/19151
$this->assign('moneyFormat', CRM_Utils_Money::format(1234.56));

//check if participant allow to walk registration wizard.
$this->_allowConfirmation = $this->get('allowConfirmation');
Expand Down
11 changes: 5 additions & 6 deletions CRM/Event/Form/Registration/AdditionalParticipant.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function getUFGroupIDs() {
*/
public function preProcess() {
parent::preProcess();

$this->addExpectedSmartyVariable('additionalCustomPost');
$participantNo = substr($this->_name, 12);

//lets process in-queue participants.
Expand All @@ -104,14 +104,11 @@ public function preProcess() {

$participantCnt = $participantNo + 1;
$this->assign('formId', $participantNo);
$this->_params = [];
$this->_params = $this->get('params');

$participantTot = $this->_params[0]['additional_participants'] + 1;
$skipCount = count(array_keys($this->_params, "skip"));
if ($skipCount) {
$this->assign('skipCount', $skipCount);
}
$this->assign('skipCount', $skipCount);
$this->setTitle(ts('Register Participant %1 of %2', [1 => $participantCnt, 2 => $participantTot]));

//CRM-4320, hack to check last participant.
Expand Down Expand Up @@ -326,8 +323,10 @@ public function buildQuickForm() {
}
}

// Assign false & maybe overwrite with TRUE below.
$this->assign('allowGroupOnWaitlist', FALSE);
// for priceset with count
if ($pricesetFieldsCount && !empty($this->_values['event']['has_waitlist']) &&
if ($pricesetFieldsCount && $this->getEventValue('has_waitlist') &&
!$this->_allowConfirmation
) {

Expand Down
6 changes: 0 additions & 6 deletions CRM/Event/Form/Registration/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,6 @@ public function buildQuickForm() {
$this->assign('isAdditionalParticipants', $isAdditionalParticipants);

if ($this->_values['event']['is_monetary']) {
// Required for currency formatting in the JS layer
// this is a temporary fix intended to resolve a regression quickly
// And assigning moneyFormat for js layer formatting
// will only work until that is done.
// https://github.com/civicrm/civicrm-core/pull/19151
$this->assign('moneyFormat', CRM_Utils_Money::format(1234.56));
// build amount only when needed, skip incase of event full and waitlisting is enabled
// and few other conditions check preProcess()
if (!$this->_noFees) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<div class="crm-event-id-{$event.id} crm-block crm-event-additionalparticipant-form-block">
{if $priceSet}
<fieldset id="priceset" class="crm-public-form-item crm-group priceset-group"><legend>{$event.fee_label}</legend>
{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" hideTotal=false}
{include file="CRM/Price/Form/PriceSet.tpl" extends="Event" hideTotal=false isAdditionalParticipants=true}
</fieldset>
{else}
{if $paidEvent}
Expand Down

0 comments on commit 8bbff81

Please sign in to comment.