ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilBookingInfoListItemPropertiesAdapter.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
12 {
16  protected $repo;
17 
23  {
24  $this->repo = $repo;
25  }
26 
27 
31  public function appendProperties($obj_id, $props)
32  {
34  $info = [];
35  if ($repo) {
36  foreach ($repo->getCachedContextObjBookingInfo($obj_id) as $item) {
37  $info[$item["pool_id"]]["title"] = ilObject::_lookupTitle($item["pool_id"]);
38  $info[$item["pool_id"]]["object"][$item["obj_id"]]["title"] = $item["title"];
39  $info[$item["pool_id"]]["object"][$item["obj_id"]]["bookings"][] =
40  ilDatePresentation::formatDate(new ilDate($item["date"], IL_CAL_DATE)) . ", " . $item["slot"] . " (" . $item["counter"] . ")";
41  }
42  foreach ($info as $pool) {
43  $val = "";
44  foreach ($pool["object"] as $o) {
45  $val .= $o["title"] . ": " . implode(", ", $o["bookings"]);
46  }
47  $props[] = array("alert" => false, "property" => $pool["title"], "value" => $val);
48  }
49  }
50  return $props;
51  }
52 }
static _lookupTitle($a_id)
lookup object title
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
Class for single dates.
appendProperties($obj_id, $props)
Get booking info properties.
__construct(ilBookingReservationDBRepository $repo=null)
Constructor.
const IL_CAL_DATE