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 CiviEvent (Moderator: Yashodha Chaku) »
  • Sponsors and Hosts for Events
Pages: [1]

Author Topic: Sponsors and Hosts for Events  (Read 867 times)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Sponsors and Hosts for Events
May 27, 2010, 06:28:38 am
I'm trying to figure out the best way to set up our fund raising dinners as events and have a couple of questions:

1. The events usually have Sponsors - these are folks who pay for, say, a table at the dinner (so that other attendees can come free of charge - our events are meant to be free to participants).  They may or may not also attend the event themselves.  How can we set up contributions or fees only for a Sponsor?  Can this be done with custom event fields or do we need to use separate contributions?  We need to tie sponsors back to events so we can do reporting on them.

2. Events also have Hosts - a Host basically promises to bring X number of people to the event (like hosting a table means they will do the legwork to get 8 people on that table).  Hosts aren't necessarily Sponsors, but they may be.  We need Participants linked to Hosts so we can later run reports to see if the Participants for a specific Host actually attended the event and/or became a contributor because of the event, etc.  Is there a way we can have a custom Name lookup field in the event registration form (something like "This Participant is Hosted By" ...)?  And then include that in reports, etc.

Thanks.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Sponsors and Hosts for Events
May 27, 2010, 04:52:50 pm
Event Sponsors
-----------------
I think an approach that might work is to create a Price Set with a single required checkbox-type Price Field that has 2 options:
[  ] I am coming (free)
[  ] I am sponsoring ($120.00)

... and use that price set as the fee structure for the event. Folks who check the first box can register for free. Folks who check the second box will be charged the sponsorship fee (if online registration). You can play with other variations of this using two price set fields - one to say person is coming, and an Amount / text field that allows sponsor to put in a dollar amount (or a set of radio buttons for different sponsorship levels).

The one "drawback" is that everyone will show up as a Participant - even sponsors who don't check the "I am coming" box. If this is a problem - you could potentially address it by adding a new "not counted" Participant status (e.g. "Not Attending") and using a hook to set status to that value for folks who don't check the box. If you do this, probably also want to add a "Sponsor" participant role and set that as well.

Event Hosts
-------------
You can create a custom field set - used for = Participant. Then create a "contact reference" custom field -> "Select Your Host". Since you probably don't want to expose all contacts in your DB to this auto-complete lookup, you will need to use a simple, well-documented hook to filter the list (most easily to a group of contacts who you've identified as hosts - can be a smart group which actually finds all contacts with Role = Host).

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmcontactListQuery

If you haven't checked out the new "Extending CiviCRM" chapter in the online book - probably will be helpful to give context etc.:
http://en.flossmanuals.net/CiviCRM/DevelopIntro
 
Protect your investment in CiviCRM by  becoming a Member!

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Re: Sponsors and Hosts for Events
June 01, 2010, 09:15:02 am
Quote from: Dave Greenberg on May 27, 2010, 04:52:50 pm
Event Hosts
-------------
You can create a custom field set - used for = Participant. Then create a "contact reference" custom field -> "Select Your Host". Since you probably don't want to expose all contacts in your DB to this auto-complete lookup, you will need to use a simple, well-documented hook to filter the list (most easily to a group of contacts who you've identified as hosts - can be a smart group which actually finds all contacts with Role = Host).

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmcontactListQuery


Hey Dave,
First of all, thank you so much for the very detailed and quick response - great support, much appreciated!

I looked into the hook you mentioned for event Hosts and thought I'd note that the wiki doc seems to have an issue.  The wiki states: "your query must return two columns (contact sort_name and contact ID)" and that is what it has in the example query.  However, that seems to have changed or is incorrect.  If I set the query to return only 2 columns (id and sort_name), I get back a list of empty strings (the dropdown has the correct number of lines, but they are all empty, nothing to show).  It looks like we actually need 3 columns: id, sort_name, and "data".  The data column can be any string to show in the list (I used name plus email) and the alias must be called "data".  Then the list gets populated with the data field.  Thought I'd mention this in case some one wants to update the wiki page (for newbies like me, it was a bit difficult to figure out).

Here is my updated query:
Code: [Select]
$query = "SELECT c.sort_name, CONCAT(c.first_name,' ',c.last_name,'::',ce.email) as data, c.id
FROM civicrm_contact c, civicrm_group_contact cg
WHERE c.sort_name LIKE '$name%'
AND   cg.group_id IN ( 1 )
AND   cg.contact_id = c.id
AND   cg.status = 'Added'
ORDER BY c.sort_name ";

Also, a follow up question on this.  Once I have the "Hosted By" contact saved in the participant record and I'm viewing that record, is there a way I can have that custom field have a hyperlink to the hosted contact's information page?  Or, better yet, to a report that shows all the participants under that host?  What would I need to modify to make that work?  Not a critical item as I can just set up a new report, but thought I'd ask in case it was straightforward.


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Sponsors and Hosts for Events
June 01, 2010, 10:25:21 am
Thx for catching the error in the documentation - I've fixed it. The hook actually only requires two columns to be returned - 'data' (an alias for whatever you want to display in the dropdown), and 'id'. However your usage is perfectly valid since you want to display email address as well.

When viewing a Participant record, the "Hosted By" contact reference custom field SHOULD display as the contact name with a link to view that contact.

With regard to reporting - I think the latest version (not sure if 3.1 or 3.2) of Participant detail report does include custom fields. However, I'm not sure if a contact reference field displays just the contact.id or the sort name. I would try that out (both on your 3.1 install and on 3.2 sandbox if needed). Also check out "Find Participants" -> Export to see how it spits out.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Sponsors and Hosts for Events

This forum was archived on 2017-11-26.