fix lane rendering
This commit is contained in:
parent
440ed74cd7
commit
4effb7e59f
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Engelsystem;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Represents a single lane in a shifts calendar.
|
||||
*/
|
||||
|
@ -38,6 +40,7 @@ class ShiftCalendarLane
|
|||
* Returns true on success.
|
||||
*
|
||||
* @param array $shift The shift to add
|
||||
* @throws Exception if the shift doesn't fit into the lane.
|
||||
*/
|
||||
public function addShift($shift)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace Engelsystem;
|
||||
|
||||
use Exception;
|
||||
|
||||
class ShiftCalendarRenderer
|
||||
{
|
||||
|
||||
|
@ -93,9 +95,9 @@ class ShiftCalendarRenderer
|
|||
$shift_added = false;
|
||||
foreach ($lanes[$room_id] as $lane) {
|
||||
/** @var ShiftCalendarLane $lane */
|
||||
try {
|
||||
if($lane->shiftFits($shift)) {
|
||||
$lane->addShift($shift);
|
||||
} catch (Exception $e) {
|
||||
$shift_added = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue