foreach ($mapperKeys as $key) {
$this->_fieldUsed[$key] = FALSE;
}
- $this->_location_types = CRM_Core_PseudoConstant::locationType();
+ $this->_location_types = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$sel1 = $this->_mapperFields;
$sel2[''] = NULL;
foreach ($defaults[$name] as $count => & $values) {
//get location type id.
- CRM_Utils_Array::lookupValue($values, 'location_type', CRM_Core_PseudoConstant::locationType(), $reverse);
+ CRM_Utils_Array::lookupValue($values, 'location_type', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), $reverse);
if ($name == 'address') {
// FIXME: lookupValue doesn't work for vcard_name
* @static
*/
static function &makeHierReturnProperties($fields, $contactId = NULL) {
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$returnProperties = array();
}
// get the billing location type
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$billingLocationTypeId = array_search('Billing', $locationTypes);
$blocks = array('email', 'phone', 'im', 'openid');
return;
}
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$processed = array();
$index = 0;
$setTables = FALSE;
//get the location name
- $locationType = CRM_Core_PseudoConstant::locationType();
+ $locationType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
list($tName, $fldName) = self::getLocationTableName($field['where'], $locType);
$where = "`$tName`.$fldName";
list($tbName, $fldName) = explode(".", $where);
//get the location name
- $locationType = CRM_Core_PseudoConstant::locationType();
+ $locationType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$specialFields = array('email', 'im', 'phone', 'openid', 'phone_ext');
if (in_array($locType[0], $specialFields)) {
//hack to fix / special handing for phone_ext
$this->_tables['civicrm_address'] = 1;
$this->_whereTables['civicrm_address'] = 1;
- $locationType = CRM_Core_PseudoConstant::locationType();
+ $locationType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$names = array();
foreach (array_keys($value) as $id) {
$names[] = $locationType[$id];
*
*/
function blockSetDefaults(&$defaults) {
- $locationTypeKeys = array_filter(array_keys(CRM_Core_PseudoConstant::locationType()), 'is_int');
+ $locationTypeKeys = array_filter(array_keys(CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id')), 'is_int');
sort($locationTypeKeys);
// get the default location type
"address[$blockId][location_type_id]",
ts('Location Type'),
array(
- '' => ts('- select -')) + CRM_Core_PseudoConstant::locationType(),
+ '' => ts('- select -')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'),
$js
);
$form->addRule("email[$blockId][email]", ts('Email is not valid.'), 'email');
if (isset($form->_contactType) || $blockEdit) {
//Block type
- $form->addElement('select', "email[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::locationType());
+ $form->addElement('select', "email[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'));
$multipleBulk = CRM_Core_BAO_Email::isMultipleBulkMail();
$form->addElement('select', "im[$blockId][provider_id]", '', CRM_Core_PseudoConstant::IMProvider());
//Block type select
- $form->addElement('select', "im[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::locationType());
+ $form->addElement('select', "im[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'));
//IM box
$form->addElement('text', "im[$blockId][name]", ts('Instant Messenger'),
$form->addRule("openid[$blockId][openid]", ts('OpenID is not a valid URL.'), 'url');
//Block type
- $form->addElement('select', "openid[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::locationType());
+ $form->addElement('select', "openid[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'));
//is_Primary radio
$js = array('id' => "OpenID_" . $blockId . "_IsPrimary");
if (isset($form->_contactType) || $blockEdit) {
//Block type select
- $form->addElement('select', "phone[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::locationType());
+ $form->addElement('select', "phone[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'));
//is_Primary radio
$js = array('id' => 'Phone_' . $blockId . '_IsPrimary', 'onClick' => 'singleSelect( this.id );');
// Phone search
$form->addElement('text', 'phone_numeric', ts('Phone Number'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Phone', 'phone'));
- $locationType = CRM_Core_PseudoConstant::locationType();
+ $locationType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$phoneType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$form->add('select', 'phone_location_type_id', ts('Phone Location'), array('' => ts('- any -')) + $locationType);
$form->add('select', 'phone_phone_type_id', ts('Phone Type'), array('' => ts('- any -')) + $phoneType);
// checkboxes for location type
$location_type = array();
- $locationType = CRM_Core_PseudoConstant::locationType();
+ $locationType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
foreach ($locationType as $locationTypeID => $locationTypeName) {
$location_type[] = $form->createElement('checkbox', $locationTypeID, NULL, $locationTypeName);
}
// add select for Location Type
$this->addElement('select', 'location_type_id', ts('Select Location'),
array(
- '' => ts('Primary')) + CRM_Core_PseudoConstant::locationType(), TRUE
+ '' => ts('Primary')) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'), TRUE
);
// checkbox for SKIP contacts with Do Not Mail privacy option
//get the contacts information
$params = array();
if (CRM_Utils_Array::value('location_type_id', $fv)) {
- $locType = CRM_Core_PseudoConstant::locationType();
+ $locType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$locName = $locType[$fv['location_type_id']];
$location = array('location' => array("{$locName}" => $address));
$returnProperties = array_merge($returnProperties, $location);
$dataPatterns = $this->get('dataPatterns');
$hasLocationTypes = $this->get('fieldTypes');
- $this->_location_types = CRM_Core_PseudoConstant::locationType();
+ $this->_location_types = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$imProviders = CRM_Core_PseudoConstant::IMProvider();
$websiteTypes = CRM_Core_PseudoConstant::websiteType();
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
//these mapper params need to set key as array and val as null.
$mapperParams = array(
//Updating Mapping Records
if (CRM_Utils_Array::value('updateMapping', $params)) {
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$mappingFields = new CRM_Core_DAO_MappingField();
$mappingFields->mapping_id = $params['mappingId'];
$saveMapping = CRM_Core_BAO_Mapping::add($mappingParams);
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$contactType = $this->get('contactType');
switch ($contactType) {
case CRM_Contact_Import_Parser::CONTACT_INDIVIDUAL:
$mapFields = $this->get('fields');
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
foreach ($mapper as $key => $value) {
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$imProviders = CRM_Core_PseudoConstant::IMProvider();
$websiteTypes = CRM_Core_PseudoConstant::websiteType();
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
//initialize mapper perperty value.
$mapperPeroperties = array(
),
);
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
foreach ($this->_fields as $name => $field) {
if (CRM_Utils_Array::value('in_selector', $field) &&
}
if ($this->_ufGroupID) {
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$names = array();
static $skipFields = array('group', 'tag');
// get the billing location type
if (!array_key_exists('related_contact', $values)) {
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$billingLocationTypeId = array_search('Billing', $locationTypes);
}
else {
* @return void
*/
public function assignBillingType() {
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$this->_bltID = array_search('Billing', $locationTypes);
if (!$this->_bltID) {
CRM_Core_Error::fatal(ts('Please set a location type of %1', array(1 => 'Billing')));
// also check for billing informatin
// get the billing location type
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
// CRM-8108 remove ts around Billing location type
//$this->_bltID = array_search( ts('Billing'), $locationTypes );
$this->_bltID = array_search('Billing', $locationTypes);
$this->assign('paymentProcessor', $this->_paymentProcessor);
// get the billing location type
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$this->_bltID = array_search('Billing', $locationTypes);
$this->assign('bltID', $this->_bltID);
if (!$this->_bltID) {
foreach ($mapperKeys as $key) {
$this->_fieldUsed[$key] = FALSE;
}
- $this->_location_types = CRM_Core_PseudoConstant::locationType();
+ $this->_location_types = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$sel1 = $this->_mapperFields;
if (!$this->get('onDuplicate')) {
*/
static function getBilling() {
if (self::$_billingLocationType == NULL) {
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
self::$_billingLocationType = array_search('Billing', $locationTypes);
}
return self::$_billingLocationType;
$mapperKeys = array_keys($mapperFields);
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
return $fields;
}
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
foreach ($params['mapper'] as $key => $value) {
foreach ($value as $k => $v) {
if (isset($v[1])) {
$config = CRM_Core_Config::singleton();
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$imProviders = CRM_Core_PseudoConstant::IMProvider();
$websiteTypes = CRM_Core_PseudoConstant::websiteType();
function getBillingID(&$ids) {
// get the billing location type
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
// CRM-8108 remove the ts around the Billing locationtype
//$ids['billing'] = array_search( ts('Billing'), $locationTypes );
$ids['billing'] = array_search('Billing', $locationTypes);
}
}
}
-}
\ No newline at end of file
+}
*/
private static $cache;
- /**
- * location type
- * @var array
- * @static
- */
- private static $locationType;
-
/**
* location vCard name
* @var array
}
}
- /**
- * Get all location types.
- *
- * The static array locationType is returned
- *
- * @access public
- * @static
- *
- * @param boolean $all - get All location types - default is to get only active ones.
- *
- * @return array - array reference of all location types.
- *
- */
- public static function &locationType($all = FALSE) {
- if (!self::$locationType) {
- self::populate(self::$locationType, 'CRM_Core_DAO_LocationType', $all);
- }
- return self::$locationType;
- }
-
/**
* Get all location vCard names.
*
'old_migration_info' => $migrationInfo,
'mode' => $mode,
);
- $allLocationTypes = CRM_Core_PseudoConstant::locationType();
+ $allLocationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
foreach ($migrationInfo as $key => $val) {
if ($val === "null") {
}
}
- $allLocationTypes = CRM_Core_PseudoConstant::locationType();
+ $allLocationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$mainLocBlock = $locBlockIds = array();
$locBlockIds['main'] = $locBlockIds['other'] = array();
$this->checkWaitingList();
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$this->_bltID = array_search('Billing', $locationTypes);
$this->assign('bltID', $this->_bltID);
}
// also check for billing information
// get the billing location type
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
// CRM-8108 remove ts around Billing location type
//$this->_bltID = array_search( ts('Billing'), $locationTypes );
$this->_bltID = array_search('Billing', $locationTypes);
$params = array('id' => $this->_eventId);
// get the billing location type
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
// CRM-8108 remove ts from Billing as the location type can not be translated in CiviCRM!
//$this->_bltID = array_search( ts('Billing'), $locationTypes );
foreach ($mapperKeys as $key) {
$this->_fieldUsed[$key] = FALSE;
}
- $this->_location_types = CRM_Core_PseudoConstant::locationType();
+ $this->_location_types = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$sel1 = $this->_mapperFields;
$sel2[''] = NULL;
}
if ($fields) {
//construct return properties
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$locationTypeFields = array(
'street_address',
'supplemental_address_1',
'financial_type_id' => CRM_Contribute_PseudoConstant::financialType(),
'country_id' => CRM_Core_PseudoConstant::country(),
'gender_id' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
- 'location_type_id' => CRM_Core_PseudoConstant::locationType(),
+ 'location_type_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'),
'payment_instrument_id' => CRM_Contribute_PseudoConstant::paymentInstrument(),
'phone_type_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'),
'preferred_communication_method' => CRM_Core_PseudoConstant::pcm(),
}
// also check for billing information
// get the billing location type
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
// CRM-8108 remove ts around Billing location type
//$this->_bltID = array_search( ts('Billing'), $locationTypes );
$this->_bltID = array_search('Billing', $locationTypes);
}
// also check for billing information
// get the billing location type
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
// CRM-8108 remove ts around Billing location type
//$this->_bltID = array_search( ts('Billing'), $locationTypes );
$this->_bltID = array_search('Billing', $locationTypes);
foreach ($mapperKeys as $key) {
$this->_fieldUsed[$key] = FALSE;
}
- $this->_location_types = CRM_Core_PseudoConstant::locationType();
+ $this->_location_types = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$sel1 = $this->_mapperFields;
if (!$this->get('onDuplicate')) {
unset($sel1['id']);
),
);
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
foreach ($this->_fields as $name => $field) {
// skip pseudo fields
}
$links = self::links($this->_map, $this->_editLink, $this->_linkToUF, $this->_profileIds);
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$names = array();
static $skipFields = array('group', 'tag');
// unknown mobile sender -- create new contact
// use fake @mobile.sms email address for new contact since civi
// requires email or name for all contacts
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$phoneloc = array_search('Home', $locationTypes);
$phonetype = array_search('Mobile', $phoneTypes);
}
$this->assign('noSearchable', $noSearchable);
- $this->_location_types = CRM_Core_PseudoConstant::locationType();
+ $this->_location_types = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
/**
}
$locationType = array();
- $locationType = CRM_Core_PseudoConstant::locationType();
+ $locationType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$fields = CRM_Contact_BAO_Contact::exportableFields('All', FALSE, TRUE);
$fields = array_merge(CRM_Contribute_BAO_Contribution::getContributionFields(), $fields);
->addSettingsFactory(function(){
return array(
'PseudoConstant' => array(
- 'locationType' => CRM_Core_PseudoConstant::locationType(),
+ 'locationType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'),
'phoneType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'),
),
'initialProfileList' => civicrm_api('UFGroup', 'get', array(