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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Modeling the ownership of a group
Pages: [1]

Author Topic: Modeling the ownership of a group  (Read 2074 times)

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Modeling the ownership of a group
November 13, 2008, 04:23:51 pm
I'm looking at modeling a set of relationships between groups, organizations and members of groups.

The problem looks like this:

1) The site is used to analyze, discuss, and maintain information about organizations.
2) Organizations can reasonably be modeled as CiviCRM organizations.
3) Organizations have a variety of officers and representatives.
4) Groups might contain members of organizations, or people who are discussing/approving it.  But the relationship between a group and an organization is variable. 

I can't use relationships to model this, since they are contact to contact.  I could add custom fields to my groups, but there isn't really UI for a "contact link" in custom data.   And I don't believe there's a standard way to link an organization back to a group.

What are the best tools to use in the 2.1 data model for this?  It's certainly possible to do weird and wonderful things with JavaScript to make an integer field look like a group or contact selector, but I'd prefer not to try anything that weird and wonderful if I can avoid it.  I am also open to doing custom templates to add some of the needed UI, or manipulating forms with the 2.1 form hooks if needed.

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: Modeling the ownership of a group
November 13, 2008, 07:49:56 pm

i dont think i understand point 4 completely to help, but a few random related thoughts that might be helpful

Similar to CCK's idea of a "node reference", we might want to introduce "contact reference" as a data type for custom data. Thus you can create a custom group and one of the fields can be a contact reference. This has come up recently in some other contexts also. If you prototype this for 2.1, we can potentially incoporate this into core for 2.2

2.1 has also also got "custom fields" which are initialized/updated by PHP code (via the civicrm_custom hook) which you might be able to use. That along with form hooks might enable you to implement your model

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

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Re: Modeling the ownership of a group
November 13, 2008, 08:14:42 pm
Yes, a contact reference is one of the things I was thinking about.

I may try doing it in 2.1.  I noticed the custom hook, and you already have most of the needed Dojo stuff lying around.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Modeling the ownership of a group
November 14, 2008, 12:36:31 am
Hi,

Not sure we have the same need, but my way of doing it is to use household as "groups" (I change the name on a custom language .po) and use relationship to capture the "status" of each individual on the group.

Eg I create relationship "president","member","observer"... between individual and "household".
and as many type of relations between the "household" and the org as you want.

BTW, I'd suggest to not use the word "group" for your groups, but committee or something like that to avoid confusion with the civicrm groups

As a bonus, we modified the relationship tab on the forthcoming civi version to display more informations.
(the original idea of perverting the household concept is from Damien)

Ideally, we'd need something like the contact subtype, but I don't think that's on the pipe for the next version at least.
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

okmi

  • Guest
Re: Modeling the ownership of a group
January 29, 2009, 07:35:16 am
Quote from: xavier on November 14, 2008, 12:36:31 am

Not sure we have the same need, but my way of doing it is to use household as "groups" (I change the name on a custom language .po) and use relationship to capture the "status" of each individual on the group.


Hi Xavier -

We have the exact same need (or something very similar at least). Would you be willing to post basic instructions on how to change the name on a custom language .po? We would like to create a relationship between individuals and committees as well. Thanks!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Modeling the ownership of a group
March 07, 2009, 03:22:41 am
http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Localisation

msgcat *.po | msgfmt -vo civicrm.mo -

And I either use a text editor or lokalize to change the texts.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Modeling the ownership of a group

This forum was archived on 2017-11-26.