/** * Returns a user friendly text explaining the condition params * e.g. 'Older than 65' * * @return string * @access public */ public function userFriendlyConditionParams() { $operators = CRM_CivirulesConditions_Contact_InGroup::getOperatorOptions(); $operator = $this->conditionParams['operator']; $operatorLabel = ts('unknown'); if (isset($operators[$operator])) { $operatorLabel = $operators[$operator]; } $groups = ''; foreach ($this->conditionParams['group_ids'] as $gid) { if (strlen($groups)) { $groups .= ', '; } $groups .= civicrm_api3('Group', 'getvalue', array('return' => 'title', 'id' => $gid)); } return $operatorLabel . ' groups (' . $groups . ')'; }
/** * Method to get operators * * @return array * @access protected */ protected function getOperators() { return CRM_CivirulesConditions_Contact_InGroup::getOperatorOptions(); }