if ($name == 'phone') {
CRM_Utils_Array::lookupValue($values,
'phone_type',
- CRM_Core_PseudoConstant::phoneType(),
+ CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'),
$reverse
);
}
$form->applyFilter('__ALL__', 'trim');
//phone type select
- $form->addElement('select', "phone[$blockId][phone_type_id]", ts('Phone'), CRM_Core_PseudoConstant::phoneType());
+ $form->addElement('select', "phone[$blockId][phone_type_id]", ts('Phone'), CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'));
//main phone number with crm_phone class
$form->addElement('text', "phone[$blockId][phone]", ts('Phone'), array_merge(CRM_Core_DAO::getAttribute('CRM_Core_DAO_Phone', 'phone'), array('class' => 'crm_phone twelve')));
// Phone search
$form->addElement('text', 'phone_numeric', ts('Phone Number'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Phone', 'phone'));
$locationType = CRM_Core_PseudoConstant::locationType();
- $phoneType = CRM_Core_PseudoConstant::phoneType();
+ $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);
}
$sel1 = $this->_mapperFields;
$sel2[''] = NULL;
- $phoneTypes = CRM_Core_PseudoConstant::phoneType();
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$imProviders = CRM_Core_PseudoConstant::IMProvider();
$websiteTypes = CRM_Core_PseudoConstant::websiteType();
$mapperKeys = $this->controller->exportValue($this->_name, 'mapper');
$mapperKeysMain = array();
- $phoneTypes = CRM_Core_PseudoConstant::phoneType();
+ $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();
$mapFields = $this->get('fields');
$locationTypes = CRM_Core_PseudoConstant::locationType();
- $phoneTypes = CRM_Core_PseudoConstant::phoneType();
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
foreach ($mapper as $key => $value) {
$header = array();
public function runImport(&$form, $timeout = 55) {
$mapper = $this->_mapper;
$mapperFields = array();
- $phoneTypes = CRM_Core_PseudoConstant::phoneType();
+ $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();
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$locationTypes = CRM_Core_PseudoConstant::locationDisplayName();
- $phoneTypes = CRM_Core_PseudoConstant::phoneType();
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$entityBlock = array('contact_id' => $contactId);
$phones = CRM_Core_BAO_Phone::getValues($entityBlock);
$sel3[''] = NULL;
$sel5[''] = NULL;
- $phoneTypes = CRM_Core_PseudoConstant::phoneType();
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$imProviders = CRM_Core_PseudoConstant::IMProvider();
asort($phoneTypes);
$cond = NULL;
if ($type) {
- $phoneTypeId = array_search($type, CRM_Core_PseudoConstant::phoneType());
+ $phoneTypeId = array_search($type, CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'));
if ($phoneTypeId) {
$cond = " AND civicrm_phone.phone_type_id = $phoneTypeId";
}
$cond = NULL;
if ($type) {
- $phoneTypeId = array_search($type, CRM_Core_PseudoConstant::phoneType());
+ $phoneTypeId = array_search($type, CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'));
if ($phoneTypeId) {
$cond = " AND civicrm_phone.phone_type_id = $phoneTypeId";
}
*/
private static $mappingType;
- /**
- * Phone Types
- * @var array
- * @static
- */
- private static $phoneType;
-
/**
* Visibility
* @var array
return self::$component;
}
- /**
- * Get all phone type
- * The static array phoneType is returned
- *
- * @access public
- * @static
- *
- * @param boolean $all - get All phone type - default is to get
- * only active ones.
- *
- * @return array - array reference of all phone types.
- *
- */
- public static function &phoneType() {
- if (!self::$phoneType) {
- self::$phoneType = CRM_Core_OptionGroup::values('phone_type');
- }
- return self::$phoneType;
- }
-
/**
* Get all the IM Providers from database.
*
$allCampaigns = array();
$exportCampaign = FALSE;
- $phoneTypes = CRM_Core_PseudoConstant::phoneType();
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
$imProviders = CRM_Core_PseudoConstant::IMProvider();
$contactRelationshipTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(
NULL,
'gender_id' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
'location_type_id' => CRM_Core_PseudoConstant::locationType(),
'payment_instrument_id' => CRM_Contribute_PseudoConstant::paymentInstrument(),
- 'phone_type_id' => CRM_Core_PseudoConstant::phoneType(),
+ 'phone_type_id' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'),
'preferred_communication_method' => CRM_Core_PseudoConstant::pcm(),
'preferred_language' => CRM_Core_PseudoConstant::languages(),
'prefix_id' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id'),
// 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();
- $phoneTypes =& CRM_Core_PseudoConstant::phoneType();
- $phoneloc = array_search( 'Home', $locationTypes );
- $phonetype = array_search( 'Mobile', $phoneTypes );
+ $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
+ $phoneloc = array_search('Home', $locationTypes);
+ $phonetype = array_search('Mobile', $phoneTypes);
$stripFrom = $this->stripPhone($from);
- $contactparams =
- Array ( 'contact_type' => 'Individual',
- 'email' => Array ( 1 => Array ( 'location_type_id' => $phoneloc,
- 'email' => $stripFrom . '@mobile.sms' )
- ),
- 'phone' => Array ( 1 => Array( 'phone_type_id' => $phonetype,
- 'location_type_id' => $phoneloc,
- 'phone' => $stripFrom )
- )
- );
+ $contactparams = array(
+ 'contact_type' => 'Individual',
+ 'email' => array(1 => array(
+ 'location_type_id' => $phoneloc,
+ 'email' => $stripFrom . '@mobile.sms'
+ )),
+ 'phone' => array(1 => array(
+ 'phone_type_id' => $phonetype,
+ 'location_type_id' => $phoneloc,
+ 'phone' => $stripFrom
+ )),
+ );
$fromContact = CRM_Contact_BAO_Contact::create($contactparams, FALSE, TRUE, FALSE);
$fromContactID = $fromContact->id;
}
}
}
$sel3[''] = NULL;
- $phoneTypes = CRM_Core_PseudoConstant::phoneType();
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
ksort($phoneTypes);
foreach ($sel1 as $k => $sel) {
return array(
'PseudoConstant' => array(
'locationType' => CRM_Core_PseudoConstant::locationType(),
- 'phoneType' => CRM_Core_PseudoConstant::phoneType(),
+ 'phoneType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id'),
),
'initialProfileList' => civicrm_api('UFGroup', 'get', array(
'version' => 3,