1

We have organizational memberships - each organization can have up to five individuals who are listed as members. We do this via the membership "Relationship Type" feature, and it works well.

However, competing platforms have a dashboard that allows the contact person for an organization add/remove the individual members that should be part of the record. How can this be implemented with CiviCRM?

Civi 4.7.31, Backdrop 1.9.2 - so Views/Webform/etc. are all options. It's acceptable for a member administrator to search contact names in the database. Writing custom code is an option if there's a simple-ish way to do this.

4
  • You're just referring to allowing org admins permission for editing the CiviCRM contacts of the members, nothing related to Backdrop users, right?
    – Laryn
    Commented Mar 13, 2018 at 19:23
  • Correct @Laryn-CEDC.org. I'm stating the CMS in case CMS-side modules present a solution. Commented Mar 13, 2018 at 20:28
  • Curious if you ever found (or made) an answer to this one?
    – Laryn
    Commented Feb 12, 2019 at 16:37
  • Nope, sorry @Laryn-CEDC.org. The client lost interest. Commented Feb 12, 2019 at 19:31

4 Answers 4

2

I've done something similar with Views, VBO and a custom action. There is an "Add relationship with contact" action in VBO but for more control over the action you can write a custom action.

In my case, the view is of Civi contacts with one of several relationship types to the org. The action is a 'Set as Correspondent' button. Only one person at a time holds the Correspondent relationship with the org so the action uses civicrm_api3() to find and end any current Correspondent relationships, create a new relationship between the selected contact and org and create an activity for info purposes.

Your action could do something similar but check there are no more than 4 existing relationships of that type before creating a new one.

2
  • 1
    This is the missing piece I'm looking for! Do you have code you can share for your "Set as Correspondent" action? Commented Mar 14, 2018 at 17:53
  • nudge - did anything get shared re this custom action? ;-)
    – petednz - fuzion
    Commented May 27, 2018 at 23:22
1

I have a similar requirement for a project. This piece is not yet in active development, but I anticipate building an Angular form (probably based on crmUiWizard) to allow management of relationships and possibly also a limited subset of contact details. In my case it's (probably) NOT acceptable for a member administrator to search contact names in the database (without limitations); might need to rely on the dedupe feature to allow entry of new contacts without creating a mess.

0

Set up a View that shows the logged in person the Org they are related to, and the Indivs related to that Org. Provide an 'update' button/link to load the url of a webform where they can they edit or add new Contacts.

I can probably add more if I understand at what point this approach is problematic (eg Backdrop has Webform but not Webform-CiviCRM?)

3
  • How does one create a new relationship from the View? Commented Mar 14, 2018 at 1:25
  • Provide an 'add another' link in the view that takes them to webform eg in View Header or Footer - the link would have eg cid1 value in url
    – petednz - fuzion
    Commented Mar 14, 2018 at 5:10
  • But given your experience in such things i am sure i must be misunderstanding the requirement. happy to skype share if that helps
    – petednz - fuzion
    Commented Mar 14, 2018 at 5:20
0

It might be possible to do this via a View that lists people that are linked to the contact person's Org and provides customized links from the view to a webform (passing contact IDs via URL to populate the webform). You may also need the Relationship Permissions ACL extension and have these relationships set up to grant editing permissions.

e.g. If you have a view that is pulling the current user (contact person with permissions to add/edit), you can use the View to also get the Org and the other members based on relationships, then feed them into a Webform with CiviCRM functionality enabled, feeding the contact IDs into the webform using the URL. ("If the url contains e.g. cid1=123, it will be used to pre-populate this contact (takes precidence over other default values).")

You could set up the form to only allow input for 6 contacts (the org and 5 members) and specify their relationships in the webform/civicrm settings, you can feed the contact IDs if they exist, or allow new contacts to be created if they don't.

1
  • I just had a thought that might solve the issue in terms of a max number of member listings and edited above.
    – Laryn
    Commented Mar 14, 2018 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.