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 Drupal Modules »
  • Drupal Webform Integration »
  • Adding Relationship after an approval
Pages: [1]

Author Topic: Adding Relationship after an approval  (Read 1240 times)

Aahar

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 3
  • CiviCRM version: 3.4 and 4.0
  • CMS version: Drupal 6.17, 6.x and Drupal 7.x
  • PHP version: 5.2
Adding Relationship after an approval
April 11, 2014, 03:52:18 am
I am in the middle of a cumbersome job of entering membership records.
We want to keep detailed records(including custom data) of members along with their family relationships like Parent, Spouse, Sibling.
Our members fill the paper form and submit which we enter and also update relationships manually.
This is a huge manual work so I am looking for a better alternative
-----------
our Use-case:
We want our members to  fill in their details online for themselves.
To do this,
1) We already have our members Name, email and phone numbers in a spreadsheet (csv)
2) We can create Drupal users and send them login credentials (using Feeds module)
3)  When they login they can fill in the webform (integrated with civicrm)

Problem:
1) How does the current user add  relationships like spouse, child, parent ? We want every relationship to be approved by the contact2.
I have read some of the posts online, which suggest that logged in users can search an existing contact and add relationship using webform.
I have tested that it works.
But, we want the contact2 to approve it before the relationships show up in Civicrm Relationships Tab

This is similar to "Approval" requests seen on social networking sites.
The reason we want to do this is to avoid corrupting the relationships part of our civicrm data. There could be errors or some relationships added on purpose. Imagine, a man adding another man's wife as his wife mischievously or by mistake.


petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Adding Relationship after an approval
April 11, 2014, 01:34:48 pm
Quote
3)  When they login they can fill in the webform (integrated with civicrm)

You know you can send a civimail to them with a checksum for a webform so they don't 'have' to login?

Quote
Problem:
But, we want the contact2 to approve it before the relationships show up in Civicrm Relationships Tab

No idea how to approach this with existing options. Off the cuff thinking follows (so expect large gaps in my logic but .....)
You create new Relationships such as "Spouse to be confirmed"
You set this up in a webform.
Contact A creates a 'Spouse to be confirmed' Relationship with Contact B that sets Contact B as 'permissioned' over Contact A.
Webform fires off an email Contact B with checksum to another webform
Contact B then has option to 'find' Contact A (due to the above permissioned relationship) and can then set Contact A as 'Spouse'
Webform fires off email to Contact A to say the relationship has been confirmed

Everyone may be happy or divorce precedings may be commenced
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Adding Relationship after an approval
April 11, 2014, 02:25:36 pm
Pete,

I wrote a very similar response, then deleted it when I realized I was missing large chunks of the equation!

* I believe there's still no API for sending an e-mail - so while you could send an e-mail via a PHP function, you couldn't use checksums etc. - maybe if someone employed some BAO ugliness that would work.
* I couldn't think of a good way to do the UI for confirming the relationship - I guess I was too caught up in the idea that you should be able to confirm the relationship by clicking a single URL  in the e-mail.

I guess if you created a file similar to extern.php, you COULD have a single-click confirmation - you'd use a stand-alone PHP file, and when you clicked "Approve" or "Deny" ("Divorce"?) it would pass arguments which the file could use to trigger the appropriate action.

Regardless - it seems like a LOT of work!  Though last week I wrote a similar module.  My advantage was that the relationship was confirmed on the back-end, making this a LOT simpler.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Adding Relationship after an approval
April 11, 2014, 04:05:13 pm
Not sure if the above is in context of trying to get the relationship confirmed prior to creating it in civi. My step around was clearly to create one relationship and use that to then create the proper relationship.
At that point I hadn't thought about just adding a field to the relationship - which can be done - and hence have the rel'n created with eg a 'pending confirmation' button - and then on the second form letting the ContactB set this to 'confirmed'
That seems a lot nicer than my original route.

Quote from: JonGold on April 11, 2014, 02:25:36 pm
* I believe there's still no API for sending an e-mail - so while you could send an e-mail via a PHP function, you couldn't use checksums etc. - maybe if someone employed some BAO ugliness that would work.
Not sure if this question relates to my recipe. As far as i can think this through, webform can send out the email notification to Contact B (who obviously wouldnt like getting an email asking them if they were married to eg George Bush but that is a different issue with this whole proposal I think) and that email can include a checksum to another webform that will load with Contact2's details and related 'to be confirmed' contacts I expect.
So wasn't seeing where email and API comes in to it, but maybe that is for your quite different solution.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Re: Adding Relationship after an approval
April 14, 2014, 12:40:26 am
Is it an idea to set the relationship to 'inactive'? E.g. you create the relationship in the webform but it is not active. The 2nd user should on approval activate the relationships. I think you can achieve this all with webforms.
e.g.
1 One webform for the user
2. One webform for 2nd user which approves all relationships (or this latter one could be done manually in civicrm)
Developer at Edeveloper / CiviCoop

Cite0002

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: 7.2.8
  • MySQL version: 5.5.35
  • PHP version: 5.3
Re: Adding Relationship after an approval
May 15, 2014, 06:30:05 am
How to autofill the inactive relationships using webform civicrm intigration

Aahar

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 3
  • CiviCRM version: 3.4 and 4.0
  • CMS version: Drupal 6.17, 6.x and Drupal 7.x
  • PHP version: 5.2
Re: Adding Relationship after an approval
May 16, 2014, 12:56:43 am
jaapjansma, your suggestion is interesting.

But, how to populate Webform2 which ContactB would use to activate the inactive relationships.
I mean, the webform2 must be autofilled with all inactive relationships for for ContactB so that he can chose to activate it.

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Re: Adding Relationship after an approval
May 16, 2014, 04:01:33 am
I am not sure how to do this exactly. So I would start with experimenting with the webform. You can prepopulate the contents for contact B based on a parameter in the url. See the explanation  on the webform by the field existing contact. Also I  think you can add the relationships and then only show the field is_active.

Jaap
Developer at Edeveloper / CiviCoop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Adding Relationship after an approval

This forum was archived on 2017-11-26.