list($name, $op, $value, $grouping, $wildcard) = $values;
if (is_array($value)) {
- $this->_where[$grouping][] = 'civicrm_address.location_type_id IN (' . implode(',', array_keys($value)) . ')';
+ $this->_where[$grouping][] = 'civicrm_address.location_type_id IN (' . implode(',', $value) . ')';
$this->_tables['civicrm_address'] = 1;
$this->_whereTables['civicrm_address'] = 1;
$locationType = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$names = array();
- foreach (array_keys($value) as $id) {
+ foreach ($value as $id) {
$names[] = $locationType[$id];
}
$worldRegions = array('' => '') + CRM_Core_PseudoConstant::worldRegion();
$form->addSelect('world_region', array('entity' => 'address', 'placeholder' => ts('- any -'), 'option_url' => NULL));
- // checkboxes for location type
- $location_type = array();
+ // select for location type
$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);
- }
- $form->addGroup($location_type, 'location_type', ts('Location Types'), ' ');
+ $form->add('select', 'location_type', ts('Address Location'), $locationType, FALSE, array(
+ 'multiple' => TRUE,
+ 'class' => 'crm-select2',
+ 'placeholder' => ts('Primary'),
+ ));
// custom data extending addresses -
$extends = array('Address');
--- /dev/null
+{*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.5 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+*}
+
+{htxt id="location_type"}
+ <p>{ts}Location search uses the PRIMARY location for each contact by default.{/ts}</p>
+ <p>{ts}To search by specific location types (e.g. Home, Work...), select one or more options.{/ts}</p>
+{/htxt}
<table class="form-layout">
<tr>
<td>
- {$form.location_type.label}<br />
+ <div>{$form.location_type.label} {help id="location_type" title=$form.location_type.label}</div>
{$form.location_type.html}
- <div class="description" >
- {ts}Location search uses the PRIMARY location for each contact by default.{/ts}<br />
- {ts}To search by specific location types (e.g. Home, Work...), check one or more boxes above.{/ts}
- </div>
</td>
<td colspan="2">
<div id="streetAddress">