HR-330 : case status should return filter=0 by default
authoryashodha <yashodha.chaku@webaccess.co.in>
Sat, 12 Apr 2014 00:51:22 +0000 (06:21 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Sat, 12 Apr 2014 00:51:22 +0000 (06:21 +0530)
CRM/Case/Form/Activity/OpenCase.php
CRM/Case/PseudoConstant.php

index f5801502c14fdf226cae01fe1114b5ba06831e47..cc3ed18dc0b4c026ff07de46a77ad5a310084bb2 100644 (file)
@@ -163,7 +163,11 @@ class CRM_Case_Form_Activity_OpenCase {
       $element->freeze();
     }
 
-    $csElement = $form->addSelect('status_id', array(), TRUE);
+    $csElement = $form->add('select', 'status_id', ts('Case Status'),
+      CRM_Case_PseudoConstant::caseStatus(),
+      FALSE
+    );
+
     if ($form->_caseStatusId) {
       $csElement->freeze();
     }
index 62018aea27e24e94e5c34e29cb318ab3033c1440..c07e0cfae77789309b92720481cca22a780d8297 100644 (file)
@@ -89,11 +89,15 @@ class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant {
    * @return array - array reference of all case statues
    * @static
    */
-  public static function caseStatus($column = 'label', $onlyActive = TRUE) {
+  public static function caseStatus($column = 'label', $onlyActive = TRUE, $condition = NULL) {
     $cacheKey = "{$column}_" . (int)$onlyActive;
+    if (!$condition) {
+      $condition = 'AND filter = 0';
+    }
+
     if (!isset(self::$caseStatus[$cacheKey])) {
       self::$caseStatus[$cacheKey] = CRM_Core_OptionGroup::values('case_status',
-        FALSE, FALSE, FALSE, NULL,
+        FALSE, FALSE, FALSE, $condition,
         $column, $onlyActive
       );
     }