Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notice fixes on AdditionalParticipant page #29234

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see line below

$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