<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
* @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, $fresh = FALSE) {
$cacheKey = "{$column}_" . (int)$onlyActive;
- if (!isset(self::$caseStatus[$cacheKey])) {
+ if (!$condition) {
+ $condition = 'AND filter = 0';
+ }
+
+ if (!isset(self::$caseStatus[$cacheKey]) || $fresh) {
self::$caseStatus[$cacheKey] = CRM_Core_OptionGroup::values('case_status',
- FALSE, FALSE, FALSE, NULL,
- $column, $onlyActive
+ FALSE, FALSE, FALSE, $condition,
+ $column, $onlyActive, $fresh
);
}
* @return array - array reference of all case type
* @static
*/
- public static function caseType($column = 'label', $onlyActive = TRUE) {
+ public static function caseType($column = 'label', $onlyActive = TRUE, $condition = NULL) {
$cacheKey = "{$column}_" . (int)$onlyActive;
+ if (!$condition) {
+ $condition = 'AND filter = 0';
+ }
if (!isset(self::$caseType[$cacheKey])) {
self::$caseType[$cacheKey] = CRM_Core_OptionGroup::values('case_type',
- FALSE, FALSE, FALSE, NULL,
+ FALSE, FALSE, FALSE, $condition,
$column, $onlyActive
);
}
civicrm_option_group g
WHERE v.option_group_id = g.id
AND g.name = 'activity_type'
- AND v.is_active = 1
+ AND v.is_active = 1
AND g.is_active = 1";
if (!$all) {
/**
* Flush given pseudoconstant so it can be reread from db
- * nex time it's requested.
+ * next time it's requested.
*
* @access public
* @static
* @param boolean $name pseudoconstant to be flushed
*
*/
- public static function flush($name) {
+ public static function flush($name = 'cache') {
if (isset(self::$$name)) {
self::$$name = NULL;
}