Work on bed allocations
This commit is contained in:
@@ -1065,6 +1065,9 @@ function booking_load_query($node_ids = NULL, $fetchAssoc = FALSE)
|
||||
$query->join('booking_price', 'pr', 'p.booking_payment_id = pr.pid');
|
||||
//add travel form info if it exists
|
||||
$query->leftJoin('booking_travel', 't', 'p.nid = t.booking_person_nid');
|
||||
//add room info
|
||||
$query->leftJoin('booking_room_mapping', 'rm', 'p.nid = rm.booking_nodeid');
|
||||
$query->leftJoin('booking_room_definition', 'r', 'rm.booking_roomid = r.rid');
|
||||
|
||||
//add the joins to flatten out study groups into columns
|
||||
if (variable_get('booking_enable_studygroups', 0) == 1)
|
||||
@@ -1089,7 +1092,9 @@ function booking_load_query($node_ids = NULL, $fetchAssoc = FALSE)
|
||||
//add the database fields we always want to retrieve
|
||||
$query->fields('p')
|
||||
->fields('t')
|
||||
->fields('pr', array('booking_price', 'booking_price_descrip','booking_late_price'));
|
||||
->fields('pr', array('booking_price', 'booking_price_descrip','booking_late_price'))
|
||||
->fields('rm', array('booking_roomid', 'booking_room_bedtype'))
|
||||
->fields('r', array('rid','booking_room_location_id', 'booking_room_number'));
|
||||
|
||||
//now add the study group fields if applicable
|
||||
if (variable_get('booking_enable_studygroups', 0) == 1)
|
||||
@@ -1103,8 +1108,6 @@ function booking_load_query($node_ids = NULL, $fetchAssoc = FALSE)
|
||||
//$query->addField('s' . $i, 'booking_is_leader', 'session' . $i . '_leader');
|
||||
//$query->addField('s' . $i, 'booking_is_reserveleader', 'session' . $i . '_reserveleader');
|
||||
//$query->addField('s' . $i, 'booking_is_helper', 'session' . $i . '_helper');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1615,6 +1618,25 @@ function booking_view($node, $view_mode) {
|
||||
$rows[] = array(t('Previous Mission Experience:'), $node->booking_mission_experience_details);
|
||||
}
|
||||
$rows[] = array(t('Temporary UUID:'), $node->booking_tempid);
|
||||
|
||||
//if room allocation is defined, display that
|
||||
if (! empty($node->rid))
|
||||
{
|
||||
$room_rows = array();
|
||||
$room_rows[] = array(t('Room Location'), _booking_room_location_lookup($node->booking_room_location_id));
|
||||
$room_rows[] = array(t('Room Number'), $node->booking_room_number);
|
||||
$room_rows[] = array(t('Bed Type'), _booking_room_bedtype_lookup($node->booking_room_bedtype));
|
||||
|
||||
$node->content['room-heading'] = array(
|
||||
'#markup' => "<h2>Room Details</h2>",
|
||||
'#weight' => 2,
|
||||
);
|
||||
|
||||
$node->content['room-details'] = array(
|
||||
'#markup' => theme('table', array('header' => $header, 'rows' => $room_rows)),
|
||||
'#weight' => 3,
|
||||
);
|
||||
}
|
||||
|
||||
//add the travel info if it has been defined for this attendee
|
||||
if (! empty($node->tid))
|
||||
@@ -1632,12 +1654,12 @@ function booking_view($node, $view_mode) {
|
||||
|
||||
$node->content['travel-heading'] = array(
|
||||
'#markup' => "<h2>Travel Details</h2>",
|
||||
'#weight' => 2,
|
||||
'#weight' => 4,
|
||||
);
|
||||
|
||||
$node->content['travel-details'] = array(
|
||||
'#markup' => theme('table', array('header' => $header, 'rows' => $travel_rows)),
|
||||
'#weight' => 3,
|
||||
'#weight' => 5,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1654,25 +1676,9 @@ function booking_view($node, $view_mode) {
|
||||
|
||||
for ($i = 1; $i <= variable_get('booking_studygroup_count','0'); $i++)
|
||||
{
|
||||
|
||||
//calculate the session references
|
||||
$sessionid = "session" . $i;
|
||||
$roleid = $sessionid . "_role";
|
||||
/*
|
||||
$role = "";
|
||||
|
||||
|
||||
$leaderid = $sessionid . "_leader";
|
||||
$helperid = $sessionid . "_helper";
|
||||
$reserveleaderid = $sessionid . "_reserveleader";
|
||||
|
||||
if ($node->$leaderid == 'Y')
|
||||
$role = "Leader";
|
||||
elseif ($node->$helperid == 'Y')
|
||||
$role = "Helper";
|
||||
elseif ($node->$reserveleaderid == 'Y')
|
||||
$role = "Reserve Leader";
|
||||
*/
|
||||
|
||||
$group_rows[] = array(t('<b>' . $studygroups[$i]->booking_studygroup_descrip . '</b> group number'), $node->$sessionid);
|
||||
$group_rows[] = array(t('Role'), _booking_studygroup_role_lookup($node->$roleid));
|
||||
@@ -1680,12 +1686,12 @@ function booking_view($node, $view_mode) {
|
||||
|
||||
$node->content['group-heading'] = array(
|
||||
'#markup' => "<h2>Study Groups</h2>",
|
||||
'#weight' => 4,
|
||||
'#weight' => 6,
|
||||
);
|
||||
|
||||
$node->content['group-details'] = array(
|
||||
'#markup' => theme('table', array('header' => $header, 'rows' => $group_rows)),
|
||||
'#weight' => 5,
|
||||
'#weight' => 7,
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user