This commit is contained in:
2016-06-28 17:21:56 +10:00
parent d6619aa5ee
commit ecaa11d70d

View File

@@ -411,7 +411,6 @@ function booking_rooms_view_form($node, &$form_state, $location_id) {
global $event;
$rows = array();
$form = array();
$prefix = t("<h2>Room Allocations for !room</h2>", array('!room' => $location_description->booking_roomlocation_descrip));
//verify that $location_id is a number
if (! preg_match('/^[0-9]+$/', $location_id)) {
@@ -426,7 +425,8 @@ function booking_rooms_view_form($node, &$form_state, $location_id) {
$location_description = db_query("SELECT booking_roomlocation_descrip FROM {booking_room_locations} where lid = :id",
array(':id' => $location_id))
->fetchObject();
//use the query result to include a human friendly group name
$prefix = t("<h2>Room Allocations for !room</h2>", array('!room' => $location_description->booking_roomlocation_descrip));
//query for room definitions
$room_query = db_query("SELECT * FROM {booking_room_definition} WHERE booking_room_location_id = :lid ORDER BY booking_room_number",
array(':lid' => $location_id));
@@ -506,7 +506,7 @@ function booking_rooms_view_form($node, &$form_state, $location_id) {
for ($i = 0; $i < $data->booking_room_doublebeds; $i++) {
$new_row = _booking_clone_array($default_row);
$new_row['booking_room_doublebed_p1'] = _booking_rooms_view_formatperson($attendees, (!empty($existing_beds[2][$j])) ? $existing_beds[2][$j++] : 0);
$new_row['booking_room_doublebed_p2'] = _booking_rooms_view_formatperson($attendees, (!empty($existing_beds[2][$j])) ? $existing_beds[2][$j++] : 0);
$new_row['booking_room_doublebed_p2'] = _booking_rooms_view_formatperson($attendees, (!empty($existing_beds[2][$j])) ? $existing_beds[2][$j++] : 0);
$rows[] = array(
'data' => $new_row,
);
@@ -518,7 +518,7 @@ function booking_rooms_view_form($node, &$form_state, $location_id) {
for ($i = 1; $i <= $data->booking_room_queenbeds; $i++) {
$new_row = _booking_clone_array($default_row);
$new_row['booking_room_queenbed_p1'] = _booking_rooms_view_formatperson($attendees, (!empty($existing_beds[3][$j])) ? $existing_beds[3][$j++] : 0);
$new_row['booking_room_queenbed_p2'] = _booking_rooms_view_formatperson($attendees, (!empty($existing_beds[3][$j])) ? $existing_beds[3][$j++] : 0);
$new_row['booking_room_queenbed_p2'] = _booking_rooms_view_formatperson($attendees, (!empty($existing_beds[3][$j])) ? $existing_beds[3][$j++] : 0);
$rows[] = array(
'data' => $new_row,
);
@@ -558,8 +558,7 @@ function _booking_rooms_view_formatperson(&$attendees, $nid) {
$output = "Empty";
if ($nid > 0 && !empty($attendees[$nid]))
{
if ($nid > 0 && !empty($attendees[$nid])) {
$output = $attendees[$nid]->booking_firstname . " " . $attendees[$nid]->booking_lastname;
}