From: Eileen McNaughton Date: Mon, 20 Dec 2021 01:17:24 +0000 (+1300) Subject: Simplify handing when name not present (new contribution) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a3d9eb31ce3b0e5de3f13a1b2aaa65bf0620274f;p=civicrm-core.git Simplify handing when name not present (new contribution) --- diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index d00a4a23c1..bec62eef88 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -228,14 +228,7 @@ LIMIT 1 ]; // on create fetch statuses on basis of component if (!$name) { - $statusNamesToUnset = array_merge($statusNamesToUnset, [ - 'Refunded', - 'Chargeback', - 'Pending refund', - 'In Progress', - 'Overdue', - 'Partially paid', - ]); + return self::getPendingCompleteFailedAndCancelledStatuses(); } else { switch ($name) { diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 4d694d102e..9426a585a7 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1733,7 +1733,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } $form->add('select', 'contribution_status_id', - ts('Payment Status'), CRM_Contribute_BAO_Contribution_Utils::getPendingAndCompleteStatuses('participant') + ts('Payment Status'), CRM_Contribute_BAO_Contribution_Utils::getPendingAndCompleteStatuses() ); $form->add('text', 'check_number', ts('Check Number'), diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index 2bd26231ae..51f1dd01f5 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -359,7 +359,7 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form { ); $this->add('select', 'contribution_status_id', ts('Payment Status'), - CRM_Contribute_BAO_Contribution_Utils::getPendingAndCompleteStatuses('membership') + CRM_Contribute_BAO_Contribution_Utils::getPendingAndCompleteStatuses() ); $this->add('text', 'check_number', ts('Check Number'),