<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
$params['current_employer'] = array(
'title' => 'Current Employer',
'description' => 'Name of Current Employer',
+ 'type' => CRM_Utils_Type::T_STRING,
);
$params['dupe_check'] = array(
'title' => 'Check for Duplicates',
$params['state_province_id']['title'] = 'Primary Address State Province ID';
$params['state_province_name']['title'] = 'Primary Address State Province Name';
$params['state_province']['title'] = 'Primary Address State Province';
- $params['country_id']['title'] = 'Primary Address State Province ID';
+ $params['country_id']['title'] = 'Primary Address Country ID';
$params['country']['title'] = 'Primary Address country';
$params['worldregion_id']['title'] = 'Primary Address World Region ID';
$params['worldregion']['title'] = 'Primary Address World Region';
$params['provider_id']['title'] = 'Primary Phone Provider ID';
$params['email_id']['title'] = 'Primary Email ID';
$params['email']['title'] = 'Primary Email';
+ $params['gender_id']['title'] = 'Gender ID';
+ $params['gender']['title'] = 'Gender';
$params['on_hold']['title'] = 'Primary Email On Hold';
$params['im']['title'] = 'Primary Instant Messanger';
$params['im_id']['title'] = 'Primary Instant Messanger ID';
break;
}
+ // Fixme: This really needs to be handled at a lower level. @See CRM-13123
+ if (isset($params['preferred_communication_method'])) {
+ $params['preferred_communication_method'] = CRM_Utils_Array::implodePadded($params['preferred_communication_method']);
+ }
+
if (CRM_Utils_Array::value('contact_sub_type', $params) && CRM_Utils_Array::value('contact_type', $params)) {
if (!(CRM_Contact_BAO_ContactType::isExtendsContactType($params['contact_sub_type'], $params['contact_type']))) {
throw new API_Exception("Invalid or Mismatched Contact SubType: " . implode(', ', (array)$params['contact_sub_type']));
function civicrm_api3_contact_getquick($params) {
civicrm_api3_verify_mandatory($params, NULL, array('name'));
- $name = CRM_Utils_Type::escape($params['name'], 'String');
+ $name = CRM_Utils_Type::escape(CRM_Utils_Array::value('name', $params), 'String');
// get the autocomplete options from settings
$acpref = explode(CRM_Core_DAO::VALUE_SEPARATOR,
case 'phone':
case 'email':
$actualSelectElements[] = $select[] = ($value == 'address') ? $selectText : $value;
+ if ($value == 'phone') {
+ $actualSelectElements[] = $select[] = 'phone_ext';
+ }
$from[$value] = "LEFT JOIN civicrm_{$value} {$suffix} ON ( cc.id = {$suffix}.contact_id AND {$suffix}.is_primary = 1 ) ";
break;
}
}
+ if (CRM_Utils_Array::value('contact_sub_type', $params)) {
+ $where .= " AND cc.contact_sub_type = \"{$params['contact_sub_type']}\" ";
+ }
+
//set default for current_employer or return contact with particular id
if (CRM_Utils_Array::value('id', $params)) {
$where .= " AND cc.id = " . (int) $params['id'];