+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*/
/**
*/
class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant {
- /**
- * Case statues
- * @var array
- */
- static $caseStatus = array();
-
- /**
- * Redaction rules
- * @var array
- */
- static $redactionRule;
-
- /**
- * Case type
- * @var array
- */
- static $caseType = array();
-
- /**
- * Encounter Medium
- * @var array
- */
- static $encounterMedium = array();
-
/**
* Activity type
* @var array
* array reference of all case statues
*/
public static function caseStatus($column = 'label', $onlyActive = TRUE, $condition = NULL, $fresh = FALSE) {
- $cacheKey = "{$column}_" . (int) $onlyActive;
if (!$condition) {
$condition = 'AND filter = 0';
}
- if (!isset(self::$caseStatus[$cacheKey]) || $fresh) {
- self::$caseStatus[$cacheKey] = CRM_Core_OptionGroup::values('case_status',
- FALSE, FALSE, FALSE, $condition,
- $column, $onlyActive, $fresh
- );
- }
+ return CRM_Core_OptionGroup::values('case_status',
+ FALSE, FALSE, FALSE, $condition,
+ $column, $onlyActive, $fresh
+ );
- return self::$caseStatus[$cacheKey];
}
/**
* array reference of all redaction rules
*/
public static function redactionRule($filter = NULL) {
- // if ( ! self::$redactionRule ) {
- self::$redactionRule = array();
-
+ $condition = NULL;
if ($filter === 0) {
$condition = " AND (v.filter = 0 OR v.filter IS NULL)";
}
elseif ($filter === 1) {
$condition = " AND v.filter = 1";
}
- elseif ($filter === NULL) {
- $condition = NULL;
- }
- self::$redactionRule = CRM_Core_OptionGroup::values('redaction_rule', TRUE, FALSE, FALSE, $condition);
- // }
- return self::$redactionRule;
+ return CRM_Core_OptionGroup::values('redaction_rule', TRUE, FALSE, FALSE, $condition);
}
/**
* array reference of all Encounter Medium.
*/
public static function encounterMedium($column = 'label', $onlyActive = TRUE) {
- $cacheKey = "{$column}_" . (int) $onlyActive;
- if (!isset(self::$encounterMedium[$cacheKey])) {
- self::$encounterMedium[$cacheKey] = CRM_Core_OptionGroup::values('encounter_medium',
- FALSE, FALSE, FALSE, NULL,
- $column, $onlyActive
- );
- }
-
- return self::$encounterMedium[$cacheKey];
+ return CRM_Core_OptionGroup::values('encounter_medium',
+ FALSE, FALSE, FALSE, NULL,
+ $column, $onlyActive
+ );
}
/**
self::$activityTypeList[$cache] = array();
$query = "
- SELECT v.label as label ,v.value as value, v.name as name, v.description as description
+ SELECT v.label as label ,v.value as value, v.name as name, v.description as description, v.icon
FROM civicrm_option_value v,
civicrm_option_group g
WHERE v.option_group_id = g.id
$activityTypes[$index]['id'] = $dao->value;
$activityTypes[$index]['label'] = $dao->label;
$activityTypes[$index]['name'] = $dao->name;
+ $activityTypes[$index]['icon'] = $dao->icon;
$activityTypes[$index]['description'] = $dao->description;
}
self::$activityTypeList[$cache] = $activityTypes;