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) »
  • Questions using profiles for custom search and display
Pages: [1]

Author Topic: Questions using profiles for custom search and display  (Read 2163 times)

Wonder95

  • Guest
Questions using profiles for custom search and display
January 24, 2008, 06:58:11 pm
I'm struggling through trying to make custom search and profile pages, and I've run into a few questions and issues:

1) Contacts are created through a Membership signup screen, so therefore they have to have one of three membership types.  How do I add the membership type to my profile?  I don't see it in the listing of available fields when creating the profile.

2) I use Current Employer in my profile that is used for signup, and I've added it to my search profile.  However, the field is not displayed in the results, even though there is data in that field for the contacts.  Why won't it display?

3) Is it possible to have only some of the fields available to search on and all fields displayed in the search results?

4) Can I make it so that a profile only returns results from certain groups?

Thanks (more questions later...)

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: Questions using profiles for custom search and display
January 24, 2008, 08:20:00 pm

1. we only expose a few member fields. If u dont see it, i suspect we are not exposing membership type

2. That is a known issue. We hope to fix it in a future 2.x release

3. you can use a profile to display your search results. You control all the fields that go into that profile. Thus only profile enabled fields can be seen in the search result

4. You can restrict a profile to one group (limit listings to groups). I'm not very sure if we support smart groups and how efficient it is for smart groups

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

Wonder95

  • Guest
Re: Questions using profiles for custom search and display
January 25, 2008, 10:29:32 pm
Follow up questions, if you don't mind. 

I have three memberships (call them A, B, and C).  I need to allow those with memberships A and B to be able to search on and see anybody, but those with membership C to only see other members of type C.  How exactly do I set this up (using Drupal)?  I've tried creating smart groups (one for each membership type), but apparently smart groups can't be used for access control.  I've tried creating a search profile tied to a group, but I can't figure out how to set access control since I can't use my smart groups for that.  Ideally, once a contact signs up for a membership type, their access rights would be set based on the membership they signed up for.  Is that possible?

Also, if I'm understanding correctly, CiviCRM doesn't provide user authentication - that is done by Drupal, correct?  So, in order to do that, either a) the user selects the checkbox during the registration process to create an account, or b) an admin has to create the Drupal account manually.  Then, the user has to log in through Drupal for their access rights to be determined.  Am I right?  It would seem logical to me to have an option in CiviCRM so that a Drupal account is created automatically when a contact signs up for membership in CiviCRM, instead of leaving it up to the contact when they sign up.

Thanks.

P.S. - Forgive me if I sound impatient, but my forehead is almost flat from banging it against the wall for the past few weeks trying to figure this out.  I have a site due on 1/31, and I'm almost no closer than I was a week ago because I can't figure how to do something simple like have membership sign up and set up searches and access rights based on those memberships. :-[

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Questions using profiles for custom search and display
January 26, 2008, 02:25:34 pm
This is not a perfect solution, but meets the requirement:
create a smart group for each membership: A&B , C.
Create a profile for A&B , C.
Control access to the profile search for C.

A&B people search  by profile listing.
C people search via the default CiviCRM search interface directly.

Avoids ACLs entirely.

Authentication is provided by the user framework (drupal/Joomla) not CiviCRM.

There is an option when creating profiles to automatically create a drupal account.

Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Questions using profiles for custom search and display
January 27, 2008, 06:06:18 pm
Quote from: geilhufe on January 26, 2008, 02:25:34 pm
There is an option when creating profiles to automatically create a drupal account.

... yes, and a profile with that option enabled can be included in an online contribution page used for membership signup - which would (seemingly) accomplish your requirement of having a person signup for membership AND become an authenticated user.
Protect your investment in CiviCRM by  becoming a Member!

Wonder95

  • Guest
Re: Questions using profiles for custom search and display
January 31, 2008, 06:50:40 pm
As I understand it (and from what I've seen), checking the "Drupal user account registration option" in the profile settings creates a checkbox for the user to check during registration if they want to create a Drupal account, but it's not automatic.  Or is there another place to select this?

So how do I limit access to the profiles for A and B without ACLs?  Do I have to assign the users to roles in Drupal that are the same as the smart groups in CiviCRM?  Or is there another way?

Thanks.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Questions using profiles for custom search and display
February 01, 2008, 10:29:53 am
Quote from: Wonder95 on January 31, 2008, 06:50:40 pm
As I understand it (and from what I've seen), checking the "Drupal user account registration option" in the profile settings creates a checkbox for the user to check during registration if they want to create a Drupal account, but it's not automatic.  Or is there another place to select this?

No - you'll have to modify the code to "force" this option.

Quote
So how do I limit access to the profiles for A and B without ACLs?  Do I have to assign the users to roles in Drupal that are the same as the smart groups in CiviCRM?  Or is there another way?

Some thoughts...

Types A and B get assigned to a role which has "access CiviCRM" and  "view all contacts" permissions. (Perhaps using the new civimember_role module announced recently on this forum to assign that role automagically). This handles your requirement to "allow those with memberships A and B to be able to search on and see anybody."

Members in type C gets assigned to a role with  only the "profile listings and forms" access. You create a Smart Group for them from Advanced Search. Then create a Profile which you can use for search / listings and use the "Limit Listings to Group" to only show contacts in the "C Members" smart group.
Protect your investment in CiviCRM by  becoming a Member!

Wonder95

  • Guest
Re: Questions using profiles for custom search and display
February 02, 2008, 10:57:41 pm
One problem with this is that the anonymous user has to have "profile listings and forms" to even be able to access the membership registration form, since only anonymous users would even be using that form. 

What the client would really like is to have multiple pages, one with just a listing of each of the three groups, on separate tabs.  So, when a member of A or B logs in, they would see three tabs, one with a listing for each group.  So, from what I can tell, I would create a link like this for each group:

Code: [Select]
civicrm/profile?reset=1&force=1&gid=2&search=0
where gid is the group ID number.  Am I correct?  If so, then I just need to figure out how to make the tabbed pages,  If not, what is the correct way to make the listings?

Thanks.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Questions using profiles for custom search and display
February 04, 2008, 12:35:33 pm
That is the correct URL format for a profile listing page if you want to suppress the search form (that's the search=0 parameter).

If you're "just" collecting the base info on your membership form - without including additional fields via profile - then you don't need to give anonymous users the "profile listings" permission. Otherwise you'll need to move into using the ACL-driven permissions on your profiles.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Questions using profiles for custom search and display

This forum was archived on 2017-11-26.