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 Profiles (Moderator: Dave Greenberg) »
  • Creating a non-public profile for search results
Pages: [1]

Author Topic: Creating a non-public profile for search results  (Read 1731 times)

weretoast

  • Guest
Creating a non-public profile for search results
April 26, 2010, 09:30:36 am
Hi all,

I am trying to create a custom profile used to show search results.  How do I make one that is not publicly accessible?  This profile is for internal staff use only and should not be publicly accessible.

Thanks for your help,

websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: Creating a non-public profile for search results
January 13, 2011, 04:17:13 pm
I'd love to know this too.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Creating a non-public profile for search results
January 15, 2011, 04:14:48 am
Good question, it shouldn't be necessary to make it publicly visible, but because you can't set fields as a column unless it's visible, you pretty much have to.

Not sure if it's only a limitation on the edit form or somewhere down the road too. Could you try hacking the edit form of the profile to let the user select the field as a search column even if the visibility is admin only ?

Other than that, as a workaround you can create a custom template for the specific profile, and add a test in it to check if the user is anonymous.

in templates/CRM/Profile/Page/x/Listings.tpl View and Form/x/Edit.tpl, add a

{if !$session->get('userID') > 0}
Members only area. Nothing to see
{else}
The normal form
{/if}


Or write a hook that verify that the user has the right access before displaying the profile x (probably more versatile and easier to maintain in the long run)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

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: Creating a non-public profile for search results
January 18, 2011, 12:56:14 am
or use Views?
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

websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: Creating a non-public profile for search results
January 18, 2011, 11:34:45 am
Use Views how?

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: Creating a non-public profile for search results
January 18, 2011, 11:55:11 am
You can build a Drupal View that pulls in data from CiviCRM - you can then set standard Drupal Roles access control over those pages. I think this covers it http://wiki.civicrm.org/confluence/display/CRMDOC33/Views2+Integration+Module
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

websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: Creating a non-public profile for search results
January 18, 2011, 12:07:26 pm
Thanks, I'll have a go. And will try not to be frightened by that diagram.  :o

websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: Creating a non-public profile for search results
January 24, 2011, 04:26:33 pm
It may cover it in that documentation but it's way beyond my comprehension.

I have done this:

  • set up a CiviCRM contact view with a Page display
  • Added some fields - Contact ID, First Name, Last Name - all set to default settings
  • Added a filter of one Custom Data field (default settings)

When previewing the view I get:

Code: [Select]
An error occurred at /admin/build/views/ajax/preview/civi_profile_test.

Error Description:
Fatal error:  Unsupported operand types in /home/WWWSITES/cc32b.greens.org.nz/sites/all/modules/views/handlers/views_handler_filter.inc on line 470

I've found advice on the Drupal site to remove filters until I find which one is causing the error - no prizes for narrowing it down here.

I just want a directory and a search form, configurable to search on and display the fields I want, without exposing our whole database to the public. Is this possible without coding with Views and CiviCRM?

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: Creating a non-public profile for search results
January 24, 2011, 05:36:14 pm
you need to set up the view-handler for any custom data fields you want to use = so 'can it be done without any code', well you need to update the settings.php for each custom field you want exposed in Views.

Try these links
http://forum.civicrm.org/index.php/topic,13180.msg56665.html
http://forum.civicrm.org/index.php/topic,12541.msg54458.html#msg54458

HTH
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

websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: Creating a non-public profile for search results
January 24, 2011, 06:02:57 pm
Thanks, the settings.php file was already updated with that code. I doubt our custom data fields would have appeared otherwise.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Creating a non-public profile for search results

This forum was archived on 2017-11-26.