Browse Source

fixed bug when deleting an entity that has associated reservations

4.0.x-roblib
ppound 3 years ago committed by Peter Lindstrom
parent
commit
e50a47f9e4
  1. 4
      src/Controller/CalendarController.php

4
src/Controller/CalendarController.php

@ -234,9 +234,13 @@ class CalendarController extends ControllerBase {
// add in pre/post buffer for setup/takedown (rev 7.x-1.3+)
// - if the slot is part of buffer we add "setup" to class
// - if we don't have admin rights; we also mark it as booked so no one can book in these slots
$preslots = 0;
$postslots = 0;
if(isset($entities[$rid])) {
$category = $categories[$entities[$rid]->$category_field->getString()];
$preslots = $category['prebuffer'] / 30;
$postslots = $category['postbuffer'] / 30;
}
$startkey = array_search($reservations[$rid][$time]['time'], $times);
$endkey = $startkey + $time_slots;
$k = $startkey - $preslots;

Loading…
Cancel
Save