4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
28 function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_pool_id, $a_has_schedule)
32 $this->pool_id = $a_pool_id;
33 $this->ref_id = $a_ref_id;
34 $this->has_schedule = (bool)$a_has_schedule;
36 $this->
setId(
"bkrsv");
40 $this->
setTitle($lng->txt(
"book_reservations_list"));
42 $this->
addColumn($this->lng->txt(
"title"));
44 if($this->has_schedule)
46 $this->
addColumn($this->lng->txt(
"book_period"));
49 $this->
addColumn($this->lng->txt(
"user"));
50 $this->
addColumn($this->lng->txt(
"status"));
51 $this->
addColumn($this->lng->txt(
"actions"));
55 $this->
setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
56 $this->
setRowTemplate(
"tpl.booking_reservation_row.html",
"Modules/BookingManager");
63 include_once
'Modules/BookingManager/classes/class.ilBookingReservation.php';
75 if($this->hasSchedule)
88 $options = array(
""=>$this->lng->txt(
'book_all'));
89 foreach($valid_status as $loop)
93 $options[$loop] = $this->lng->txt(
'book_reservation_status_'.$loop);
97 $options[$loop] = $this->lng->txt(
'book_not').
' '.$this->lng->txt(
'book_reservation_status_'.-$loop);
101 $item->setOptions($options);
102 $this->filter[
"status"] = $item->getValue();
104 if($this->has_schedule)
107 $this->filter[
"fromto"] = $item->getDate();
118 if($this->filter[
"type"])
120 $filter[
"type"] = $this->filter[
"type"];
122 if($this->filter[
"status"])
124 $filter[
"status"] = $this->filter[
"status"];
127 if($this->has_schedule)
129 if($this->filter[
"fromto"][
"from"] || $this->filter[
"fromto"][
"to"])
131 if($this->filter[
"fromto"][
"from"])
135 if($this->filter[
"fromto"][
"to"])
154 include_once
"Modules/BookingManager/classes/class.ilBookingObject.php";
157 $ids[] = $item[
"booking_object_id"];
160 include_once
"Modules/BookingManager/classes/class.ilBookingReservation.php";
175 $this->tpl->setVariable(
"TXT_TITLE", $a_set[
"title"]);
176 $this->tpl->setVariable(
"RESERVATION_ID", $a_set[
"booking_reservation_id"]);
180 $this->tpl->setVariable(
"TXT_STATUS", $lng->txt(
'book_reservation_status_'.$a_set[
'status']));
184 $uname = ilObjUser::_lookupFullName($a_set[
'user_id']);
187 $uname =
"[".$lng->txt(
"user_deleted").
"]";
191 $ilCtrl->setParameter($this->parent_obj,
'user_id', $a_set[
'user_id']);
192 $this->tpl->setVariable(
"HREF_PROFILE", $ilCtrl->getLinkTarget($this->parent_obj,
'showprofile'));
193 $ilCtrl->setParameter($this->parent_obj,
'user_id',
'');
195 $this->tpl->setVariable(
"TXT_CURRENT_USER", $uname);
197 if($this->has_schedule)
204 if (!$this->has_schedule || $date_from->get(
IL_CAL_UNIX) > time())
206 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
208 $alist->setId($a_set[
'booking_reservation_id']);
209 $alist->setListTitle($lng->txt(
"actions"));
211 $ilCtrl->setParameter($this->parent_obj,
'reservation_id', $a_set[
'booking_reservation_id']);
213 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
227 if($this->has_schedule)
229 $alist->addItem($lng->txt(
'book_set_in_use'),
'in_use', $ilCtrl->getLinkTarget($this->parent_obj,
'rsvInUse'));
231 $alist->addItem($lng->txt(
'book_set_cancel'),
'cancel', $ilCtrl->getLinkTarget($this->parent_obj,
'rsvCancel'));
233 else if($this->has_schedule)
235 $alist->addItem($lng->txt(
'book_set_not_in_use'),
'not_in_use', $ilCtrl->getLinkTarget($this->parent_obj,
'rsvNotInUse'));
240 $alist->addItem($lng->txt(
'book_set_cancel'),
'cancel', $ilCtrl->getLinkTarget($this->parent_obj,
'rsvCancel'));
243 $this->tpl->setVariable(
'LAYER', $alist->getHTML());
249 $a_worksheet->write($a_row, 0, $this->lng->txt(
"title"));
251 if($this->has_schedule)
253 $a_worksheet->write($a_row, ++$col, $this->lng->txt(
"from"));
254 $a_worksheet->write($a_row, ++$col, $this->lng->txt(
"to"));
256 $a_worksheet->write($a_row, ++$col, $this->lng->txt(
"user"));
257 $a_worksheet->write($a_row, ++$col, $this->lng->txt(
"status"));
263 $a_worksheet->write($a_row, 0, $a_set[
"title"]);
265 if($this->has_schedule)
272 $a_worksheet->write($a_row, ++$col, ilObjUser::_lookupFullName($a_set[
'user_id']));
277 $status = $this->lng->txt(
'book_reservation_status_'.$a_set[
'status']);
279 $a_worksheet->write($a_row, ++$col, $status);
286 $a_csv->addColumn($this->lng->txt(
"title"));
287 if($this->has_schedule)
289 $a_csv->addColumn($this->lng->txt(
"from"));
290 $a_csv->addColumn($this->lng->txt(
"to"));
292 $a_csv->addColumn($this->lng->txt(
"user"));
293 $a_csv->addColumn($this->lng->txt(
"status"));
299 $a_csv->addColumn($a_set[
"title"]);
300 if($this->has_schedule)
307 $a_csv->addColumn(ilObjUser::_lookupFullName($a_set[
'user_id']));
312 $status = $this->lng->txt(
'book_reservation_status_'.$a_set[
'status']);
314 $a_csv->addColumn($status);