本文整理汇总了PHP中CRM_Case_PseudoConstant::redactionRule方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Case_PseudoConstant::redactionRule方法的具体用法?PHP CRM_Case_PseudoConstant::redactionRule怎么用?PHP CRM_Case_PseudoConstant::redactionRule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Case_PseudoConstant
的用法示例。
在下文中一共展示了CRM_Case_PseudoConstant::redactionRule方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function &caseInfo($clientID, $caseID)
{
require_once "CRM/Case/PseudoConstant.php";
$case = $this->_redactionRegexRules = array();
if (empty($this->_redactionStringRules)) {
$this->_redactionStringRules = array();
}
if ($this->_isRedact == 1) {
foreach (array('redactionStringRules', 'redactionRegexRules') as $key => $rule) {
${$rule} = CRM_Case_PseudoConstant::redactionRule($key);
if (!empty(${$rule})) {
foreach (${$rule} as &$val) {
//suffixed with a randomly generated 4-digit number
$val .= rand(10000, 100000);
}
if (!empty($this->{'_' . $rule})) {
$this->{'_' . $rule} = CRM_Utils_Array::crmArrayMerge($this->{'_' . $rule}, ${$rule});
} else {
$this->{'_' . $rule} = ${$rule};
}
}
}
}
$client = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $clientID, 'display_name');
// add Client to the strings to be redacted across the case session
if (!array_key_exists($client, $this->_redactionStringRules)) {
$this->_redactionStringRules = CRM_Utils_Array::crmArrayMerge($this->_redactionStringRules, array($client => 'name_' . rand(10000, 100000)));
$clientSortName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $clientID, 'sort_name');
if (!array_key_exists($clientSortName, $this->_redactionStringRules)) {
$this->_redactionStringRules[$clientSortName] = $this->_redactionStringRules[$client];
}
}
$case['clientName'] = $this->redact($client);
require_once 'CRM/Case/DAO/Case.php';
$dao = new CRM_Case_DAO_Case();
$dao->id = $caseID;
if ($dao->find(true)) {
$case['subject'] = $dao->subject;
$case['start_date'] = $dao->start_date;
$case['end_date'] = $dao->end_date;
// FIXME: when we resolve if case_type_is single or multi-select
if (strpos($dao->case_type_id, CRM_Core_DAO::VALUE_SEPARATOR) !== false) {
$caseTypeID = substr($dao->case_type_id, 1, -1);
} else {
$caseTypeID = $dao->case_type_id;
}
$caseTypeIDs = explode(CRM_Core_DAO::VALUE_SEPARATOR, $dao->case_type_id);
$case['caseType'] = CRM_Core_OptionGroup::getLabel('case_type', $caseTypeID);
$caseTypeName = CRM_Case_PseudoConstant::caseTypeName($caseID);
$case['caseTypeName'] = $caseTypeName['name'];
$case['status'] = CRM_Core_OptionGroup::getLabel('case_status', $dao->status_id);
}
return $case;
}
示例2: foreach
function &getRedactionRules()
{
foreach (array('redactionStringRules', 'redactionRegexRules') as $key => $rule) {
${$rule} = CRM_Case_PseudoConstant::redactionRule($key);
if (!empty(${$rule})) {
foreach (${$rule} as &$val) {
//suffixed with a randomly generated 4-digit number
if ($key == 'redactionStringRules') {
$val .= rand(10000, 100000);
}
}
if (!empty($this->{'_' . $rule})) {
$this->{'_' . $rule} = CRM_Utils_Array::crmArrayMerge($this->{'_' . $rule}, ${$rule});
} else {
$this->{'_' . $rule} = ${$rule};
}
}
}
}
示例3: redactionRule
/**
* Get all the redaction rules.
*
*
* @param null $filter
*
* @return array
* array reference of all redaction rules
*/
public static function redactionRule($filter = NULL)
{
// if ( ! self::$redactionRule ) {
self::$redactionRule = array();
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;
}
示例4: redactionRule
/**
* Get all the redaction rules
*
* @access public
* @return array - array reference of all redaction rules
* @static
*/
public static function redactionRule($filter = null)
{
// if ( ! self::$redactionRule ) {
self::$redactionRule = array();
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;
}
require_once 'CRM/Core/OptionGroup.php';
self::$redactionRule = CRM_Core_OptionGroup::values('redaction_rule', true, false, false, $condition);
// }
return self::$redactionRule;
}