本文整理汇总了PHP中CRM_Core_PseudoConstant::individualsuffix方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_PseudoConstant::individualsuffix方法的具体用法?PHP CRM_Core_PseudoConstant::individualsuffix怎么用?PHP CRM_Core_PseudoConstant::individualsuffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_PseudoConstant
的用法示例。
在下文中一共展示了CRM_Core_PseudoConstant::individualsuffix方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: whereClause
/**
* Given a list of conditions in params generate the required
* where clause
*
* @return void
* @access public
*/
function whereClause()
{
//CRM_Core_Error::debug( 'p', $this->_params );
// domain id is always part of the where clause
$config =& CRM_Core_Config::singleton();
$this->_where[] = 'civicrm_contact.domain_id = ' . $config->domainID();
// check for both id and contact_id
$id = CRM_Utils_Array::value('id', $this->_params);
if (!$id) {
$id = CRM_Utils_Array::value('contact_id', $this->_params);
}
if ($id) {
$this->_where[] = "civicrm_contact.id = {$id}";
}
$this->contactType();
$this->sortName();
$this->sortByCharacter();
$this->locationTypeAndName();
$this->group();
$this->tag();
$this->postalCode();
$this->activity();
$this->includeContactIds();
$this->contribution();
//CRM_Core_Error::debug( 'p', $this->_params );
//CRM_Core_Error::debug( 'f', $this->_fields );
foreach ($this->_fields as $name => $field) {
if (empty($name) || in_array($name, $GLOBALS['_CRM_CONTACT_BAO_QUERY']['skipFields'])) {
continue;
}
$value = CRM_Utils_Array::value($name, $this->_params);
if (!isset($value) || $value == null) {
continue;
}
if (CRM_Core_BAO_CustomField::getKeyID($name)) {
continue;
}
//check if the location type exits for fields
$lType = '';
$locType = array();
$locType = explode('-', $name);
if (is_numeric($locType[1])) {
$this->_params['location_type'] = array($locType[1] => 1);
$lType = $this->locationTypeAndName(true);
}
//add phone type if exists
if ($locType[2]) {
$this->_where[] = "civicrm_phone.phone_type ='" . $locType[2] . "'";
}
// FIXME: the LOWER/strtolower pairs below most probably won't work
// with non-US-ASCII characters, as even if MySQL does the proper
// thing with LOWER-ing them (4.0 almost certainly won't, but then
// we don't officially support 4.0 for non-US-ASCII data), PHP
// won't do the proper thing with strtolower-ing them unless the
// underlying operating system uses an UTF-8 locale for LC_CTYPE
// for the user the webserver runs at (or suEXECs); we should use
// mb_strtolower(), but then we'd require mb_strings support; we
// could wrap this in function_exist(), though
if (substr($name, 0, 14) === 'state_province') {
$states =& CRM_Core_PseudoConstant::stateProvince();
if (is_numeric($value)) {
$value = $states[(int) $value];
}
$this->_where[] = 'LOWER(' . $field['where'] . ') = "' . strtolower(addslashes($value)) . '"';
if (!$lType) {
$this->_qill[] = ts('State - "%1"', array(1 => $value));
} else {
$this->_qill[] = ts('State (%2) - "%1"', array(1 => $value, 2 => $lType));
}
} else {
if (substr($name, 0, 7) === 'country') {
$countries =& CRM_Core_PseudoConstant::country();
if (is_numeric($value)) {
$value = $countries[(int) $value];
}
$this->_where[] = 'LOWER(' . $field['where'] . ') = "' . strtolower(addslashes($value)) . '"';
if (!$lType) {
$this->_qill[] = ts('Country - "%1"', array(1 => $value));
} else {
$this->_qill[] = ts('Country (%2) - "%1"', array(1 => $value, 2 => $lType));
}
} else {
if ($name === 'individual_prefix') {
$individualPrefixs =& CRM_Core_PseudoConstant::individualPrefix();
if (is_numeric($value)) {
$value = $individualPrefixs[(int) $value];
}
$this->_where[] = 'LOWER(' . $field['where'] . ') = "' . strtolower(addslashes($value)) . '"';
$this->_qill[] = ts('Individual Prefix - "%1"', array(1 => $value));
} else {
if ($name === 'individual_suffix') {
$individualSuffixs =& CRM_Core_PseudoConstant::individualsuffix();
if (is_numeric($value)) {
//.........这里部分代码省略.........
示例2: restWhere
//.........这里部分代码省略.........
$where = $field['where'];
}
if (is_numeric($value)) {
$where = str_replace('.name', '.id', $where);
$this->_where[$grouping][] = self::buildClause($where, $op, $value, 'Positive');
$counties = CRM_Core_PseudoConstant::county();
$value = $counties[(int) $value];
} else {
$wc = $op != 'LIKE' ? "LOWER({$where})" : $where;
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
}
if (!$lType) {
$this->_qill[$grouping][] = ts('County') . " {$op} '{$value}'";
} else {
$this->_qill[$grouping][] = ts('County') . " ({$lType}) {$op} '{$value}'";
}
} elseif ($name === 'world_region') {
$worldRegions = CRM_Core_PseudoConstant::worldRegion();
if (is_numeric($value)) {
$value = $worldRegions[(int) $value];
}
$wc = $op != 'LIKE' ? "LOWER({$field['where']})" : "{$field['where']}";
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
$this->_qill[$grouping][] = ts('World Region') . " {$op} '{$value}'";
} elseif ($name === 'individual_prefix') {
$individualPrefixs = CRM_Core_PseudoConstant::individualPrefix();
if (is_numeric($value)) {
$value = $individualPrefixs[(int) $value];
}
$wc = $op != 'LIKE' ? "LOWER({$field['where']})" : "{$field['where']}";
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
$this->_qill[$grouping][] = ts('Individual Prefix') . " {$op} '{$value}'";
} elseif ($name === 'individual_suffix') {
$individualSuffixs = CRM_Core_PseudoConstant::individualsuffix();
if (is_numeric($value)) {
$value = $individualSuffixs[(int) $value];
}
$wc = $op != 'LIKE' ? "LOWER({$field['where']})" : "{$field['where']}";
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
$this->_qill[$grouping][] = ts('Individual Suffix') . " {$op} '{$value}'";
} elseif ($name === 'gender') {
$genders = CRM_Core_PseudoConstant::gender();
if (is_numeric($value)) {
$value = $genders[(int) $value];
}
$wc = $op != 'LIKE' ? "LOWER({$field['where']})" : "{$field['where']}";
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
$this->_qill[$grouping][] = ts('Gender') . " {$op} '{$value}'";
self::$_openedPanes['Demographics'] = TRUE;
} elseif ($name === 'birth_date') {
$date = CRM_Utils_Date::processDate($value);
$this->_where[$grouping][] = self::buildClause("contact_a.{$name}", $op, $date);
if ($date) {
$date = CRM_Utils_Date::customFormat($date);
$this->_qill[$grouping][] = "{$field['title']} {$op} \"{$date}\"";
} else {
$this->_qill[$grouping][] = "{$field['title']} {$op}";
}
self::$_openedPanes['Demographics'] = TRUE;
} elseif ($name === 'deceased_date') {
$date = CRM_Utils_Date::processDate($value);
$this->_where[$grouping][] = self::buildClause("contact_a.{$name}", $op, $date);
if ($date) {
$date = CRM_Utils_Date::customFormat($date);
$this->_qill[$grouping][] = "{$field['title']} {$op} \"{$date}\"";
} else {
示例3: restWhere
//.........这里部分代码省略.........
$where = str_replace('.name', '.id', $where);
$this->_where[$grouping][] = self::buildClause($where, $op, $value, 'Positive');
$counties =& CRM_Core_PseudoConstant::county();
$value = $counties[(int) $value];
} else {
$wc = $op != 'LIKE' ? "LOWER({$where})" : $where;
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
}
if (!$lType) {
$this->_qill[$grouping][] = ts('County') . " {$op} '{$value}'";
} else {
$this->_qill[$grouping][] = ts('County') . " ({$lType}) {$op} '{$value}'";
}
} else {
if ($name === 'world_region') {
$worldRegions =& CRM_Core_PseudoConstant::worldRegion();
if (is_numeric($value)) {
$value = $worldRegions[(int) $value];
}
$wc = $op != 'LIKE' ? "LOWER({$field['where']})" : "{$field['where']}";
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
$this->_qill[$grouping][] = ts('World Region') . " {$op} '{$value}'";
} else {
if ($name === 'individual_prefix') {
$individualPrefixs =& CRM_Core_PseudoConstant::individualPrefix();
if (is_numeric($value)) {
$value = $individualPrefixs[(int) $value];
}
$wc = $op != 'LIKE' ? "LOWER({$field['where']})" : "{$field['where']}";
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
$this->_qill[$grouping][] = ts('Individual Prefix') . " {$op} '{$value}'";
} else {
if ($name === 'individual_suffix') {
$individualSuffixs =& CRM_Core_PseudoConstant::individualsuffix();
if (is_numeric($value)) {
$value = $individualSuffixs[(int) $value];
}
$wc = $op != 'LIKE' ? "LOWER({$field['where']})" : "{$field['where']}";
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
$this->_qill[$grouping][] = ts('Individual Suffix') . " {$op} '{$value}'";
} else {
if ($name === 'gender') {
$genders =& CRM_Core_PseudoConstant::gender();
if (is_numeric($value)) {
$value = $genders[(int) $value];
}
$wc = $op != 'LIKE' ? "LOWER({$field['where']})" : "{$field['where']}";
$this->_where[$grouping][] = self::buildClause($wc, $op, $value, 'String');
$this->_qill[$grouping][] = ts('Gender') . " {$op} '{$value}'";
} else {
if ($name === 'birth_date') {
$date = CRM_Utils_Date::format($value);
$this->_where[$grouping][] = self::buildClause("contact_a.{$name}", $op, $date);
if ($date) {
$date = CRM_Utils_Date::customFormat($date);
$this->_qill[$grouping][] = "{$field['title']} {$op} \"{$date}\"";
} else {
$this->_qill[$grouping][] = "{$field['title']} {$op}";
}
} else {
if ($name === 'deceased_date') {
$date = CRM_Utils_Date::format($value);
$this->_where[$grouping][] = self::buildClause("contact_a.{$name}", $op, $date);
if ($date) {
$date = CRM_Utils_Date::customFormat($date);
$this->_qill[$grouping][] = "{$field['title']} {$op} \"{$date}\"";