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) »
  • Allow (Drupal) users to edit the Contact information for their own Organization
Pages: [1] 2

Author Topic: Allow (Drupal) users to edit the Contact information for their own Organization  (Read 3181 times)

balleyne

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.3.x
Allow (Drupal) users to edit the Contact information for their own Organization
November 26, 2012, 02:30:14 am
I'm trying to allow users on my (Drupal) CiviCRM website to manage/maintain the information for their own CiviCRM Organization Contact (that is, the Organization Contact for which their Individual Contact has a relationship, which should be a 1-to-1 relationship in my case). Can this be done?

I figured that creating an Organization Profile would be the best way to accomplish this. However, I'm not sure how to display the profile for users to maintain their own organization's information... for example, with the 'Name and Address' Profile for Individual Contact information, when I enable this on the Drupal view/edit page, it's automatically linked with the Individual Contact associated with the account being edited... however, the same does not happen with an Organization Profile (when I try to include on the user edit page, it's blank, rather than being automatically linked with the Organization associated with the Individual Contact associated with the user being edited).

Any help would be greatly appreciated.

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: Allow (Drupal) users to edit the Contact information for their own Organization
November 26, 2012, 06:58:23 am

yes, this can be done via permissioned relationships and profiles

I'm pretty sure the book / wiki have documented this, so might want to search on it. The list of orgs a user can update also appears on their "CiviCRM Contact Dashboard"

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

balleyne

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Allow (Drupal) users to edit the Contact information for their own Organization
January 24, 2013, 10:57:25 am
Thanks for the quick reply, lobo. Here's my not so quick follow-up...

I didn't find a lot about permissioned relationships in the CiviCRM book (nothing about relationships in the profiles section, only a mention about setting the permissions for individual relationships in the relationships section...), but I've figured out how to set a relationship to be permissioned so that a contact can manage their organization's information through links in their contact dashboard. However, I'm still trying to figure out two things: (1) if the permissions can be set on the relationship type so that all relationships are permissioned by default; (2) how to connect a permissioned relationship to a profile (ideally, a profile available on the Drupal user edit page).

It seems like #1 is not possible, may require some custom code or database queries. And it seems like #2 may require some custom templates and isn't possible via the web GUI?

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: Allow (Drupal) users to edit the Contact information for their own Organization
January 24, 2013, 04:40:00 pm

yep, you got it right for both the questions

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

balleyne

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Allow (Drupal) users to edit the Contact information for their own Organization
January 25, 2013, 12:44:23 am
Thanks for the quick reply!

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: Allow (Drupal) users to edit the Contact information for their own Organization
January 25, 2013, 02:51:07 pm
Does this help you move forward?

http://civicrm.org/extensions/relationship-permissions-acls
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

balleyne

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Allow (Drupal) users to edit the Contact information for their own Organization
January 31, 2013, 08:10:49 am
Another question: on the Organization edit page that appears through the contact dashboard in the context of a permissioned relationship, is it possible to include custom fields, to allow contacts to manage the custom fields for an organization they have a permissioned relationship with?

@petednz: thanks for the link, that may help -- I will check it out!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Allow (Drupal) users to edit the Contact information for their own Organization
January 31, 2013, 08:53:34 am
Yep on that too but not sure if it can be done with the default template.  What we did was create a profile with the fields we wanted to expose for updating. Then simply linked that from a node (page) in Drupal. We took away the edit stuff in Drupal since we felt that a profile was a better way of updating this info.  We also discovered that others with the same relationship cannot be edited directly from the user dashboard but can be edited from the org's dashboard (transitive relationship is not available at this time).  So we created user accoutns for the org's instead where, in this case the membership belonged to and then just used profiles to create the edit sections for everything but the attached individuals.  One other note is that I had to modify the RelatedContact.tpl to get the fields I wanted in there as well.  Still working on putting job_title into the template as it is not a current exposed value to this tpl.  I did however remove the address info so that any "Shared" addresses at the org level was the single spot of update and not any particular individual. But that is my use case.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Allow (Drupal) users to edit the Contact information for their own Organization
January 31, 2013, 10:10:23 am
Of course if it were me I would do it with a webform. More flexible and doesn't require permissioned relationships. Also allows you to collect individual and org contact info on the same form, or even let the individual change their current employer if you wish.
See http://drupal.org/node/1615380
Try asking your question on the new CiviCRM help site.

balleyne

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Allow (Drupal) users to edit the Contact information for their own Organization
February 07, 2013, 12:55:13 pm
Thanks for all of the suggestions! Reporting back that Webform with CiviCRM integration has been working pretty well to solve the problem.

balleyne

  • I’m new here
  • *
  • Posts: 14
  • Karma: 1
  • CiviCRM version: 4.3.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: Allow (Drupal) users to edit the Contact information for their own Organization
February 08, 2013, 02:25:53 pm
One quirk with the webform... I've set it up as described that like, with Contact 1 as the current user and Contact 2 as the Current Employer relationship to an Existing Contact. It works great for adding a new organization, or creating a new relationship with an existing organization.

However, when I log in as a user and visit this form, and there's a pre-existing current employer relationship, and I click the X on the organization name main contact 2 field in webform to clear out the organization, it clears the rest of the Contact 2 fields in the form as expected, but it doesn't actually remove the relationship when I submit the form. If I go back to the form, the organization is back as the current employer, even after clearing it and submitting the form.

Is this the expected behaviour? Is there some setting or trick to allowing a user to remove a relationship like this via Webform? I don't think it has anything to do with CiviCRM permissions, because I can remove the Current Employer relationship without a problem via a Profile as the same user...

Thanks,
Blaise

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Allow (Drupal) users to edit the Contact information for their own Organization
February 08, 2013, 02:44:11 pm
Hmm, that's a tricky one. It's hard to tell the difference between when you have intentionally cleared your employer vs when it just didn't pre-fill for some reason, so it's hard to know if you really wanted to delete that relationship.
So no, webform doesn't handle that (although that's one of the few fields it doesn't handle as you'd expect, maybe the only one, so I'll see what can be done)
Try asking your question on the new CiviCRM help site.

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Allow (Drupal) users to edit the Contact information for their own Organization
February 11, 2013, 09:05:59 am
I also noticed that the "Address Name" field is missing from the selection as well.  Would be great to add that.

What I can't figure out is when logged in as an organzation and viewing a Webform that includes the employees it only allows for new ones not to edit the existing ones unless I am missing something.

Thanks for an awesome module.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Allow (Drupal) users to edit the Contact information for their own Organization
February 11, 2013, 09:41:45 am
Yes I think you're missing something. Depending on how you've set up your webform it is indeed possible to autofill and update existing contacts. The trick is to edit the "existing contact" field and control which fields are editable and how the contact will be autofilled (in this case by relationship)
Try asking your question on the new CiviCRM help site.

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Allow (Drupal) users to edit the Contact information for their own Organization
February 11, 2013, 01:14:48 pm
Hi Coleman,

Guess I am still missing it somewhere. Please see my screenshot.  Not sure what I didn't select but when I view this from an org login the org shows up fine but none of the employees are populated.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Allow (Drupal) users to edit the Contact information for their own Organization

This forum was archived on 2017-11-26.