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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Changing default search profile
Pages: [1]

Author Topic: Changing default search profile  (Read 3029 times)

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
Changing default search profile
December 15, 2008, 04:15:25 pm
Hi there,

I've seen a few posts explaining how you can override the default columns returned for a contacts search on a per-search basis, but none explaining how you might go about overriding it and setting a default for all searches.

I'd be happy to override the column definition for "default view" (if and where they are defined somewhere) or set each/all of the different searches to point to a custom profile rather than "default view" profile - whichever is easiest.  I searched the code for things like "uf_group" but couldn't get anything working.

Thinking bigger, it would be good to have the ability to set the default search columns somewhere in global settings / site preferences and am happy to write that up as a feature request (what's the process there?  is it better to propose it here first, or just go ahead and request it on Jira?)

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

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: Changing default search profile
December 15, 2008, 05:30:03 pm
The default view is hard coded and is not a profile (the profile search view came in a much later release). As such there is no "UI" way of changing the default for all contact searches though a code way might be quite easy and probably just involve changing line 402 of CRM/Contact/Form/Search.php from

Code: [Select]
        $this->_ufGroupID       = CRM_Utils_Request::retrieve( 'id' , 'Positive', $this );

to

Code: [Select]
        $this->_ufGroupID       = CRM_Utils_Request::retrieve( 'id' , 'Positive', $this, false, $YOURDEFAULTPROFILEID );

I just tried it and it worked :). Moving $YOURDEFAULTPROFILEID to the config object / database is relatively easy. Wanna file an issue. We'll target it for 2.3

You can also send in the id parameter to specify a default profile. thus:

http://drupal.demo.civicrm.org/civicrm/contact/search/basic?reset=1&force=1&id=1

gives you a search listing with the display controlled by profile id = 1

lobo

« Last Edit: December 15, 2008, 09:08:23 pm by Donald 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

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: Changing default search profile
December 16, 2008, 02:50:59 am
Great that worked perfectly.  Have filed an issue (http://issues.civicrm.org/jira/browse/CRM-3945).

Also got me thinking about a more general admin settings hook similar in nature to drupal's admin settings hook that provides ability to add settings to the Civicrm admin pages.  I have also suggested that Jira (http://issues.civicrm.org/jira/browse/CRM-3944).
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Blake

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 5
    • LinkedIn Profile
Re: Changing default search profile
May 05, 2009, 09:11:25 pm
The fix works great when I'm logged in as admin, but if I log in as another user with less access I get an error along the lines of

Quote
The requested Profile (gid=5) is disabled OR it is not configured to be used for 'Profile' listings in its Settings OR there is no Profile with that ID OR you do not have permission to access this profile.

Any idea how I can fix that? Using 2.2 with Drupal 6.11.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Changing default search profile
May 05, 2009, 10:29:56 pm
hi,

You might want to give "profile listings and forms" permission to authenticated user.

HTH

kiran
You Are Designed To Choose... Defined By Choice.

Blake

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 5
    • LinkedIn Profile
Re: Changing default search profile
May 06, 2009, 02:40:23 pm
That did the trick. Thanks.

ChrisChinchilla

  • I post occasionally
  • **
  • Posts: 104
  • Karma: 3
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 6 & 7
Re: Changing default search profile
July 16, 2013, 06:43:56 pm
That url parameter help me to… Just wondering are there any 'comprehensive' guides to url parameters, they're often quite helpful.

I can start compiling if not…
Melbourne CiviCRM meetup group - http://www.meetup.com/MelbourneCiviCRM/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Changing default search profile

This forum was archived on 2017-11-26.