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 (Moderator: Dave Greenberg) »
  • Add a contact to a (calculated) group after creation
Pages: [1]

Author Topic: Add a contact to a (calculated) group after creation  (Read 974 times)

cbenz

  • I’m new here
  • *
  • Posts: 7
  • Karma: 1
Add a contact to a (calculated) group after creation
March 25, 2010, 03:50:27 am
Hi,

Is it possible to add a contact to a group after its creation ?

More complicated :

Is it possible to add a contact to a group which depends on the user group ?

In my instance of CiviCRM, each contact has a Drupal-role synchronized to a CiviCRM group (1 to 1 relation, with CiviGroup Roles Sync). I called these user-groups like this: "Users of the foo-department". Then, there is one contact group for each of the user groups, and this group represents the contacts the user can view and edit. I called it "Contacts owned by users of foo-department". And there are ACLs for that. In Drupal, the permission "edit all contacts" and "view all contacts" is set to false.

The aim is to allow users to view and edit only the contacts they are responsible for. Other users can't even view those contacts.

Now, when a user creates a new contact, by defaults it belongs to no group. So the user can't even view the newly created contact! So here is the point, why I need to add automatically this contact to the group corresponding to the contacts owned by the user, according to the group of the user.

Thanks in advance for any advice.

cbenz

  • I’m new here
  • *
  • Posts: 7
  • Karma: 1
Re: Add a contact to a (calculated) group after creation
March 31, 2010, 07:35:02 am
I implemented this using a hook. The code will be published soon.

ahidalgo

  • Guest
Re: Add a contact to a (calculated) group after creation
October 12, 2010, 02:46:58 am
I need the same function. Is the hook implemented? Where can I find it?

Many thanks  ;)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Add a contact to a (calculated) group after creation

This forum was archived on 2017-11-26.