本文整理汇总了PHP中CRM_Contact_Form_Search_Custom_Base类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_Form_Search_Custom_Base类的具体用法?PHP CRM_Contact_Form_Search_Custom_Base怎么用?PHP CRM_Contact_Form_Search_Custom_Base使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Contact_Form_Search_Custom_Base类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pow
function __construct(&$formValues)
{
parent::__construct($formValues);
$this->_earthFlattening = 1.0 / 298.257223563;
$this->_earthRadiusSemiMajor = 6378137.0;
$this->_earthRadiusSemiMinor = $this->_earthRadiusSemiMajor * (1.0 - $this->_earthFlattening);
$this->_earthEccentricitySQ = 2 * $this->_earthFlattening - pow($this->_earthFlattening, 2);
// unset search profile if set
unset($this->_formValues['uf_group_id']);
if (!empty($this->_formValues)) {
// add the country and state
if (CRM_Utils_Array::value('country_id', $this->_formValues)) {
$this->_formValues['country'] = CRM_Core_PseudoConstant::country($this->_formValues['country_id']);
}
if (CRM_Utils_Array::value('state_province_id', $this->_formValues)) {
$this->_formValues['state_province'] = CRM_Core_PseudoConstant::stateProvince($this->_formValues['state_province_id']);
}
// use the address to get the latitude and longitude
require_once 'CRM/Utils/Geocode/Google.php';
CRM_Utils_Geocode_Google::format($this->_formValues);
if (!isset($this->_formValues['geo_code_1']) || !isset($this->_formValues['geo_code_2']) || !isset($this->_formValues['distance'])) {
CRM_Core_Error::fatal(ts('Could not geocode input'));
}
$this->_latitude = $this->_formValues['geo_code_1'];
$this->_longitude = $this->_formValues['geo_code_2'];
$this->_distance = $this->_formValues['distance'] * 1000;
}
$this->_earthDistanceSQL = $this->earthDistanceSQL($this->_latitude, $this->_longitude);
$this->_tag = CRM_Utils_Array::value('tag', $this->_formValues);
$this->_columns = array(ts('Name') => 'sort_name', ts('Street Address') => 'street_address', ts('City') => 'city', ts('Postal Code') => 'postal_code', ts('State') => 'state_province', ts('Country') => 'country');
}
示例2: __construct
/**
* @param $formValues
*
* @throws Exception
*/
public function __construct(&$formValues)
{
parent::__construct($formValues);
// unset search profile and other search params if set
unset($this->_formValues['uf_group_id']);
unset($this->_formValues['component_mode']);
unset($this->_formValues['operator']);
if (!empty($this->_formValues)) {
// add the country and state
if (!empty($this->_formValues['country_id'])) {
$this->_formValues['country'] = CRM_Core_PseudoConstant::country($this->_formValues['country_id']);
}
if (!empty($this->_formValues['state_province_id'])) {
$this->_formValues['state_province'] = CRM_Core_PseudoConstant::stateProvince($this->_formValues['state_province_id']);
}
// use the address to get the latitude and longitude
CRM_Utils_Geocode_Google::format($this->_formValues);
if (!is_numeric(CRM_Utils_Array::value('geo_code_1', $this->_formValues)) || !is_numeric(CRM_Utils_Array::value('geo_code_2', $this->_formValues)) || !isset($this->_formValues['distance'])) {
CRM_Core_Error::fatal(ts('Could not geocode input'));
}
$this->_latitude = $this->_formValues['geo_code_1'];
$this->_longitude = $this->_formValues['geo_code_2'];
if ($this->_formValues['prox_distance_unit'] == "miles") {
$conversionFactor = 1609.344;
} else {
$conversionFactor = 1000;
}
$this->_distance = $this->_formValues['distance'] * $conversionFactor;
}
$this->_group = CRM_Utils_Array::value('group', $this->_formValues);
$this->_tag = CRM_Utils_Array::value('tag', $this->_formValues);
$this->_columns = array(ts('Name') => 'sort_name', ts('Street Address') => 'street_address', ts('City') => 'city', ts('Postal Code') => 'postal_code', ts('State') => 'state_province', ts('Country') => 'country');
}
示例3: array
function __construct(&$formValues)
{
parent::__construct($formValues);
$this->_includeGroups = CRM_Utils_Array::value('includeGroups', $formValues, array());
$this->_excludeGroups = CRM_Utils_Array::value('excludeGroups', $formValues, array());
$this->_columns = array(ts('Contact Id') => 'contact_id', ts('Contact Type') => 'contact_type', ts('Name') => 'sort_name', ts('Date Added') => 'date_added');
}
示例4:
function __construct(&$formValues)
{
parent::__construct($formValues);
$this->_eventID = CRM_Utils_Array::value('event_id', $this->_formValues);
$this->setColumns();
if ($this->_eventID) {
$this->buildTempTable();
$this->fillTable();
}
}
示例5: array
function __construct(&$formValues)
{
parent::__construct($formValues);
$session = CRM_Core_Session::singleton();
if (!$session->get('userID')) {
CRM_Core_Error::fatal(ts('Could not find Interviewer Id.'));
}
$this->_interviewerId = $session->get('userID');
$this->_columns = array(ts('Contact Name') => 'display_name', ts('Street Number') => 'street_number', ts('Street Address') => 'street_address', ts('City') => 'city', ts('Postal Code') => 'postal_code', ts('State') => 'state_province', ts('Country') => 'country', ts('Email') => 'email', ts('Phone') => 'phone');
}
示例6: __construct
/**
* Class constructor.
*
* @param array $formValues
*/
public function __construct(&$formValues)
{
parent::__construct($formValues);
if (!isset($formValues['state_province_id'])) {
$this->_stateID = CRM_Utils_Request::retrieve('stateID', 'Integer', CRM_Core_DAO::$_nullObject);
if ($this->_stateID) {
$formValues['state_province_id'] = $this->_stateID;
}
}
$this->_columns = array(ts('Contact ID') => 'contact_id', ts('Contact Type') => 'contact_type', ts('Name') => 'sort_name', ts('State') => 'state_province');
}
示例7: array
function __construct(&$formValues)
{
parent::__construct($formValues);
require_once 'CRM/Core/BAO/CustomGroup.php';
$this->_groupTree = CRM_Core_BAO_CustomGroup::getTree("'Contact', 'Individual', 'Organization', 'Household'", CRM_Core_DAO::$_nullObject, null, -1);
$this->_columns = array(ts('Contact Id') => 'contact_id', ts('Contact Type') => 'contact_type', ts('Name') => 'sort_name');
$this->_customGroupIDs = CRM_Utils_Array::value('custom_group', $formValues);
if (!empty($this->_customGroupIDs)) {
$this->addColumns();
}
}
示例8: __construct
/**
* Class constructor.
*
* @param array $formValues
*/
public function __construct(&$formValues)
{
parent::__construct($formValues);
$this->_groupTree = CRM_Core_BAO_CustomGroup::getTree("'Contact', 'Individual', 'Couple', 'Organization', 'Household'", CRM_Core_DAO::$_nullObject, NULL, -1);
$this->_group = CRM_Utils_Array::value('group', $this->_formValues);
$this->_tag = CRM_Utils_Array::value('tag', $this->_formValues);
$this->_columns = array(ts('Contact ID') => 'contact_id', ts('Contact Type') => 'contact_type', ts('Name') => 'sort_name');
$this->_customGroupIDs = CRM_Utils_Array::value('custom_group', $formValues);
if (!empty($this->_customGroupIDs)) {
$this->addColumns();
}
}
示例9: array
function __construct(&$formValues)
{
parent::__construct($formValues);
$this->normalize();
$this->_columns = array(ts('') => 'contact_type', ts('Name') => 'sort_name', ts('Address') => 'street_address', ts('City') => 'city', ts('State') => 'state_province', ts('Postal') => 'postal_code', ts('Country') => 'country', ts('Email') => 'email', ts('Phone') => 'phone');
$params =& CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$returnProperties = array();
foreach ($this->_columns as $name => $field) {
$returnProperties[$field] = 1;
}
$this->_query =& new CRM_Contact_BAO_Query($params, $returnProperties, null, false, false, 1, false, false);
}
示例10:
function __construct(&$formValues)
{
parent::__construct($formValues);
$this->_eventID = CRM_Utils_Array::value('event_id', $this->_formValues);
$this->setColumns();
if ($this->_eventID) {
$this->buildTempTable();
$this->fillTable();
}
// define component access permission needed
$this->_permissionedComponent = 'CiviEvent';
}
示例11: __construct
/**
* Class constructor.
*
* @param array $formValues
*/
public function __construct(&$formValues)
{
parent::__construct($formValues);
$this->_columns = array('' => 'contact_type', ts('Name') => 'sort_name', ts('Address') => 'street_address', ts('City') => 'city', ts('State') => 'state_province', ts('Postal') => 'postal_code', ts('Country') => 'country', ts('Email') => 'email', ts('Phone') => 'phone');
$params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$returnProperties = array();
$returnProperties['contact_sub_type'] = 1;
$addressOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'address_options', TRUE, NULL, TRUE);
foreach ($this->_columns as $name => $field) {
if (in_array($field, array('street_address', 'city', 'state_province', 'postal_code', 'country')) && empty($addressOptions[$field])) {
unset($this->_columns[$name]);
continue;
}
$returnProperties[$field] = 1;
}
$this->_query = new CRM_Contact_BAO_Query($params, $returnProperties, NULL, FALSE, FALSE, 1, FALSE, FALSE);
}
示例12: array
function __construct(&$formValues)
{
$this->_formValues = $formValues;
$this->_columns = array(ts('Contact Id') => 'contact_id', ts('First') => 'first_name', ts('Last') => 'last_name', ts('Email') => 'email', ts('Phone') => 'phone', ts('Postcode') => 'postcode');
parent::__construct($formValues);
}
示例13:
function __construct(&$formValues)
{
parent::__construct($formValues);
}
示例14: array
function __construct(&$formValues)
{
parent::__construct($formValues);
$this->_columns = array(ts('Contact Id') => 'contact_id', ts('Name') => 'sort_name', ts('Email') => 'email', ts('Zip') => 'postal_code');
}
示例15: array
function __construct(&$formValues)
{
parent::__construct($formValues);
$this->_columns = array(ts('Contact Id') => 'contact_id', ts('Contact Type') => 'contact_type', ts('Name') => 'sort_name', ts('Email') => 'email');
$this->initialize();
}