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) »
  • Alpha and Beta Release Testing »
  • 3.2 Release Testing »
  • New proximity search feature for profiles
Pages: [1]

Author Topic: New proximity search feature for profiles  (Read 2690 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
New proximity search feature for profiles
July 07, 2010, 07:44:38 am
The new "proximity search" feature for profiles looks fantastic.    How can I allow the visitor to enter the radius in miles instead of km?    I did not see anything under the "localization" area in Global Settings.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: New proximity search feature for profiles
July 07, 2010, 09:53:46 am
I guess you will have to modify code base to support miles.

Kurund
Found this reply helpful? Support CiviCRM

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: New proximity search feature for profiles
July 07, 2010, 04:01:33 pm
Actually, the form gives users the option to search by miles or km - and sets default to miles if default country (under localisation) is United States. You can see this on the sandbox at:

http://sandbox.civicrm.org/civicrm/profile?gid=1&reset=1

Protect your investment in CiviCRM by  becoming a Member!

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: New proximity search feature for profiles
July 08, 2010, 03:28:38 pm
I set the default country to US and I now get miles on the public profile. However, I am still seeing km only in the "Search --> Custom Searches --> Proximity Search" in the staff area of CiviCRM.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: New proximity search feature for profiles
July 08, 2010, 04:54:41 pm
The custom Proximity Search is a separate "feature" - community contributed as I recall. It hasn't been updated (yet) to support km AND miles. Would be a nice contribution if you're up for doing a patch for this :-)
Protect your investment in CiviCRM by  becoming a Member!

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: New proximity search feature for profiles
July 14, 2010, 01:22:42 pm
Sarah -- i have interest in modifying the custom search to have the miles option as well. can we pool funds to sponsor?
Dave -- do you have an estimate on the hours required?
-Brian
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: New proximity search feature for profiles
July 14, 2010, 02:20:26 pm
Brian - Looks like ~4 hrs of work assuming the following changes:
* Add distance unit SELECT input field to the form. Default is miles if Civi default country = US or UK, else default is km.
* Process the query using the selected distance unit

No other changes to form, search results or available search tasks.
Protect your investment in CiviCRM by  becoming a Member!

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: New proximity search feature for profiles
July 14, 2010, 07:33:27 pm
Brian - I can assist with some coding.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: New proximity search feature for profiles
July 15, 2010, 12:13:41 pm
Sarah / Brian - If you decide to jump on coding for this, some pointers ...

* Check CRM/Contact/Form/Task/ProximityCommon.php for code which adds in distance_unit form field and sets default based on default country
* the custom search code - CRM/Contact/Form/Search/Custom/Proximity.php - already has been updated to use a shared method for constructing the proximity part of the "where" clause (in  CRM/Contact/BAO/ProximityQuery.php). Check that file for the rules about modifying the distance variable based on distance_units - and incorporate that in the custom search class

Ping us on IRC to discuss further.

« Last Edit: July 15, 2010, 12:15:22 pm by Dave Greenberg »
Protect your investment in CiviCRM by  becoming a Member!

claudian

  • Administrator
  • I’m new here
  • *****
  • Posts: 17
  • Karma: 2
Re: New proximity search feature for profiles
July 21, 2010, 02:24:40 am
Feature added and filed following issue - http://issues.civicrm.org/jira/browse/CRM-6514

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.2 Release Testing »
  • New proximity search feature for profiles

This forum was archived on 2017-11-26.