From d2dc15451885eaa7a0e178ec9483bcddc427e860 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Mon, 27 Jun 2016 11:51:26 +1000 Subject: [PATCH] add room description to room allocation page --- booking.rooms_allocate.inc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/booking.rooms_allocate.inc b/booking.rooms_allocate.inc index fb3d870..d13a5b1 100644 --- a/booking.rooms_allocate.inc +++ b/booking.rooms_allocate.inc @@ -71,6 +71,7 @@ function booking_rooms_allocate_form($node, &$form_state, $location_id) { $header = array ( 'booking_room_location' => array('data' => t('Room Location'), 'field' => 'booking_room_location_id'), 'booking_room_number' => array('data' => t('Room Number')), + 'booking_room_description' => array('data' => t('Room Label')), 'booking_room_singlebed' => array('data' => t('Single Bed')), 'booking_room_doublebed_p1' => array('data' => t('Double Bed Person 1')), 'booking_room_doublebed_p2' => array('data' => t('Double Bed Person 2')), @@ -97,24 +98,21 @@ function booking_rooms_allocate_form($node, &$form_state, $location_id) { $default_row = array(); $default_row['booking_room_location'] = ""; $default_row['booking_room_number'] = ""; + $default_row['booking_room_description'] = ""; $default_row['booking_room_singlebed'] = ""; $default_row['booking_room_doublebed_p1'] = ""; $default_row['booking_room_doublebed_p2'] = ""; $default_row['booking_room_queenbed_p1'] = ""; $default_row['booking_room_queenbed_p2'] = ""; - foreach ($room_query as $data) - { + foreach ($room_query as $data) { //create an array representing the existing bed mappings for this room $existing_beds = array(); - for ($i = 1; $i <= 3; $i++) - { - foreach ($room_mapping as $mapping) - { + for ($i = 1; $i <= 3; $i++) { + foreach ($room_mapping as $mapping) { //check that the room id in the mapping table matches the room that we're currently adding to the table //and also the bed type matches the first dimension in the array - if ($mapping->booking_roomid == $data->rid && $mapping->booking_room_bedtype == $i) - { + if ($mapping->booking_roomid == $data->rid && $mapping->booking_room_bedtype == $i) { $existing_beds[$i][] = $mapping->booking_lastname . ', ' . $mapping->booking_firstname . ' [' . $mapping->booking_nodeid . ']'; } } @@ -125,6 +123,7 @@ function booking_rooms_allocate_form($node, &$form_state, $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; + $new_row['booking_room_description'] = $data->booking_room_description; $form['rooms']['#rows'][$counter++] = array( 'data' => $new_row, 'id' => array("new-group-row"),