ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilAppointmentPresentationBookingPoolGUI.php
Go to the documentation of this file.
1<?php
2include_once './Services/Calendar/interfaces/interface.ilCalendarAppointmentPresentation.php';
3include_once './Services/Calendar/classes/AppointmentPresentation/class.ilAppointmentPresentationGUI.php';
4
15{
17 {
18 $a_app = $this->appointment;
19 $cat_info = $this->getCatInfo();
20
21 $this->lng->loadLanguageModule("book");
22
23 // context id is reservation id (see ilObjBookingPoolGUI->processBooking)
24 $res_id = $a_app['event']->getContextId();
25 $res = new ilBookingReservation($res_id);
26 $b_obj = new ilBookingObject($res->getObjectId());
27 $obj_id = $b_obj->getPoolId();
28
29 $refs = $this->getReadableRefIds($obj_id);
30
31 // add common section (title, description, object/calendar, location)
32 //$this->addCommonSection($a_app, $obj_id, $cat_info);
33
34 if (count($refs) > 0) {
35 $this->addInfoSection($b_obj->getTitle());
36
37 // object description
38 if ($b_obj->getDescription()) {
39 $this->addInfoProperty($this->lng->txt("description"), $b_obj->getDescription());
40 }
41
42 $this->addObjectLinks($obj_id, $this->appointment);
43
44 //object info (course, grp...)
45 //$this->addContainerInfo($obj_id);
46
47 //link to personal bookings
48 $this->addCalendarInfo($cat_info);
49
50 // section: booking information
51 if ($b_obj->getDescription() || $b_obj->getFile()) {
52 $this->addInfoSection($this->lng->txt("book_booking_information"));
53 }
54
55 $ref_id = current($refs);
56
57 $this->ctrl->setParameterByClass("ilObjBookingPoolGUI", "ref_id", $ref_id);
58 $this->ctrl->setParameterByClass("ilbookingobjectgui", "object_id", $res->getObjectId());
59
60 // info file
61 if ($b_obj->getFile()) {
62 $this->has_files = true;
63 $link = $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjBookingPoolGUI", "ilbookingobjectgui"), "deliverInfo");
64
65 $link = $this->ui->renderer()->render(
66 $this->ui->factory()->button()->shy($b_obj->getFile(), $link)
67 );
68
69 $this->addInfoProperty($this->lng->txt("book_additional_info_file"), $link);
70 }
71
72 // post file
73 $array_info = array();
74 if ($b_obj->getPostText()) {
75 $array_info[] = $b_obj->getPostText();
76 }
77 if ($b_obj->getPostFile()) {
78 $this->has_files = true;
79
80 $link = $this->ctrl->getLinkTargetByClass(array("ilRepositoryGUI", "ilObjBookingPoolGUI", "ilbookingobjectgui"), "deliverPostFile");
81
82 $array_info[] = $this->ui->renderer()->render(
83 $this->ui->factory()->button()->shy($b_obj->getPostFile(), $link)
84 );
85 }
86 if ($array_info) {
87 $this->addInfoProperty($this->lng->txt("book_post_booking_information"), implode("<br>", $array_info));
88 }
89 }
90
91 $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $a_app['event']->getEntryId());
92 $this->addAction(
93 $this->lng->txt("cal_ch_cancel_booking"),
94 $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'cancelBooking')
95 );
96
97 if (count($refs) > 0) {
98 $this->addAction($this->lng->txt("book_open"), ilLink::_getStaticLink(current($refs)));
99 }
100
101 $this->addMetaData('book', $obj_id, "bobj", $res->getObjectId());
102 }
103}
An exception for terminatinating execution or to throw for unit testing.
addMetaData($a_obj_type, $a_obj_id, $a_sub_obj_type=null, $a_sub_obj_id=null)
Add metadata.
addObjectLinks($obj_id, $a_appointment=null)
Add object link.
getReadableRefIds($a_obj_id)
Get readable ref ids.
addInfoProperty($a_txt, $a_val)
Add info property.
a bookable ressource
foreach($_POST as $key=> $value) $res
ui()
Definition: ui.php:5