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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • In search, allow multiple choices for single value custom fields
Pages: [1]

Author Topic: In search, allow multiple choices for single value custom fields  (Read 2294 times)

samuelsov

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 2
    • Coop SymbioTIC
  • CiviCRM version: 3.x, 4.x
  • CMS version: Drupal 6 & 7
In search, allow multiple choices for single value custom fields
July 29, 2014, 06:26:47 am
When creating custom fields, you choose the type of widget you want for editing the field which is great.

For the search, the same widget is used but it doesn't have to be.
For example, i have a field "color" with radio button options : red, blue, green or black
When editing, i want to have only one choice of course but when i search, i'd like to be able to find all contact with color red or blue for example. In that case, having the checkboxes widget for search make sense.

In the same way, for select widget, having the multi-select for search seems to be more useful.

Here a table of what i think should be the default :

| Edit Widget               | Search Widget                           |
-----------------------------------------------------------------------
| Radio                        | Checkboxes                                 |
| Select                        | Multi-Select                                 |
| Select Country          | Multi-Select Country                     |
| Autocomplete-Select | Autocomplete-Multi-Select (new) |

Others widgets should be the same in edit and search mode i think.

Some of the core field already use this. For example : Membership Status is a single option value but is a multiple checkboxes in search.
Some don't but i think they should. For example : Preferred Language, State/Province or Country - with advanced search, it's not possible to search contacts with country either United States or Canada for example.

Is there use-cases where this change doesn't make sense ?

For custom fields, i think the change could be quite easy to do with only CRM_Core_BAO_CustomField.php to change.
Should i try to make a patch to core for this ?
Consultant @ SymbioTIC.coop

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: In search, allow multiple choices for single value custom fields
July 29, 2014, 06:59:35 am
I like the idea. As for the UI, by multi-select you mean the same jquery plugin than in advanced search for groups or tags for instance?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: In search, allow multiple choices for single value custom fields
July 29, 2014, 08:03:03 am
+1
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: In search, allow multiple choices for single value custom fields
July 29, 2014, 08:16:00 am
Redmine has a good widget that lets the user switch between select boxes and multi-select on the search screen. Given all the work with Select2 that's gone into Civi 4.5, it should be fairly simple from a UI perspective.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: In search, allow multiple choices for single value custom fields
July 29, 2014, 10:01:20 am
Samuel - This has come up in the past and currently the only workaround is to use Search Builder. If you can pull together a patch for core against master SOON we can potentially squeeze this into 4.5. Maybe focus initially on custom fields and a few other key core fields (the ones you've mentioned - esp State / Country seem especially relevant).

Note that there's currently a bug in World Region search (doesn't work at all in 4.4 or 4.5) - I think Coleman is looking at it now.
Protect your investment in CiviCRM by  becoming a Member!

samuelsov

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 2
    • Coop SymbioTIC
  • CiviCRM version: 3.x, 4.x
  • CMS version: Drupal 6 & 7
Re: In search, allow multiple choices for single value custom fields
July 29, 2014, 11:26:10 am
xavier: yes exactly

dave: ok, i will start with custom fields - I shoud be able to provide something this week i think
Consultant @ SymbioTIC.coop

samuelsov

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 2
    • Coop SymbioTIC
  • CiviCRM version: 3.x, 4.x
  • CMS version: Drupal 6 & 7
Re: In search, allow multiple choices for single value custom fields
July 29, 2014, 11:31:05 am
@JonGold: I use redmine everyday but i don't see what you mean. Can you provide some screenshots ?
Consultant @ SymbioTIC.coop

samuelsov

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 2
    • Coop SymbioTIC
  • CiviCRM version: 3.x, 4.x
  • CMS version: Drupal 6 & 7
Re: In search, allow multiple choices for single value custom fields
July 29, 2014, 07:53:20 pm
See PR https://github.com/civicrm/civicrm-core/pull/3756 for a first step in this direction.
Consultant @ SymbioTIC.coop

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: In search, allow multiple choices for single value custom fields
August 06, 2014, 05:16:34 am
Thank you samuelsov for the patches. I've worked on them a bit further and decided that it is best UX (and simplifies our code a lot) to have ALL custom fields with options (radio, state, country, boolean, advmultiselect, etc) be rendered as multiselect on search forms.
https://issues.civicrm.org/jira/browse/CRM-15061
Try asking your question on the new CiviCRM help site.

samuelsov

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 2
    • Coop SymbioTIC
  • CiviCRM version: 3.x, 4.x
  • CMS version: Drupal 6 & 7
Re: In search, allow multiple choices for single value custom fields
August 06, 2014, 06:28:01 am
Seems like a very good idea :)
I didn't have time myself to do such a change but i'm glad you did.

Can we test it on sandbox ?
Consultant @ SymbioTIC.coop

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: In search, allow multiple choices for single value custom fields
August 06, 2014, 01:17:41 pm
This sounds like a great improvement
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: In search, allow multiple choices for single value custom fields
August 06, 2014, 01:46:42 pm
It will be on the sandbox once https://github.com/civicrm/civicrm-core/pull/3781 gets merged.
Try asking your question on the new CiviCRM help site.

samuelsov

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 2
    • Coop SymbioTIC
  • CiviCRM version: 3.x, 4.x
  • CMS version: Drupal 6 & 7
Re: In search, allow multiple choices for single value custom fields
August 18, 2014, 10:57:36 am
Just tested i little bit.
I like the way Any / All option is now dynamically handled when selecting 2 or more choices for multiple choices fields.
Search with single and multiple choices custom field are now very consistent.
Consultant @ SymbioTIC.coop

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: In search, allow multiple choices for single value custom fields
August 18, 2014, 11:28:13 am
:)
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • In search, allow multiple choices for single value custom fields

This forum was archived on 2017-11-26.