add room description to room allocation page

This commit is contained in:
2016-06-27 11:51:26 +10:00
parent b3b4fef4d2
commit d2dc154518

View File

@@ -71,6 +71,7 @@ function booking_rooms_allocate_form($node, &$form_state, $location_id) {
$header = array ( $header = array (
'booking_room_location' => array('data' => t('Room Location'), 'field' => 'booking_room_location_id'), 'booking_room_location' => array('data' => t('Room Location'), 'field' => 'booking_room_location_id'),
'booking_room_number' => array('data' => t('Room Number')), '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_singlebed' => array('data' => t('Single Bed')),
'booking_room_doublebed_p1' => array('data' => t('Double Bed Person 1')), 'booking_room_doublebed_p1' => array('data' => t('Double Bed Person 1')),
'booking_room_doublebed_p2' => array('data' => t('Double Bed Person 2')), '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 = array();
$default_row['booking_room_location'] = ""; $default_row['booking_room_location'] = "";
$default_row['booking_room_number'] = ""; $default_row['booking_room_number'] = "";
$default_row['booking_room_description'] = "";
$default_row['booking_room_singlebed'] = ""; $default_row['booking_room_singlebed'] = "";
$default_row['booking_room_doublebed_p1'] = ""; $default_row['booking_room_doublebed_p1'] = "";
$default_row['booking_room_doublebed_p2'] = ""; $default_row['booking_room_doublebed_p2'] = "";
$default_row['booking_room_queenbed_p1'] = ""; $default_row['booking_room_queenbed_p1'] = "";
$default_row['booking_room_queenbed_p2'] = ""; $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 //create an array representing the existing bed mappings for this room
$existing_beds = array(); $existing_beds = array();
for ($i = 1; $i <= 3; $i++) for ($i = 1; $i <= 3; $i++) {
{ foreach ($room_mapping as $mapping) {
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 //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 //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 . ']'; $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'] = _booking_room_location_lookup($data->booking_room_location_id);
$new_row['booking_room_location'] = $data->booking_roomlocation_descrip; $new_row['booking_room_location'] = $data->booking_roomlocation_descrip;
$new_row['booking_room_number'] = $data->booking_room_number; $new_row['booking_room_number'] = $data->booking_room_number;
$new_row['booking_room_description'] = $data->booking_room_description;
$form['rooms']['#rows'][$counter++] = array( $form['rooms']['#rows'][$counter++] = array(
'data' => $new_row, 'data' => $new_row,
'id' => array("new-group-row"), 'id' => array("new-group-row"),