Bugfixes for boyfriend/girlfriend id

This commit is contained in:
2014-02-25 23:19:22 +11:00
parent 1c2a18d1dc
commit 2a773cee4d
3 changed files with 64 additions and 19 deletions

View File

@@ -611,8 +611,10 @@ function booking_studygroups_calculate() {
array('!id' => $it->key(), '!session' => $i, '!num' => $session_count[$i]['total'], '!gender' => $gender, '!age' => $age_type )
));
booking_assign_attendee_group($it->key(), $i, $gender, $age, $working_list, $session_count);
$partner_id = $current->booking_partner_id;
$bf_gf_id = $current->booking_bf_gf_nid;
booking_assign_attendee_group($it->key(), $i, $gender, $age, $working_list, $session_count);
//check if the attendee was married
if ($partner_id > 0)
@@ -621,9 +623,20 @@ function booking_studygroups_calculate() {
drupal_set_message(t('Assigning spouse (id !spouse) of id !id to session !session (currently with !num people).',
array('!id' => $it->key(), '!session' => $i, '!spouse' => $current->booking_partner_id, '!num' => $session_count[$i]['total'])));
booking_assign_attendee_group($partner_id, $i, $gender, $age, $working_list, $session_count);
booking_assign_attendee_group($partner_id, $i, $working_list[$partner_id]->booking_gender == 'M' ? 'male' : 'female',
_booking_get_age_years($working_list[$partner_id]->booking_dob), $working_list, $session_count);
}
//Check for boyfriend/girlfriend
if ($bf_gf_id> 0)
{
//add the spouse to the same session and mark as processed in the temporary attendee list
drupal_set_message(t('Assigning bf/gf (id !spouse) of id !id to session !session (currently with !num people).',
array('!id' => $it->key(), '!session' => $i, '!spouse' => $current->booking_bf_gf_nid, '!num' => $session_count[$i]['total'])));
booking_assign_attendee_group($partner_id, $i, $working_list[$bf_gf_id]->booking_gender == 'M' ? 'male' : 'female',
_booking_get_age_years($working_list[$bf_gf_id]->booking_dob), $working_list, $session_count);
}
}
//move to the next unprocessed attendee in the list