X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FBAO%2FParticipant.php;h=b48daaa4b3485f9c409693072f493f9e84ab47b3;hb=b4167b7ca6942d0995383555d0b8ae98e0af3cf8;hp=2684907be0a0b2ad6d2de169346ac98921c3aa13;hpb=056b65505e0a9a63e2bf34f08d6018a4c6633989;p=civicrm-core.git diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 2684907be0..b48daaa4b3 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -578,6 +578,10 @@ INNER JOIN civicrm_price_field field ON ( value.price_field_id = field.id * @param bool $checkPermission * Is this a permissioned retrieval? * + * @deprecated only called from event search, but without most of the details + * returned. Event search should call stop using this & get the metadata + * a better way. + * * @return array * array of importable Fields */ @@ -608,6 +612,7 @@ INNER JOIN civicrm_price_field field ON ( value.price_field_id = field.id // Split status and status id into 2 fields // Fixme: it would be better to leave as 1 field and intelligently handle both during import + // note import undoes this - it is still here in case the search usage uses it. $participantStatus = [ 'participant_status' => [ 'title' => ts('Participant Status'), @@ -619,6 +624,7 @@ INNER JOIN civicrm_price_field field ON ( value.price_field_id = field.id // Split role and role id into 2 fields // Fixme: it would be better to leave as 1 field and intelligently handle both during import + // note import undoes this - it is still here in case the search usage uses it. $participantRole = [ 'participant_role' => [ 'title' => ts('Participant Role'), @@ -1866,8 +1872,8 @@ WHERE civicrm_participant.contact_id = {$contactID} AND $details['ineligible_message'] = ts('This event registration can not be transferred or cancelled. Contact the event organizer if you have questions.'); return $details; } - //verify participant status is still Registered - if ($details['status'] != 'Registered') { + // Verify participant status is one that can be self-cancelled + if (!in_array($details['status'], ['Registered', 'Pending from pay later', 'On waitlist'])) { $details['eligible'] = FALSE; $details['ineligible_message'] = ts('You cannot transfer or cancel your registration for %1 as you are not currently registered for this event.', [1 => $eventTitle]); return $details;