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) »
  • where to start with new/extended functionality?
Pages: [1] 2

Author Topic: where to start with new/extended functionality?  (Read 3224 times)

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
where to start with new/extended functionality?
July 31, 2009, 07:59:42 am
We are using Drupal and CiviCRM for a management/sales environment that focuses on basketball. This means that most relations are season based. So it is not enough to have a coach <-> team relation, but it also has to say in which season this relation is established.

My understanding (for now) is that I have to extend the relations part so that the user can choose a season when creating the relation.

Questions:
1) Is this kind of thinking going the right way? If not, what would you suggest?
2) How would you start implementing such a solution?

Thanks in advance.

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: where to start with new/extended functionality?
July 31, 2009, 08:11:08 am
You can create custom fields for relationships. That might be sufficient for your needs without having to extend or hack.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: where to start with new/extended functionality?
July 31, 2009, 10:07:35 am
Quote from: lcdweb on July 31, 2009, 08:11:08 am
You can create custom fields for relationships. That might be sufficient for your needs without having to extend or hack.
thanks for the hint. I think I'm a bit smarter now, but I also have the next question:

In the standard CiviCRM there are 3 contact types: Organizations, households, and individuals. The household is not really necessary for our purposes, but what we would need is a concept of teams to model things like:

Organisation 1:n Teams 1:n Coaches

Then I could configure the relation between a team and a coach to include a season as well as position description and other stuff.

How would I do that? Or is there a way how I can do this with the existing contact types?

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: where to start with new/extended functionality?
July 31, 2009, 03:42:59 pm
So why not make Teams be Organisations - and on relationships you can set an 'end date' which would be the end of season.
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

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: where to start with new/extended functionality?
July 31, 2009, 06:30:01 pm
Quote from: peterd on July 31, 2009, 03:42:59 pm
So why not make Teams be Organisations - and on relationships you can set an 'end date' which would be the end of season.
I guess this will sound like a total newbie question: How do I make a team an organization (that belongs to a club that is also an organization) and at the same time define a relationship so that a coach can only be a assigned to a team and not a club directly?

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: where to start with new/extended functionality?
July 31, 2009, 06:42:09 pm
A team can be an Org - it can have a Membership to another Org.
The coach is an individual who has a relationship of a particular type to a particular Org which happens to be the Team. Should work once you get familiar with the system.
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

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: where to start with new/extended functionality?
August 01, 2009, 03:49:05 am
When you make a relationship you can put start and end dates, why not do that?

So the relationship would be coach of/coached by.

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: where to start with new/extended functionality?
August 17, 2009, 12:40:07 pm
Quote from: peterd on July 31, 2009, 06:42:09 pm
A team can be an Org - it can have a Membership to another Org.
The coach is an individual who has a relationship of a particular type to a particular Org which happens to be the Team. Should work once you get familiar with the system.
I don't quite understand your answer: Teams are not organisations (at least not in our "model of a basketball world"). Multiple teams (like jun. boys, sen. boys, jun. girls, etc.) belong to one organization (e.g. "Foobar High School"). The coach is not associated to the high school directly, but to a particular team (in a particular season).

So, how do I create a (civi) content type "team"? And then: How can I set up a relationship so that it can only relate a coach to a team, but not to another content type (namely "organization")? I don't want to have a relations between (civi) individual (= coach) and (civi) organisation cause then the user could assign coaches directly to the high school.

And can you give me some hints (links) how I can make myself familiar with this topic in terms of CiviCRM? I don't seem to be able to find any good documentation on this. Maybe I'm just googling for the wrong stuff ... ?

As for the question why we just don't take start and end date: Because it's a pain to select this every time. We are not interested in collecting information with the granularity down to the specific day. We just want to store the relation on a seasonal basis.

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: where to start with new/extended functionality?
August 17, 2009, 01:06:15 pm
Perhaps you need to flesh out your use cases more so we don't try sending you up the wrong tree. A team can be thought of as a cluster of individuals sharing a similar characteristic which could be achieved through various combinations of the following
- participation at a particular event/venue/time (via Events and/or Custom Data)
- individual relationships to another individual (coach) or organisation (team) [as in an 'organisation' of people, not a 'registered company']

Eg, the Junior Orange team can be thought of as an Organisation that is related to its school (another organisation) while Coach X is an individual with a relationship to the Junior Orange team for the Spring Season 2009.

