bat_api.module in Booking and Availability Management API 8
File
bat_api.module
View source
<?php
function bat_api_merge_non_blocking_events($events) {
$prev_id = FALSE;
foreach ($events as $id => $event) {
if ($prev_id !== FALSE && isset($event['rendering']) && $event['rendering'] == 'background' && !$event['blocking']) {
$last_event = $events[$prev_id];
if (isset($last_event['rendering']) && $last_event['rendering'] == 'background' && !$last_event['blocking']) {
if ($last_event['resourceId'] == $event['resourceId'] && $last_event['title'] == $event['title'] && $last_event['color'] == $event['color']) {
$events[$prev_id]['end'] = $event['end'];
unset($events[$id]);
continue;
}
}
}
$prev_id = $id;
}
return $events;
}