ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilBookingInfoListItemPropertiesAdapter.php
Go to the documentation of this file.
1<?php
2
24{
25 protected \ILIAS\BookingManager\Reservations\ReservationDBRepository $repo;
26
27 public function __construct(
28 ?\ILIAS\BookingManager\Reservations\ReservationDBRepository $repo = null
29 ) {
30 $this->repo = $repo;
31 }
32
33 public function appendProperties(
34 int $obj_id,
35 array $props
36 ): array {
37 $repo = $this->repo;
38 $info = [];
39 foreach ($repo->getCachedContextObjBookingInfo($obj_id) as $item) {
40 $info[$item["pool_id"]]["title"] = ilObject::_lookupTitle($item["pool_id"]);
41 $info[$item["pool_id"]]["object"][$item["object_id"]]["title"] = $item["title"];
42 $info[$item["pool_id"]]["object"][$item["object_id"]]["bookings"][] =
43 ilDatePresentation::formatDate(new ilDate($item["date"], IL_CAL_DATE)) . ", " . $item["slot"] . " (" . $item["counter"] . ")";
44 }
45 foreach ($info as $pool) {
46 $val = "";
47 foreach ($pool["object"] as $o) {
48 $val .= $o["title"] . ": " . implode(", ", $o["bookings"]);
49 }
50 $props[] = array("alert" => false, "property" => $pool["title"], "value" => $val);
51 }
52 return $props;
53 }
54}
const IL_CAL_DATE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS BookingManager Reservations ReservationDBRepository $repo
__construct(?\ILIAS\BookingManager\Reservations\ReservationDBRepository $repo=null)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
Class for single dates.
static _lookupTitle(int $obj_id)
$info
Definition: entry_point.php:21
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.