Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ public function executeCommand(): void
case "ilbookingreservationsgui":
$this->showPoolSelector("ilbookingreservationsgui");
$this->setSubTabs("reservations");
$res_gui = new ilBookingReservationsGUI($this->pool, $this->help, $this->obj_id);
$res_gui = new ilBookingReservationsGUI(
$this->pool,
$this->help,
ilObject::_lookupType($this->obj_id) !== 'crs' ? $this->obj_id : null
);
$this->ctrl->forwardCommand($res_gui);
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ilBookingReservationsGUI
protected array $raw_post_data;
protected \ILIAS\BookingManager\StandardGUIRequest $book_request;
protected ilBookingHelpAdapter $help;
protected int $context_obj_id;
protected ?int $context_obj_id;
protected ilCtrl $ctrl;
protected ilGlobalTemplateInterface $tpl;
protected ilLanguage $lng;
Expand All @@ -43,11 +43,8 @@ class ilBookingReservationsGUI
protected string $reservation_id; // see BookingReservationDBRepo, obj_user_(slot)_context
protected int $booked_user;

public function __construct(
ilObjBookingPool $pool,
ilBookingHelpAdapter $help,
int $context_obj_id = 0
) {
public function __construct(ilObjBookingPool $pool, ilBookingHelpAdapter $help, ?int $context_obj_id = null)
{
global $DIC;

$this->tpl = $DIC->ui()->mainTemplate();
Expand Down Expand Up @@ -161,7 +158,7 @@ protected function getReservationsTable(?string $reservation_id = null): ilBooki
$show_all,
$filter,
$reservation_id,
$this->context_obj_id > 0 ? [$this->context_obj_id] : null
$this->context_obj_id !== null ? [$this->context_obj_id] : null
);
}

Expand Down
Loading