| 1 |
<?php |
<?php |
| 2 |
// $Id: volunteer.module,v 1.51 2005/12/31 00:28:22 killes Exp $ |
// $Id: volunteer.module,v 1.52 2005/12/31 00:44:51 killes Exp $ |
| 3 |
|
|
| 4 |
|
|
| 5 |
/** |
/** |
| 81 |
$profile = crm_uf_get_profile_fields($id, TRUE); |
$profile = crm_uf_get_profile_fields($id, TRUE); |
| 82 |
$has_correct_email = FALSE; |
$has_correct_email = FALSE; |
| 83 |
foreach($profile as $field) { |
foreach($profile as $field) { |
| 84 |
if ($field['name'] == 'email') { |
if (strpos($field['name'], 'email-') === 0) { |
| 85 |
$email_exists = TRUE; |
$email_exists = TRUE; |
| 86 |
if ($field['is_required'] == 1) { |
if ($field['is_required'] == 1) { |
| 87 |
$has_correct_email = TRUE; |
$has_correct_email = TRUE; |
| 95 |
} |
} |
| 96 |
if ($email_exists) { |
if ($email_exists) { |
| 97 |
if ($correct_email_exists) { |
if ($correct_email_exists) { |
| 98 |
$group_form .= form_select(t('CiviCRM profile form for volunteers'), 'volunteer_form', variable_get('volunteer_form', ''), $forms, t('Select a CiviCRM Profile form for volunteers. Users will fill out required fields in this form when volunteering for an event. You can <a href="%url">add</a> a volunteer specific profile. The profile needs at least an email field and it needs to be set to "Required", "Display in Registration Form", and "Active".', array('%url' => url('civicrm/admin/uf/group'))), 0, FALSE, TRUE); |
$group_form .= form_select(t('CiviCRM profile form for volunteers'), 'volunteer_form', variable_get('volunteer_form', ''), $forms, t('Select a CiviCRM Profile form for volunteers. Users will fill out required fields in this form when volunteering for an event. You can <a href="%url">add</a> a volunteer specific profile. The profile needs at least an email field and it needs to be set to "Required" and "Active".', array('%url' => url('civicrm/admin/uf/group'))), 0, FALSE, TRUE); |
| 99 |
} |
} |
| 100 |
else { |
else { |
| 101 |
drupal_set_message(t('You need to <a href="%url">define</a> a CiviCRM profile for use with the volunteer module. The profile needs at least an email field and it needs to be set to "Required", "Display in Registration Form", and "Active". A profile with an email field could be found, but it does not have the correct settings. ', array('%url' => url('civicrm/admin/uf/group'))), 'error'); |
drupal_set_message(t('You need to <a href="%url">define</a> a CiviCRM profile for use with the volunteer module. The profile needs at least an email field and it needs to be set to "Required" and "Active". A profile with an email field could be found, but it does not have the correct settings. ', array('%url' => url('civicrm/admin/uf/group'))), 'error'); |
| 102 |
} |
} |
| 103 |
} |
} |
| 104 |
else { |
else { |
| 105 |
drupal_set_message(t('You need to <a href="%url">define</a> a CiviCRM profile for use with the volunteer module. The profile needs at least an email field and it needs to be set to "Required", "Display in Registration Form", and "Active". No profile with an email field could be found.', array('%url' => url('civicrm/admin/uf/group'))), 'error'); |
drupal_set_message(t('You need to <a href="%url">define</a> a CiviCRM profile for use with the volunteer module. The profile needs at least an email field and it needs to be set to "Required" and "Active". No profile with an email field could be found.', array('%url' => url('civicrm/admin/uf/group'))), 'error'); |
| 106 |
} |
} |
| 107 |
} |
} |
| 108 |
else { |
else { |
| 109 |
drupal_set_message(t('You need to <a href="%url">define</a> a CiviCRM profile for use with the volunteer module. The profile needs at least an email field and it needs to be set to "Required", "Display in Registration Form", and "Active".', array('%url' => url('civicrm/admin/uf/group'))), 'error'); |
drupal_set_message(t('You need to <a href="%url">define</a> a CiviCRM profile for use with the volunteer module. The profile needs at least an email field and it needs to be set to "Required" and "Active".', array('%url' => url('civicrm/admin/uf/group'))), 'error'); |
| 110 |
} |
} |
| 111 |
$output .= form_group(t('Contact Settings'), $group_form); |
$output .= form_group(t('Contact Settings'), $group_form); |
| 112 |
} |
} |
| 430 |
db_set_active('civicrm'); |
db_set_active('civicrm'); |
| 431 |
$title = crm_uf_get_profile_title(variable_get('volunteer_form', '')); |
$title = crm_uf_get_profile_title(variable_get('volunteer_form', '')); |
| 432 |
db_set_active(); |
db_set_active(); |
|
|
|
| 433 |
if ( $user->uid ) { |
if ( $user->uid ) { |
| 434 |
db_set_active('civicrm'); |
db_set_active('civicrm'); |
| 435 |
$userID = crm_uf_get_match_id( $user->uid ); |
$userID = crm_uf_get_match_id( $user->uid ); |