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