ILIAS  release_8 Revision v8.24
class.ilAppointmentPresentationBookingPoolGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
11{
12 public function collectPropertiesAndActions(): void
13 {
14 $a_app = $this->appointment;
15 $cat_info = $this->getCatInfo();
16
17 $this->lng->loadLanguageModule("book");
18
19 // context id is reservation id (see ilObjBookingPoolGUI->processBooking)
20 $res_id = $a_app['event']->getContextId();
21 $res = new ilBookingReservation($res_id);
22 $b_obj = new ilBookingObject($res->getObjectId());
23 $obj_id = $b_obj->getPoolId();
24
25 $refs = $this->getReadableRefIds($obj_id);
26
27 // add common section (title, description, object/calendar, location)
28 //$this->addCommonSection($a_app, $obj_id, $cat_info);
29
30 if (count($refs) > 0) {
31 $this->addInfoSection($b_obj->getTitle());
32
33 // object description
34 if ($b_obj->getDescription()) {
35 $this->addInfoProperty($this->lng->txt("description"), $b_obj->getDescription());
36 }
37
38 $this->addObjectLinks($obj_id, $this->appointment);
39
40 //object info (course, grp...)
41 //$this->addContainerInfo($obj_id);
42
43 //link to personal bookings
44 $this->addCalendarInfo($cat_info);
45
46 // section: booking information
47 if ($b_obj->getDescription() || $b_obj->getFile()) {
48 $this->addInfoSection($this->lng->txt("book_booking_information"));
49 }
50
51 $ref_id = current($refs);
52
53 $this->ctrl->setParameterByClass("ilObjBookingPoolGUI", "ref_id", $ref_id);
54 $this->ctrl->setParameterByClass("ilbookingobjectgui", "object_id", $res->getObjectId());
55
56 // info file
57 if ($b_obj->getFile()) {
58 $this->has_files = true;
59 $link = $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI",
60 "ilObjBookingPoolGUI",
61 "ilbookingobjectgui"
62 ), "deliverInfo");
63
64 $link = $this->ui->renderer()->render(
65 $this->ui->factory()->button()->shy($b_obj->getFile(), $link)
66 );
67
68 $this->addInfoProperty($this->lng->txt("book_additional_info_file"), $link);
69 }
70
71 // post file
72 $array_info = array();
73 if (($text = $b_obj->getPostText()) != "") {
75 $a_app['event']->getStart(),
76 $a_app['event']->getEnd()
77 );
78 $text = str_replace("[OBJECT]", $b_obj->getTitle(), $text);
79 $text = str_replace("[PERIOD]", $period, $text);
80 $array_info[] = $text;
81 }
82 if ($b_obj->getPostFile()) {
83 $this->has_files = true;
84
85 $link = $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI",
86 "ilObjBookingPoolGUI",
87 "ilbookingobjectgui",
88 "ilBookingProcessGUI"
89 ), "deliverPostFile");
90
91 $array_info[] = $this->ui->renderer()->render(
92 $this->ui->factory()->button()->shy($b_obj->getPostFile(), $link)
93 );
94 }
95 if ($array_info) {
96 $this->addInfoProperty($this->lng->txt("book_post_booking_information"), implode("<br>", $array_info));
97 }
98 }
99
100 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $a_app['event']->getEntryId());
101 $this->addAction(
102 $this->lng->txt("cal_ch_cancel_booking"),
103 $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'cancelBooking')
104 );
105
106 if (count($refs) > 0) {
107 $this->addAction($this->lng->txt("book_open"), ilLink::_getStaticLink(current($refs)));
108 }
109
110 $this->addMetaData('book', $obj_id, "bobj", $res->getObjectId());
111 }
112}
addInfoProperty(string $a_txt, string $a_val)
Add info property.
addMetaData(string $a_obj_type, int $a_obj_id, ?string $a_sub_obj_type=null, ?int $a_sub_obj_id=null)
addObjectLinks(int $obj_id, ?array $a_appointment=null)
Add object link.
addAction(string $a_txt, string $a_link)
Add action.
addInfoSection(string $a_txt)
Add info section.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
$ref_id
Definition: ltiauth.php:67
$res
Definition: ltiservices.php:69