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) »
  • Way to form URLs for Advanced Search w/profiles?
Pages: [1]

Author Topic: Way to form URLs for Advanced Search w/profiles?  (Read 3697 times)

Andy Laken

  • I’m new here
  • *
  • Posts: 27
  • Karma: 3
Way to form URLs for Advanced Search w/profiles?
April 23, 2007, 02:39:18 pm
For our project we need to create several shortcut links which perform an Advanced Search with certain criteria and display the results through a profile.

On this page there's a description of how to form links to profile displays and pass in certain criteria:

http://wiki.civicrm.org/confluence/display/CRM/Configure+CiviCRM+Profile#ConfigureCiviCRMProfile-9.ProfileSearch%2FListings

I thought this was the answer, but it doesn't work for us for three reasons:

1) The resulting page lacks the Actions menu that you get when doing a true Advanced Search - we need that.

2) The "View" and "Edit" links on the resulting page take you to pages which only display the fields available in the profile used to format the results page. We need "View" and "Edit" to link to the full versions of these pages, as the true Advanced Search results page does.

3) In the resulting page, the contact names are not linked to the main contact view.

So, is there any way to create a URL which passes criteria and displays a "true" Advanced Search page with profile view?

Many thanks...
Andy Laken
Engineer | CivicActions, LLC
e: andy.laken@civicactions.com | skype: mcantsin | http://twitter.com/alaken

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Way to form URLs for Advanced Search w/profiles?
April 23, 2007, 03:49:15 pm
You can pass a Profile ID in to the advanced search URL - and that will "preload" that profile's listing columns. However, you can not currently pass in search criteria values for advanced search (you can only do this for the simplified profile listings/search functionality).

Sample URL would be:
http://...../civicrm/contact/search/advanced?reset=1&id=3&force=1
Protect your investment in CiviCRM by  becoming a Member!

Andy Laken

  • I’m new here
  • *
  • Posts: 27
  • Karma: 3
Re: Way to form URLs for Advanced Search w/profiles?
April 24, 2007, 05:32:40 am
Thanks, Dave. I was afraid of that. Is there any way to achieve this programmatically? We have access to CiviCRM programming and customization expertise.
Andy Laken
Engineer | CivicActions, LLC
e: andy.laken@civicactions.com | skype: mcantsin | http://twitter.com/alaken

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Way to form URLs for Advanced Search w/profiles?
April 24, 2007, 09:04:56 am
I'll let the experts give you the real answer, but at CivicSpace we hacked CiviCRM by copying the parameter code out of the listings functionality (can't remember exactly which file that code lived in) and used the parameter someplace else, allowing the URL to accept parameters... I'd pretty sure it was in search. This way we could search a smart group + profile view, which basically yielded a poor-mans reporting interface.

I suggest getting on IRC with lobo and having them show you where the parameter code lives.
Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

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: Way to form URLs for Advanced Search w/profiles?
April 24, 2007, 02:00:25 pm

Andy:

Depends on how many name/value pairs you want to pass in "programmatically"

If its just a few (< 5) or so, the hack is relatively simple. If its more of them, you might need to generalize the hack

check CRM/Contact/Form/Search.php

we do it for a few variables which can be passed in via a GET or POST request. specifically _groupID and _ufGroupID. You can use those as examples to start with

You can get us on IRC if u need more help with this

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

Andy Laken

  • I’m new here
  • *
  • Posts: 27
  • Karma: 3
Re: Way to form URLs for Advanced Search w/profiles?
April 25, 2007, 07:20:42 am
Thanks to both of you for the tips - I have forwarded them to our developer, who may follow up if he needs more guidance.

This forum is great!
Andy Laken
Engineer | CivicActions, LLC
e: andy.laken@civicactions.com | skype: mcantsin | http://twitter.com/alaken

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Way to form URLs for Advanced Search w/profiles?

This forum was archived on 2017-11-26.