bugfix
This commit is contained in:
@@ -411,7 +411,6 @@ function booking_rooms_view_form($node, &$form_state, $location_id) {
|
|||||||
global $event;
|
global $event;
|
||||||
$rows = array();
|
$rows = array();
|
||||||
$form = 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
|
//verify that $location_id is a number
|
||||||
if (! preg_match('/^[0-9]+$/', $location_id)) {
|
if (! preg_match('/^[0-9]+$/', $location_id)) {
|
||||||
@@ -426,11 +425,12 @@ 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",
|
$location_description = db_query("SELECT booking_roomlocation_descrip FROM {booking_room_locations} where lid = :id",
|
||||||
array(':id' => $location_id))
|
array(':id' => $location_id))
|
||||||
->fetchObject();
|
->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
|
//query for room definitions
|
||||||
$room_query = db_query("SELECT * FROM {booking_room_definition} WHERE booking_room_location_id = :lid ORDER BY booking_room_number",
|
$room_query = db_query("SELECT * FROM {booking_room_definition} WHERE booking_room_location_id = :lid ORDER BY booking_room_number",
|
||||||
array(':lid' => $location_id));
|
array(':lid' => $location_id));
|
||||||
|
|
||||||
//query for existing room allocations
|
//query for existing room allocations
|
||||||
$room_mapping_query = db_query("SELECT * FROM {booking_room_mapping} WHERE booking_eventid = :eid",
|
$room_mapping_query = db_query("SELECT * FROM {booking_room_mapping} WHERE booking_eventid = :eid",
|
||||||
array(':eid' => $event->eid));
|
array(':eid' => $event->eid));
|
||||||
@@ -506,7 +506,7 @@ function booking_rooms_view_form($node, &$form_state, $location_id) {
|
|||||||
for ($i = 0; $i < $data->booking_room_doublebeds; $i++) {
|
for ($i = 0; $i < $data->booking_room_doublebeds; $i++) {
|
||||||
$new_row = _booking_clone_array($default_row);
|
$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_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(
|
$rows[] = array(
|
||||||
'data' => $new_row,
|
'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++) {
|
for ($i = 1; $i <= $data->booking_room_queenbeds; $i++) {
|
||||||
$new_row = _booking_clone_array($default_row);
|
$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_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(
|
$rows[] = array(
|
||||||
'data' => $new_row,
|
'data' => $new_row,
|
||||||
);
|
);
|
||||||
@@ -558,8 +558,7 @@ function _booking_rooms_view_formatperson(&$attendees, $nid) {
|
|||||||
|
|
||||||
$output = "Empty";
|
$output = "Empty";
|
||||||
|
|
||||||
if ($nid > 0 && !empty($attendees[$nid]))
|
if ($nid > 0 && !empty($attendees[$nid])) {
|
||||||
{
|
|
||||||
$output = $attendees[$nid]->booking_firstname . " " . $attendees[$nid]->booking_lastname;
|
$output = $attendees[$nid]->booking_firstname . " " . $attendees[$nid]->booking_lastname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user