diff --git a/booking.rooms.inc b/booking.rooms.inc index 7371370..d5ea3f7 100644 --- a/booking.rooms.inc +++ b/booking.rooms.inc @@ -108,6 +108,7 @@ function booking_roomallocations_view_summary() { /** * Function for manually assigning study group sessions for a person + * @see http://drupal.stackexchange.com/questions/10112/dynamic-select-list-in-the-form-dependent-dropdown */ function booking_room_edit_form($node, &$form_state, $nid) { global $event; @@ -279,6 +280,8 @@ function _booking_get_roomedit_bedtype_options($location_id, $room_num) { * Validate the submission to update allocated room and bed for a person */ function booking_room_edit_form_validate($form, &$form_state) { + //TODO: turn this into a generalised helper function, and use it for validating booking_rooms_allocate_form() also + global $event; $values = $form_state['input']; $bed_inputs = array( @@ -295,8 +298,8 @@ function booking_room_edit_form_validate($form, &$form_state) { $mappings = db_query("SELECT count(*) as num FROM {booking_room_mapping} WHERE booking_eventid = :eid AND booking_roomid = :rid AND booking_room_bedtype = :type", array(':eid' => $event->eid, ':rid' => $details->rid, ':type' => $values['booking_room_bedtype']))->fetchObject(); - watchdog('booking', "
Max beds of type !type for this room:\n@info", - array('!type' => $bed_inputs[$values['booking_room_bedtype']], '@info' => print_r( $mappings, true))); + //watchdog('booking', "
Max beds of type !type for this room:\n@info", + // array('!type' => $bed_inputs[$values['booking_room_bedtype']], '@info' => print_r( $mappings, true))); //make sure the value exists before validating it if (!empty($values['booking_room_bedtype'])) diff --git a/booking.tokens.inc b/booking.tokens.inc index bff676c..9a7b4a1 100644 --- a/booking.tokens.inc +++ b/booking.tokens.inc @@ -562,8 +562,12 @@ function booking_token_info() { ); $info['tokens']['booking']['room-allocation'] = array( 'name' => t('Room Allocation'), - 'description' => t('Listing of room allocated to attendee.') - ); + 'description' => t('Details of room allocated to attendee.') + ); + $info['tokens']['booking']['bed-type'] = array( + 'name' => t('Bed Type'), + 'description' => t('The bed type allocated to attendee.') + ); $info['tokens']['booking']['travel-link'] = array( 'name' => t('Travel form Link'), 'description' => t('Link to the person\'s travel form.') @@ -686,6 +690,7 @@ function booking_define_personspecific_tokens($node) $tokens['travel-summary'] = _booking_travelform_email_summary($node); $tokens['studygroup-summary'] = _booking_studygroup_email_summary($node); $tokens['room-allocation'] = _booking_room_email_summary($node); + $tokens['bed-type'] = _booking_room_bedtype_lookup($node->booking_room_bedtype); return $tokens; } \ No newline at end of file