From: yashodha Date: Sat, 12 Apr 2014 00:51:22 +0000 (+0530) Subject: HR-330 : case status should return filter=0 by default X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1957e5cb3ba3e043d4ddc97ec990a16cb891906a;p=civicrm-core.git HR-330 : case status should return filter=0 by default --- diff --git a/CRM/Case/Form/Activity/OpenCase.php b/CRM/Case/Form/Activity/OpenCase.php index f5801502c1..cc3ed18dc0 100644 --- a/CRM/Case/Form/Activity/OpenCase.php +++ b/CRM/Case/Form/Activity/OpenCase.php @@ -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(); } diff --git a/CRM/Case/PseudoConstant.php b/CRM/Case/PseudoConstant.php index 62018aea27..c07e0cfae7 100644 --- a/CRM/Case/PseudoConstant.php +++ b/CRM/Case/PseudoConstant.php @@ -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 ); }