Not sure I have grasped what 'outcome' you are looking for. How are you going to be making use of this data once you have 'mapped' it?
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

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: where to start with new/extended functionality?
August 17, 2009, 01:23:28 pm
Quote from: peterd on August 17, 2009, 01:06:15 pm
Perhaps you need to flesh out your use cases more so we don't try sending you up the wrong tree. A team can be thought of as a cluster of individuals sharing a similar characteristic which could be achieved through various combinations of the following
- participation at a particular event/venue/time (via Events and/or Custom Data)
- individual relationships to another individual (coach) or organisation (team) [as in an 'organisation' of people, not a 'registered company']

Eg, the Junior Orange team can be thought of as an Organisation that is related to its school (another organisation) while Coach X is an individual with a relationship to the Junior Orange team for the Spring Season 2009.

Not sure I have grasped what 'outcome' you are looking for. How are you going to be making use of this data once you have 'mapped' it?
I'm not sure whether this is the answer that you aimed at, but I'll give it a try ...

We are a company selling basketball software. We mostly sell this software directly to coaches. In terms of teams, we are not interested in the players, so we don't need to model them in our CRM.

So let's assume the following example again.

entities:
1) Orange High School
  • civi content type: organization (right?)
2) Orange High School Jun. Team
  • civi content type: ?? (organization?)
3) Coach Joe Smith
  • civi content type: individual (right?)

Relations:
1) team -> (belongs to) -> high school: Orange High School Jun. Team belongs to Orange High School
2) coach -> (coaches) -> team: Joe Smith coaches the Orange High School Jun. Team
[the fact that Joe Smith "works" for the Orange High School should not be stored directly, but derived from the two relations]

Is this any more helpful to help me out with my question?

How can I get this working in CiviCRM? If I make the team of civi type "organization" too, how can I assure coaches cannot have a direct relation with the high school, but only with the team? I can only create a relation from content type A to content type B. Or is there a way how to select a subgroup of the entities?

It's really simple in the "normal world", but I really can't understand how I should abstract this into the "CiviCRM world" with just 3 content types. :(

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: where to start with new/extended functionality?
August 17, 2009, 01:30:28 pm
Have you given the book a good read? http://en.flossmanuals.net/civicrm
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

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: where to start with new/extended functionality?
August 17, 2009, 01:45:35 pm
Quote from: peterd on August 17, 2009, 01:30:28 pm
Have you given the book a good read? http://en.flossmanuals.net/civicrm
Yes, I looked through it a couple of times, but I still didn't get the basic concept of what exactly I should be looking at and how to transform "common database models" to the CiviCRM idea. :( Whether I have to change my concept to fit the CiviCRM idea, I'm ok, I have to change/extend CiviCRM ... ?

Now that I posted what I want to do, can you tell me what the concepts of CiviCRM are that I should look at?

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: where to start with new/extended functionality?
August 17, 2009, 04:29:38 pm

ok, so here's my 2 cents:

1. contact_type !=  content_type

2. sub types of contact_types are coming in the next release (3.1) thanx to the good folks at alpha international

3. however you can still do a fair amount with the current data model and hooks. In my school project (http://svn.civicrm.org/sfschool/trunk/), i've created a contact sub type field as a custom field and do quite a few things with it including show/hide certain tabs based on contact sub type. You can also add validation hooks to make sure things relationships between a "coach" and a "team" are with the right contacts (based on the subtype)

4. finally, if you want to use a "common database model" you might want to stick to using sql directly. Any software introduces its own abstractions for its needs

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

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: where to start with new/extended functionality?
August 17, 2009, 04:44:20 pm
yes, sorry. Contact type, not content type. Too much Drupal lately. ;)

So you mean that if I wait for v3, CiviCRM will offer me a possibility so that I can extend the 3 standard types with "my own" and thus be able to have a different type for "team" than I have for "organization" (school). This way I can also define different relationships for team and organization?

If I don't want to wait for it, I should look into what I can do with hooks, right?

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: where to start with new/extended functionality?
August 17, 2009, 04:49:56 pm

v3.1 at the earliest which is not due till close to end of year

yes, check the svn link below to see how i use subtype a bit. I have subtypes for Parent, Staff, Student etc

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

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • where to start with new/extended functionality?

This forum was archived on 2017-11-26.