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 CiviMember (Moderator: Deepak Srivastava) »
  • Importing a "permissioned relationship"
Pages: [1]

Author Topic: Importing a "permissioned relationship"  (Read 1450 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Importing a "permissioned relationship"
July 11, 2009, 06:28:50 pm
I know that a permissioned relationship can be established between and Individual and an Organization during the membership signup process with "on behalf of".  However I am importing several hundred Organizations and their Employees.  For each Organization we will need to import one main "representative" capable of having a permissioned relationship with their Org.

I looked here: http://wiki.civicrm.org/confluence/display/CRMDOC/Relationship+Types and also in the Relationship Types section of CiviCRM admin for the "permissioned" feature.  No luck finding any information on how to do this.

Any ideas folks?  Thanks!  If you can describe the process here and we have no Docs for it I will write the docs.

Try CiviTeacher: the online video tutorial CiviCRM learning library.

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: Importing a "permissioned relationship"
July 11, 2009, 07:45:29 pm

i would do the foll:

1. do a normal import and establish a relationship between the employer and employee

2. do an export to get the relevant contact ids of the employer and employee

3. write a sql/php script to set the permissioning between the employee and employer

i think step 2 will be an issue. depending on how u have your data, u can combine steps 2 and 3 by doing a contact search in the script to get the ids

i dont think u should touch the import code :)

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

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Importing a "permissioned relationship"
July 12, 2009, 08:10:55 am
gracias...for #3, where is the "permissioning" column in the database that sets this?  what table?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

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: Importing a "permissioned relationship"
July 12, 2009, 08:29:03 am

civicrm_relationship: columns is_permission_a_b and is_permission_b_a

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

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Importing a "permissioned relationship"
July 12, 2009, 11:11:00 am
Thanks for the info.  I just used PHPMyAdmin to access the database directly rather than bother writing a script.

1) I created a new relationship called "Company Representative..."
2) In PHPMyAdmin find the Id number of "Company Representative" and this is XX
3) Import all your individuals and establish this Relationship during Import process... note I established 2 relationships during import process "Employee of..." and "Company Representative of..."
4) After import Run this simple query in PHPMyAdmin (or on command line).
Code: [Select]
UPDATE `civicrm_relationship` SET `is_permission_a_b` = 1, `is_permission_b_a` = 1 WHERE `relationship_type_id` = XX
Where XX is the id number of your permissioned relationship type

Thanks ... Hope this helps others too!

PS. Hey people don't forget to always backup your database before you start messing around with PHPMyAdmin!
« Last Edit: July 12, 2009, 11:14:30 am by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Importing a "permissioned relationship"

This forum was archived on 2017-11-26.