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 (Moderator: Donald Lobo) »
  • Webform to Edit User's Household
Pages: [1]

Author Topic: Webform to Edit User's Household  (Read 2274 times)

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Webform to Edit User's Household
September 09, 2013, 01:09:00 pm
Hopefully Coleman will be along and can answer or anyone else who knows.

How do I attach a webform to the My Account page as a tab (like a civicrm profile appears on the My Account page) so that the user can edit their Household info?

Is there any certain setting I need to set in Webformcivi to make it pull the Household info for the user?
« Last Edit: September 15, 2013, 10:56:12 am by Coleman Watts »

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform Question
September 09, 2013, 01:16:27 pm
Quote
How do I attach a webform to the My Account page as a tab (like a civicrm profile appears on the My Account page) so that the user can edit their Household info?
I don't know - does searching drupal forums turn up anything?
Quote
Is there any certain setting I need to set in Webformcivi to make it pull the Household info for the user?
I would set up my webform like so:
  • Contact 1: current user - no need to expose any fields for this contact if you don't want to, just need the "existing contact" field
  • Contact 2: household. Enable "exisitng contact" field and set it to be hidden - use it to autopopulate based on relationship with contact 1 (match both household member AND head of household)
  • Also set the webform to create the relationship btw contact 2 and contact 1 - you could expose this if you want to give them a choice btw "head" and "member" of household.
  • Also set up shared address btw contact 1 & 2
Are you also wanting to enter household members?
Try asking your question on the new CiviCRM help site.

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: Webform Question
September 09, 2013, 01:22:13 pm
No just allow the user to edit the Household address from their My Account page.

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: Webform Question
September 09, 2013, 03:23:50 pm
I followed your directions but for some reason it won't pull in the household info. It will create the household and do the link but it won't show the household info and allow edit.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform Question
September 09, 2013, 03:53:18 pm
And you did set the household "existing contact" to autofill based on relationshiop to contact 1?
If so, it may be a permission problem. Make sure the relationship created by the webform is permissioned, and in order to take advantage of that, you'll need to install this:
http://civicrm.org/extensions/relationship-permissions-acls
Try asking your question on the new CiviCRM help site.

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: Webform Question
September 09, 2013, 04:13:23 pm
yes i verified the contact 2 is autofilling from the relationship to contact 1. I'll check the extension later tonight. Thanks!

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: Webform Question
September 09, 2013, 04:45:18 pm
I installed the extension and that fixed it.

I created a View that rendered the webform entity as a menu tab. It's putting the tab on the Edit user from the My Account page but it's overriding the layout.  See the attached images.

User_edit: is the screenshot of the User Edit Screen
my_details: is a profile from Civi for the View Edit User
my_household: is the webform
view is the screenshot of the view page that renders the my_household to the User Edit as a tab.

I'm not sure why it's removing the My Account and My Details links.
« Last Edit: September 09, 2013, 04:51:50 pm by FrTommy »

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform Question
September 09, 2013, 07:58:51 pm
Using views is a clever solution, and it looks like it's working fine for you - the only thing missing is that it's not rendering the tabs, which is slightly puzzling but you could "fix" it by putting the markup for the tabs in the view header.
Try asking your question on the new CiviCRM help site.

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: Webform Question
September 11, 2013, 01:40:43 pm
i tried that but couldn't figure out which token to use to get the user id to make it work properly.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform Question
September 11, 2013, 01:47:27 pm
Well if nothing else you could use the php filter
<?php global $user; print $user->uid; ?>
Try asking your question on the new CiviCRM help site.

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: Webform Question
September 11, 2013, 02:10:39 pm
That worked Thanks Coleman!!!!

mortona2k

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 3
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.2
Re: Webform Question
September 13, 2013, 03:31:18 pm
Thank you both, this has been very helpful to me.  One thing that wasn't clear at first was how to set the household (contact 2) to be autopopulated from the current user (contact 1).

This setting is not in the civicrm tab, you have to go back to webform, and edit the contact 2 "existing contact" field.

Switch the Form Widget from Autocomplete to Static, and then set "Default contact from" to "relationship to contact 1", then you can choose whether to match on household head or membership.

You will also have to edit the existing contact field for contact 1 and set the default contact from to current user.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform Question
September 15, 2013, 10:55:33 am
Yea, the fact that you have to leave the CiviCRM tab to configure an Existing Contact field is not the greatest UX.
In version 4 of this module I've added a little more help text to hopefully explain it a bit better.
Try asking your question on the new CiviCRM help site.

mortona2k

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 3
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.2
Re: Webform to Edit User's Household
September 16, 2013, 11:01:58 am
I am confused about permissions.  For my site, anyone should be allowed to edit their own address or their house.  Since this form, when configured as in this thread, only exposes that info to users, is it safe to turn off enforce permissions?

If that's not safe, how do I configure permissions in Civi to work for this?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform to Edit User's Household
September 16, 2013, 11:05:56 am
Well technically the household is not the same contact as the user, so you need to tell Civi that they have permission to edit that household contact. My recommendation is to create permissioned relationships between households and their members and install this extension:
http://civicrm.org/extensions/relationship-permissions-acls
It is NOT safe to turn off "enforce permissions" - that would give any user the ability to view/edit any household in the database.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Webform to Edit User's Household

This forum was archived on 2017-11-26.