Add travel info to booking node view

This commit is contained in:
2014-02-28 17:17:18 +11:00
parent 2a773cee4d
commit 397448d47c
6 changed files with 55 additions and 20 deletions

View File

@@ -525,8 +525,10 @@ function booking_studygroups_calculate() {
$age = _booking_get_age_years($working_list[$person->booking_node_id]->booking_dob);
booking_assign_attendee_group($person->booking_node_id, $person->booking_session_id, 'male', $age, $working_list, $session_count);
//get any potential spouse info
//get any potential spouse or boyfriend/girlfriend
$spouse_id = $working_list[$person->booking_node_id]->booking_partner_id;
$bf_gf_id = $working_list[$person->booking_node_id]->booking_bf_gf_nid;
if ($spouse_id > 0)
{
drupal_set_message(t('Spouse with id !id assigned to session !session (currently with !num people).',
@@ -537,9 +539,16 @@ function booking_studygroups_calculate() {
$age = _booking_get_age_years($working_list[$spouse_id]->booking_dob);
booking_assign_attendee_group($spouse_id, $person->booking_session_id, 'female', $age, $working_list, $session_count);
}
//TODO: search for a boyfriend/girlfriend
elseif ($bf_gf_id > 0)
{
drupal_set_message(t('BF/GF with id !id assigned to session !session (currently with !num people).',
array('!id' => $spouse_id, '!session' => $person->booking_session_id,
'!num' => $session_count[$person->booking_session_id]['total'])
));
//allocate the boyfriend/girlfriend to the same session
booking_assign_attendee_group($bf_gf_id, $person->booking_session_id, $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);
}
}
}
@@ -658,7 +667,8 @@ function booking_studygroups_calculate() {
foreach($working_list as $person)
{
//watchdog('booking', "<pre>Working list person:\n@info</pre>", array('@info' => print_r( $person, true)));
//TODO: a check to update existing records rather than inserting new one
// if already in $group_mapping then just run an update query here