1. devdan
  2. Support
  3. Sunday, July 20 2014, 03:12 AM
Hello,

Searching for multiple checkbox in userlist it doesn't display what i'm trying to achieve.

eg

If I have lets say
check1 check2 check3 check4

and select multiple of check1 and check4
It only shows users that have both of those checked on profile

I want be able to display user that have either one of the checks selected to be shown, so if user has check1 but not check4 it should still display in results...

Hope this makes sense.. Its most likely something really simple but cant seem to figure it out...
Thanks
Accepted Answer
admin Accepted Answer
Admin
Hi Dan,
the results must respect all conditions.

If you want to do this you can replace the function "getSearchQuery" at file /administrator/components/com_jsn/helpers/fields/checkboxlist.php with this:
public static function getSearchQuery($field, &$query)
{
$options=JRequest::getVar($field->alias,null);
$db=JFactory::getDbo();
$querystring=array();
foreach($options as $option)
{
$querystring[]='b.'.$db->quoteName($field->alias).' LIKE '.$db->quote('%"'.$option.'"%');

}
$query->where(implode(' OR ',$querystring));
}


NOTE: we have not tested this code
NOTE 2: when you update Easy Profile you must replace this function because the file will be overwrite.
  1. more than a month ago
  2. Support
  3. # Permalink
devdan Accepted Answer
Thanks Heaps!!!!!

You know what your amazing!!! Super quick response.... Hey it might be a hack (used to it, just need to take note during updates.) but it seems to be working from what i quickly tested..

Hopefully one day u make it an option in backend...

Thanks
  1. more than a month ago
  2. Support
  3. # 1
devdan Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 2
admin Accepted Answer
Admin
Sorry, but is not possible because you must edit 20/30 files to do this.
  1. more than a month ago
  2. Support
  3. # 3
devdan Accepted Answer
Nah thats ok I can imagine it's not a simple fix. But thanks for the other code I can still work around this using menu items. Something to think about in future developments maybe?
  1. more than a month ago
  2. Support
  3. # 4
jiggyj2z Accepted Answer
I'd like to suggest you include this in future versions also. It makes searching so much more flexible including OR conditions as well as AND.
  1. more than a month ago
  2. Support
  3. # 5
admin Accepted Answer
Admin
Thanks for your suggestion, it will consider! ;)
  1. more than a month ago
  2. Support
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.