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) »
  • Relate a group to an event
Pages: [1]

Author Topic: Relate a group to an event  (Read 403 times)

lscalado

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal
  • MySQL version: 5.5
  • PHP version: 4.2
Relate a group to an event
October 15, 2012, 02:47:41 am
Hi,

Have any way(which don't replacing core) to relate group (preferably drupal 7 organic group, but civicrm group is ok) for an event?

I searching for this on Google and here on CiviCRM forum but no success. Any direction on this will be great!

Thanks!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Relate a group to an event
October 15, 2012, 05:29:06 am
What do you mean by "relate" a group to an event?

I have written a small Drupal module that restricts registration for CiviCRM events to selected groups--this is a fairly simple task.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

lscalado

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal
  • MySQL version: 5.5
  • PHP version: 4.2
Re: Relate a group to an event
October 15, 2012, 07:13:56 am
This is scenario I talk about:
I have a group called Technology which have a tab events/meetings this events and meetings are CiviCRM events. 
I need tell event on event edit screen to which group it belongs. About "restricts registration for CiviCRM events to selected groups" it's good have how you show me a sample?

About this question I started this topic I done this with Custom Fields and a small Drupal module which load groups from og.

Thanks.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Relate a group to an event
October 15, 2012, 07:35:46 am
I made a custom field for Events and populated it with a list of Groups. I used hook_restrict_civicrm_validate to check registrations, i.e.

Code: [Select]
function civievent_restrict_civicrm_validate( $formName, &$fields, &$files, &$form ) {
  if ($formName == 'CRM_Event_Form_Registration_Register') {
    if (civievent_restrict_event_permission( $form->_values['event']['id'], $fields['email-5'] )) {
      $form->_submitValues['title']=$form->_values['event']['title'];
      $form->_submitValues['contact_email']=$user->mail;
      civievent_restrict_sendmail($form->_submitValues);
      drupal_goto('civicrm/event/register/restricted');
    }
  }
  return true;
}

Then the civievent_restrict_event_permission function checks (using whatever logic is necessary) if the person in question is allowed to register. This module uses the email but you could also use the logged in user if you require them to login before registering.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Relate a group to an event

This forum was archived on 2017-11-26.