CRM-14417 - Remove all non-relevant statuses from the contribution status drop-down...
authorDave Greenberg <dave@civicrm.org>
Fri, 4 Apr 2014 03:13:58 +0000 (20:13 -0700)
committerDave Greenberg <dave@civicrm.org>
Fri, 4 Apr 2014 03:13:58 +0000 (20:13 -0700)
----------------------------------------
* CRM-14417:
  http://issues.civicrm.org/jira/browse/CRM-14417

CRM/Event/Form/EventFees.php

index 9b8368808b8eb95f289a03d04f5009fd29d5464b..94873fad87601652cd44405dbb426a963dee04a1 100644 (file)
@@ -424,23 +424,23 @@ 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'),