CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Contact Advanced Search - Replace the country select by a country multiselect
Pages: [1]

Author Topic: Contact Advanced Search - Replace the country select by a country multiselect  (Read 763 times)

frinaldi

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 3.3.6
  • CMS version: Drupal 6.17
  • MySQL version: 5.1.48
  • PHP version: 5.2.10
Contact Advanced Search - Replace the country select by a country multiselect
October 21, 2011, 01:48:56 am
Hi everybody,

We want to replace the country selector in the advanced contact search by a multiple select.

I see in the CRM/Contact/Form/Search/Criteria.php, in the location function, the line to say that the country must be a multiselect :

'country'                => array( ts('Country')           ,  $attributes['country_id'], 'country', false ),
-->
'country'                => array( ts('Country')           ,  $attributes['country_id'], 'country', true ),

But I see that other changes are required because, when I launch the query, I get the following error : One of parameters (value: ) is not of the type Integer

So t he way I understand the problem is probably that, in the where clause of the search, the parameter COUNTRY is passed like a int BUT no it should be a IN criteria.

I don't know where to overrride this?

And of course, I'm not sure this is the correct way to solve this problem.

Many thanks for your help,


Fred


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Contact Advanced Search - Replace the country select by a country multiselect
October 21, 2011, 06:31:06 am

You'll also need to modify:

CRM/Contact/BAO/Query.php and allow for Country to be an array (since thats what POST sends a multi-select as)

If multiple countries are selected, you might want to ensure that no states are selected to avoid confusion

i also dont know if the countryState javascript widget will continue to work with a multi-select

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Contact Advanced Search - Replace the country select by a country multiselect

This forum was archived on 2017-11-26.