says, I am possible
By: padya
15 Jul 2011
The synchronization is "one-way" - from Organic Groups to CiviCRM Groups "It doent support two-way" i.e if we add a new group or edit or subscribe/un-subscribe user from CIVICRM it wont get updated in drupal og group .
Once the module is enabled via Drupal Administer » Modules - for any new or re-saved Organic Group it will automatically create 2 CiviCRM groups:
A "normal" group containing a contact record for each corresponding Organic Group user member. This group is assigned the same name as the linked Organic Group. (The linking is by convention - e.g. they fact that they have the same name IS the link.)
An "ACL" group containing the contact record of the "administrator" of the corresponding Organic Group. This gives the OG group admin the ability to view and edit members of "their" group in CiviCRM.
When a new user is added / signs up for an Organic Group, they are automatically added to the corresponding CiviCRM Group.
NB: for existing OGs the synching only seems to only add the Manager in to the Civi 'Admin' Group, not the other Admins. Removing and recreating their OG Admin-ness sorts it..
Reverse Synching ie CiviCRM > OG
Its very easy to reverse synching of civi to og and i found it very interesting. Below are the following steps to make it working.
1. Create a module for drupal and use hook_civicrm_postProcess of CIVICRM.
2. In postProcess hook add condition to check form i.e if($formName == "CRM_Contact_Form_Task_AddToGroup" || $formName == "CRM_Contact_Form_Task_RemoveFromGroup").
3. If the condition goes true write code to add new /delete/edit group i.e write INSERT/DELETE/UPDATE query insert/delete/update into drupal og table for the respective actions.
4. Now write code to subscribe/unsubscribe users into drupal og. You can build your own code/function to add user or to save ur time you can use api og_subscribe_user() to add new users in new/existed group. This function requires three arguments to pass
request - This field is null.5. To unsubscibe use og_unsubscribe() api. The arguments required to pass are.
NB: No need to write code to add/delete/edit group or add/delete users into CIVICRM table. It will automatically get executed. No need to break your head.
Importing CiviCRM Contacts to OG (Through CSV)
A useful tool for grabbing CiviCRM contacts to add to the OG (if you don't go down the 'reverse synch' route) is User Import Organic Groups
Just export CiviCRM contacts' emails and add Drupal users to the OG, or create them on the fly (in which case also export First Last to build the user name from).
1 Response to OG (Organic Group) CiviCRM Two-way synchronization
Tobias Eigen (not verified)
Wednesday, November 16, 2011 - 23:13 reply
Hi there,
Thanks for this post. I'm not a programmer, but have a site with OG, CiviCRM, and CiviCRM OG sync. I installed Civi OG Sync later, and there is a discrepancy between members of the groups - many OG group members are not in the equivalent CiviCRM group. What would you recommend I do to really sync them so that they are identical going forward?
Thanks!
Tobias
Post new comment