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'); }
/** * @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'); }
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'); }
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(); } }
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'); }
/** * 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'); }
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(); } }
/** * 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(); } }
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); }
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'; }
/** * 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); }
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); }
function __construct(&$formValues) { parent::__construct($formValues); }
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'); }
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(); }
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'); }
function __construct(&$formValues) { parent::__construct($formValues); $this->_columns = array(ts('Contact Id') => 'contact_id', ts('Contact Type') => 'contact_type', ts('Name') => 'sort_name', ts('Date Added') => 'date_added'); }
function __construct(&$formValues) { parent::__construct($formValues); $this->getDistinctCities(); }