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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Personal Groups / Favorites - Suggestions?
Pages: [1]

Author Topic: Personal Groups / Favorites - Suggestions?  (Read 734 times)

mneimeyer

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
Personal Groups / Favorites - Suggestions?
October 11, 2013, 11:43:47 pm
If this exists let me know... because I've missed it. :)

I want to implement something like Groups but that are custom to each user. Maybe Favorites would be a good name? I can only think of two elegant-ish solutions and I'm not sure I'm fond of either. The use case would be a list on the dashboard of Favorite contacts for quick access.

The first method would be create groups named for each person. I create a group called "Matt's Favorites" and my partner creates a group called "Harry's Favorites". Then... Store the name manually in a custom field somewhere? That works when there are two of us... but it doesn't scale. If we have 100 employees then we have 100 groups floating around out there. I also can't think of an easy way to select contacts that match a group that is dynamically driven by a field on another contact that matches the logged in user.

I could also add a custom field set, allow multiple records, and make a custom action that would add/remove "Me" as a record to that set. (So any contact with Me in that set would be one of my favorites) but I don't like this because I can't think of a way to allow someone to only add or remove themself from the list ... Again, for now just two of us? I trust him... as we grow?

I realize there are other ways I could do this like setting up activities with due dates way in the future and then use the Activity dashlet... but that mixes up contacts where we do have activities...

Any thoughts or ideas on this?

Thanks in advance!

Matt

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Personal Groups / Favorites - Suggestions?
October 12, 2013, 02:18:24 am
Could you use an ACL hook to address the issue of producing a long group list? So overall devel might look like:

 1. Add a custom field to the "Group" entity called "Owner". (Type => Contact Reference)
 2. Add an ACL hook to limit visibility of groups which have owners.
 3. When displaying a list of the current user's favorites on the dashboard, perform a multi-step lookup (e.g. "Find group owned by current user. If none, create one. Get list of group members").

(Since this adds a new record owned by a contact, one might need extra logic to handle cases where the group-owner-contact is merged or deleted.)

mneimeyer

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
Re: Personal Groups / Favorites - Suggestions?
October 13, 2013, 04:43:40 pm
I haven't played with the ACL hooks... so I do like the idea that I could use that to enforce the owner of a group. I'm not sure I like that it still means that there are groups for every user floating around.

But you got me thinking more about hooks in general. I wonder if I could "safely" use a Form Validation hook to effectively do a permissions check.

Is that hook called on EVERY form submission?


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Personal Groups / Favorites - Suggestions?

This forum was archived on 2017-11-26.