comments updated

This commit is contained in:
2014-06-25 23:04:47 +10:00
parent 473a432944
commit a61520b72d

View File

@@ -973,16 +973,16 @@ function booking_rooms_allocate_form_submit($form, &$form_state) {
array('!room' => $room, '!index' => $index, '!person' => $previous_nid));
watchdog('booking', $message);
drupal_set_message($message);
//look for an exact match,
//in case this person has moved to a different bed type during this form submission
db_delete('booking_room_mapping')
->condition('booking_eventid', $event->eid)
->condition('booking_nodeid', $previous_nid)
->condition('booking_room_bedtype', $type_id)
->condition('booking_roomid', $room)
->execute();
}
//if this person didn't previously have a room/bed mapping
if (empty($room_mapping[$nid]))
{
@@ -1011,6 +1011,8 @@ function booking_rooms_allocate_form_submit($form, &$form_state) {
))
->execute();
}
//this person has already been inserted during this form submission
//so don't add them in twice
else
{
$message .= t(' Except this person already exists.');
@@ -1040,7 +1042,6 @@ function booking_rooms_allocate_form_submit($form, &$form_state) {
->condition('booking_eventid', $event->eid)
->condition('booking_nodeid', $nid)
->execute();
}
//this person previously had a room mapping but to a different bed type in the same room
elseif ((!empty($room_mapping[$nid])) && $room_mapping[$nid]->booking_room_bedtype != $type_id)