本文整理汇总了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类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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');
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:31,代码来源:Proximity.php
示例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');
}
开发者ID:JSProffitt,项目名称:civicrm-website-org,代码行数:38,代码来源:Proximity.php
示例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');
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:7,代码来源:DateAdded.php
示例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();
}
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:10,代码来源:PriceSet.php
示例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');
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:10,代码来源:FindVoters.php
示例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');
}
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:16,代码来源:Sample.php
示例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();
}
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:11,代码来源:MultipleValues.php
示例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();
}
}
开发者ID:sdekok,项目名称:civicrm-core,代码行数:17,代码来源:MultipleValues.php
示例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);
}
开发者ID:ksecor,项目名称:civicrm,代码行数:12,代码来源:Basic.php
示例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';
}
开发者ID:hguru,项目名称:224Civi,代码行数:12,代码来源:PriceSet.php
示例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);
}
开发者ID:nielosz,项目名称:civicrm-core,代码行数:22,代码来源:Basic.php
示例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);
}
开发者ID:eileenmcnaughton,项目名称:au.org.greens.customsearches,代码行数:6,代码来源:agSpam.php
示例13:
function __construct(&$formValues)
{
parent::__construct($formValues);
}
开发者ID:CiviCooP,项目名称:no.maf.earmarking,代码行数:4,代码来源:EarmarkSearch.php
示例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');
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:5,代码来源:ZipCodeRange.php
示例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();
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:6,代码来源:RandomSegment.php
示例16: array
function __construct(&$formValues)
{
parent::__construct($formValues);
$this->_columns = array(ts('Contact Id') => 'contact_id', ts('Address') => 'address', ts('Contact Type') => 'contact_type', ts('Name') => 'sort_name', ts('State') => 'state_province');
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:5,代码来源:PostalMailing.php
示例17:
function __construct(&$formValues)
{
parent::__construct($formValues);
$this->getDistinctCities();
}
开发者ID:CiviCooP,项目名称:no.maf.postnummer,代码行数:5,代码来源:Postnummer.php
注:本文中的CRM_Contact_Form_Search_Custom_Base类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论