X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FForm%2FEventFees.php;h=753417c8091d1c99cf3296ddf0b6587af0045977;hb=03298d98322f2da05e2ab30cb0e2d5b90df47ab3;hp=af23d5fb53df9c44846a2ad44855a657a0d4e6e3;hpb=76dc6318bb27b13ff7b78c429878c8a06949666f;p=civicrm-core.git diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php index af23d5fb53..753417c809 100644 --- a/CRM/Event/Form/EventFees.php +++ b/CRM/Event/Form/EventFees.php @@ -1,9 +1,9 @@ _action == CRM_Core_Action::ADD && !$form->_mode && $form->_isPaidEvent) { $defaults[$form->_pId]['record_contribution'] = 1; } - + //CRM-13420 if (empty($defaults['payment_instrument_id'])) { $defaults[$form->_pId]['payment_instrument_id'] = key(CRM_Core_OptionGroup::values('payment_instrument', FALSE, FALSE, FALSE, 'AND is_default = 1')); @@ -254,6 +258,10 @@ class CRM_Event_Form_EventFees { * * @access public * + * @param $participantID + * @param null $eventID + * @param bool $includeQtyZero + * * @return void */ static function setDefaultPriceSet($participantID, $eventID = NULL, $includeQtyZero = TRUE) { @@ -336,6 +344,8 @@ SELECT id, html_type /** * Function to build the form * + * @param $form + * * @return void * @access public */ @@ -424,30 +434,30 @@ SELECT id, html_type $form->assign('showTransactionId', TRUE); } - $allowStatuses = array(); - $statuses = CRM_Contribute_PseudoConstant::contributionStatus(); - if ($form->get('onlinePendingContributionId')) { - $statusNames = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); - foreach ($statusNames as $val => $name) { - if (in_array($name, array( - 'In Progress', 'Overdue'))) { - continue; - } - $allowStatuses[$val] = $statuses[$val]; - } - } - else { - $allowStatuses = $statuses; + $status = CRM_Contribute_PseudoConstant::contributionStatus(); + + // CRM-14417 suppressing contribution statuses that are NOT relevant to new participant registrations + $statusName = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); + foreach (array( + 'Cancelled', + 'Failed', + 'In Progress', + 'Overdue', + 'Refunded', + 'Pending refund', + ) as $suppress) { + unset($status[CRM_Utils_Array::key($suppress, $statusName)]); } + $form->add('select', 'contribution_status_id', - ts('Payment Status'), $allowStatuses + ts('Payment Status'), $status ); $form->add('text', 'check_number', ts('Check Number'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution', 'check_number') ); - $form->add('text', 'total_amount', ts('Total Amount'), + $form->add('text', 'total_amount', ts('Amount'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution', 'total_amount') ); }