Use database for room description instead of constant array lookup
This commit is contained in:
@@ -58,7 +58,10 @@ function booking_rooms_allocate_test_form($node, &$form_state, $location_id) {
|
||||
$room_mapping = $query->execute()->fetchAllAssoc('booking_nodeid');
|
||||
|
||||
//query for room definitions
|
||||
$room_query = db_query("SELECT * FROM {booking_room_definition} WHERE booking_room_location_id = :lid ORDER BY CAST(booking_room_number as SIGNED INTEGER) ASC",
|
||||
$room_query = db_query("SELECT r.*, l.* FROM {booking_room_definition} r " .
|
||||
"INNER JOIN {booking_room_locations} l on r.booking_room_location_id = l.lid " .
|
||||
"WHERE booking_room_location_id = :lid " .
|
||||
"ORDER BY CAST(booking_room_number as SIGNED INTEGER) ASC",
|
||||
array(':lid' => $location_id));
|
||||
|
||||
//define the table header
|
||||
@@ -116,7 +119,8 @@ function booking_rooms_allocate_test_form($node, &$form_state, $location_id) {
|
||||
|
||||
//create a row that contains just the room location and number and the custom css id for a separating line between the rooms
|
||||
$new_row = _booking_clone_array($default_row);
|
||||
$new_row['booking_room_location'] = _booking_room_location_lookup($data->booking_room_location_id);
|
||||
//$new_row['booking_room_location'] = _booking_room_location_lookup($data->booking_room_location_id);
|
||||
$new_row['booking_room_location'] = $data->booking_roomlocation_descrip;
|
||||
$new_row['booking_room_number'] = $data->booking_room_number;
|
||||
$form['rooms']['#rows'][$counter++] = array(
|
||||
'data' => $new_row,
|
||||
|
Reference in New Issue
Block a user