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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Event Registration - Limit to Household members only
Pages: [1]

Author Topic: Event Registration - Limit to Household members only  (Read 862 times)

kathkeating

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.0.4
  • CMS version: Joomla 1.6.1 +
  • MySQL version: 5
  • PHP version: 5
Event Registration - Limit to Household members only
November 13, 2011, 01:33:07 pm
I've spent several hours pouring through the documentation and the forums looking for examples of how to implement the following.  I have not been able to find a solution, but it seems like a basic feature many sites would want. I'm hoping one of you could point me to an example to work from.

I want to restrict the logged in CiviCRM user to be allowed to only register members of their Household for an Event.  My registration form right now has First and Last name as input fields on the participant profile. 

I understand that there is an auto-complete feature that I might be able to use which will look for possible matches as they start to type into the First Name field.   I've come to a deadend researching this option due to the following roadblocks:

1) This auto-complete feature seems to use an Ajax interface, but I can't find any reference for how to use/access this Ajax interface from a CiviCRM-Joomla install.  Where is the CivicCRM-Joomla ajax interface documented or located in the installed code?

2) Once I find the ajax interface, how do I query through it to return only members of the existing user's household. I see some examples of how to query organizations, but none on user's household contacts.  Is there any documentation for this type of query?

Any help pointing me to the proper documentation/examples would be appreciated. This seems like a very basic feature that many sites would want.

Here's my platform info:
- Joomla 1.6.1
- CiviCRM 4.0.4


Thanks, Kath
« Last Edit: November 13, 2011, 01:35:26 pm by kathkeating »

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Event Registration - Limit to Household members only
November 14, 2011, 04:31:26 am
Unfortunately, that autocomplete doesn't use yet the api, so not quite sure where it is (use firebug net tab to find out)

If you write a module, you can implement this hook to limit what's available in the list:
http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmcontactListQuery

This is an example of another way of doing it (using the api this time:)
http://civicrm.org/blogs/xavier/how-customise-contact-reference-custom-field

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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Event Registration - Limit to Household members only

This forum was archived on 2017-11-26.