ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilBookingReservationsTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 include_once 'Modules/BookingManager/classes/class.ilBookingReservation.php';
6 require_once "Services/Calendar/classes/class.ilCalendarUtil.php";
7 
17 {
21  protected $user;
22 
26  protected $access;
27 
28  protected $ref_id; // int
29  protected $filter; // array
30  protected $pool_id; // int
31  protected $show_all; // bool
32  protected $has_schedule; // bool
33  protected $objects; // array
34  protected $group_id; // int
35  protected $advmd; // [array]
36 
48  public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_pool_id, $a_show_all, $a_has_schedule, array $a_filter_pre = null, $a_group_id = null)
49  {
50  global $DIC;
51 
52  $this->ctrl = $DIC->ctrl();
53  $this->lng = $DIC->language();
54  $this->user = $DIC->user();
55  $this->access = $DIC->access();
56  $ilCtrl = $DIC->ctrl();
57  $lng = $DIC->language();
58  $ilUser = $DIC->user();
59  $ilAccess = $DIC->access();
60 
61  $this->pool_id = $a_pool_id;
62  $this->ref_id = $a_ref_id;
63  $this->show_all = $a_show_all;
64  $this->has_schedule = (bool) $a_has_schedule;
65  $this->group_id = $a_group_id;
66 
67  $this->advmd = ilObjBookingPool::getAdvancedMDFields($a_ref_id);
68 
69  $this->setId("bkrsv" . $a_ref_id);
70 
71  parent::__construct($a_parent_obj, $a_parent_cmd);
72 
73  $this->setTitle($lng->txt("book_reservations_list"));
74 
75  $this->addColumn("", "", 1);
76  $this->addColumn($this->lng->txt("title"), "title");
77 
78  $selected = $this->getSelectedColumns();
79  $cols = $this->getSelectableColumns();
80 
81  if ($this->has_schedule) {
82  $this->lng->loadLanguageModule("dateplaner");
83 
84  $this->addColumn($this->lng->txt("date"), "date");
85  if (in_array("week", $selected)) {
86  $this->addColumn($this->lng->txt("wk_short"), "week");
87  unset($cols["week"]);
88  }
89  if (in_array("weekday", $selected)) {
90  $this->addColumn($this->lng->txt("cal_weekday"), "weekday");
91  unset($cols["weekday"]);
92  }
93  $this->addColumn($this->lng->txt("book_schedule_slot"), "slot");
94  $this->addColumn($this->lng->txt("book_no_of_objects"), "counter");
95 
96  $this->setDefaultOrderField("date");
97  $this->setDefaultOrderDirection("asc");
98  } else {
99  $this->addColumn($this->lng->txt("status"), "status");
100 
101  $this->setDefaultOrderField("title");
102  $this->setDefaultOrderDirection("asc");
103  }
104 
105  foreach ($this->getSelectedColumns() as $col) {
106  if (array_key_exists($col, $cols)) {
107  $this->addColumn($cols[$col]["txt"], $col);
108  }
109  }
110 
111  $this->addColumn($this->lng->txt("user"), "user_name");
112  $this->addColumn($this->lng->txt("actions"));
113 
114  $this->setEnableHeader(true);
115  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
116  $this->setRowTemplate("tpl.booking_reservation_row.html", "Modules/BookingManager");
117  $this->setResetCommand("resetLogFilter");
118  $this->setFilterCommand("applyLogFilter");
119  $this->setDisableFilterHiding(true);
120 
121  $this->initFilter($a_filter_pre);
122 
123  if ($this->group_id) {
124  $this->setLimit(9999);
125  $this->disable("numinfo");
126  $this->filters = array();
127  } else {
128  $this->setExportFormats(array(self::EXPORT_CSV, self::EXPORT_EXCEL));
129  }
130 
131  if ($ilUser->getId() != ANONYMOUS_USER_ID) {
132  /*
133  if($ilAccess->checkAccess('write', '', $this->ref_id))
134  {
135  $this->addMultiCommand('rsvInUse', $lng->txt('book_set_in_use'));
136  $this->addMultiCommand('rsvNotInUse', $lng->txt('book_set_not_in_use'));
137  }
138  */
139 
140  $this->addMultiCommand('rsvConfirmCancel', $lng->txt('book_set_cancel'));
141  // $this->addMultiCommand('rsvUncancel', $lng->txt('book_set_not_cancel'));
142  $this->setSelectAllCheckbox('mrsv');
143  }
144 
145  $this->getItems($this->getCurrentFilter());
146 
148  }
149 
150  public function getSelectableColumns($a_only_advmd = false)
151  {
152  $cols = array();
153 
154  if ($this->has_schedule &&
155  !(bool) $a_only_advmd) {
156  $this->lng->loadLanguageModule("dateplaner");
157 
158  $cols["week"] = array(
159  "txt" => $this->lng->txt("wk_short"),
160  "default" => true
161  );
162 
163  $cols["weekday"] = array(
164  "txt" => $this->lng->txt("cal_weekday"),
165  "default" => true
166  );
167  }
168 
169  foreach ($this->advmd as $field) {
170  $cols["advmd" . $field["id"]] = array(
171  "txt" => $field["title"],
172  "default" => false
173  );
174  }
175 
176  return $cols;
177  }
178 
179 
183  public function initFilter(array $a_filter_pre = null)
184  {
185  if (is_array($a_filter_pre) &&
186  isset($a_filter_pre["object"])) {
187  $_SESSION["form_" . $this->getId()]["object"] = serialize($a_filter_pre["object"]);
188  }
189 
190  $this->objects = array();
191  include_once "Modules/BookingManager/classes/class.ilBookingObject.php";
192  foreach (ilBookingObject::getList($this->pool_id) as $item) {
193  $this->objects[$item["booking_object_id"]] = $item["title"];
194  }
195  $item = $this->addFilterItemByMetaType("object", ilTable2GUI::FILTER_SELECT);
196  $item->setOptions(array(""=>$this->lng->txt('book_all'))+$this->objects);
197  $this->filter["object"] = $item->getValue();
198 
200  "title",
202  false,
203  $this->lng->txt("object") . " " . $this->lng->txt("title") . "/" . $this->lng->txt("description")
204  );
205  $this->filter["title"] = $title->getValue();
206 
207  if ($this->has_schedule) {
208  // default period: from:today [ to:(today + n days) ]
209  if (!$_SESSION["form_" . $this->getId()]["fromto"]) {
210  $from = new ilDateTime(date("Y-m-d"), IL_CAL_DATE); // today
211  $to = null;
212 
213  // add period end from pool settings?
214  include_once "Modules/BookingManager/classes/class.ilObjBookingPool.php";
215  $bpool = new ilObjBookingPool($this->pool_id, false);
216  $period = $bpool->getReservationFilterPeriod();
217  if ($period !== null) {
218  $to = clone $from;
219  if ($period) {
220  $to->increment(ilDateTime::DAY, $period);
221  }
222  $to = serialize($to);
223  }
224 
225  $_SESSION["form_" . $this->getId()]["fromto"] = serialize(array(
226  "from" => serialize($from),
227  "to" => $to
228  ));
229  }
230  $item = $this->addFilterItemByMetaType("fromto", ilTable2GUI::FILTER_DATE_RANGE, false, $this->lng->txt('book_fromto'));
231  $this->filter["fromto"] = $item->getDate();
232 
233  // only needed for full log
234  if ($this->show_all) {
235  // see ilObjBookingPoolGUI::buildDatesBySchedule()
236  $map = array_flip(array('su', 'mo', 'tu', 'we', 'th', 'fr', 'sa'));
237 
238  $options = array(""=>$this->lng->txt('book_all'));
239 
240  // schedule to slot
241  require_once "Modules/BookingManager/classes/class.ilBookingSchedule.php";
242  foreach (ilBookingSchedule::getList($this->pool_id) as $def) {
243  $schedule = new ilBookingSchedule($def["booking_schedule_id"]);
244  foreach ($schedule->getDefinition() as $day => $slots) {
245  $day_caption = ilCalendarUtil::_numericDayToString($map[$day], false);
246 
247  foreach ($slots as $slot) {
248  $idx = $map[$day] . "_" . $slot;
249  $options[$idx] = $day_caption . ", " . $slot;
250  }
251  }
252  }
253 
254  ksort($options);
255 
256  $item = $this->addFilterItemByMetaType("book_schedule_slot", ilTable2GUI::FILTER_SELECT);
257  $item->setOptions($options);
258  $this->filter["slot"] = $item->getValue();
259  }
260  }
261 
262  $item = new ilCheckboxInputGUI($this->lng->txt("book_filter_past_reservations"), "past");
263  $this->addFilterItem($item);
264  $item->readFromSession();
265 
266  // if period starts in the past we have to include past reservations
267  // :TODO: to be discussed
268  if (is_object($this->filter["fromto"]["from"]) &&
269  $this->filter["fromto"]["from"]->get(IL_CAL_DATE) < date("Y-m-d")) {
270  $item->setChecked(true);
271  }
272 
273  $this->filter["past"] = $item->getChecked();
274 
275  // status
278  if (!$this->has_schedule) {
279  $options = array(""=>$this->lng->txt('book_all'));
280  } else {
281  $options = array();
282  }
283  foreach ($valid_status as $loop) {
284  if ($loop > 0) {
285  $options[$loop] = $this->lng->txt('book_reservation_status_' . $loop);
286  } else {
287  $options[$loop] = $this->lng->txt('book_not') . ' ' . $this->lng->txt('book_reservation_status_' . -$loop);
288  }
289  }
290  $item = $this->addFilterItemByMetaType("status", ilTable2GUI::FILTER_SELECT);
291  $item->setOptions($options);
292  $this->filter["status"] = $item->getValue();
293 
294  // only needed for full log
295  if ($this->show_all) {
296  $options = array(""=>$this->lng->txt('book_all'))+
297  ilBookingReservation::getUserFilter(array_keys($this->objects));
298  $item = $this->addFilterItemByMetaType("user", ilTable2GUI::FILTER_SELECT);
299  $item->setOptions($options);
300  $this->filter["user_id"] = $item->getValue();
301  }
302  }
303 
308  public function getCurrentFilter()
309  {
310  $filter = array();
311  if ($this->filter["object"]) {
312  $filter["object"] = $this->filter["object"];
313  }
314  if ($this->filter["title"]) {
315  $filter["title"] = $this->filter["title"];
316  }
317  if ($this->filter["status"]) {
318  $filter["status"] = $this->filter["status"];
319  }
320  if ($this->filter["user_id"]) {
321  $filter["user_id"] = $this->filter["user_id"];
322  }
323 
324  if ($this->has_schedule) {
325  if (!$filter["status"]) {
326  // needs distinct status because of aggregation
328  }
329  if ($this->filter["slot"]) {
330  $filter["slot"] = $this->filter["slot"];
331  }
332 
333  if ($this->filter["fromto"]["from"] || $this->filter["fromto"]["to"]) {
334  if ($this->filter["fromto"]["from"]) {
335  $filter["from"] = $this->filter["fromto"]["from"]->get(IL_CAL_UNIX);
336  }
337  if ($this->filter["fromto"]["to"]) {
338  $day_end = new ilDateTime($this->filter["fromto"]["to"]->get(IL_CAL_DATE) . " 23:59:59", IL_CAL_DATETIME);
339  $filter["to"] = $day_end->get(IL_CAL_UNIX);
340  }
341  }
342 
343  $filter["past"] = (bool) $this->filter["past"];
344  }
345 
346  return $filter;
347  }
348 
349  public function numericOrdering($a_field)
350  {
351  return in_array($a_field, array("counter", "date", "week", "weekday"));
352  }
353 
358  public function getItems(array $filter)
359  {
361 
362  if (!$filter["object"]) {
363  $ids = array_keys($this->objects);
364  } else {
365  $ids = array($filter["object"]);
366  }
367 
368  if (!$this->show_all) {
369  $filter["user_id"] = $ilUser->getId();
370  }
371 
372  include_once "Modules/BookingManager/classes/class.ilBookingReservation.php";
373  $data = ilBookingReservation::getListByDate($this->has_schedule, $ids, $filter);
374 
375  if ($this->advmd) {
376  // advanced metadata
377  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
378  $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_FILTER, "book", $this->pool_id, "bobj");
379  $this->record_gui->setTableGUI($this);
380  $this->record_gui->parse();
381 
382  foreach (array_keys($data) as $idx) {
383  $data[$idx]["pool_id"] = $this->pool_id;
384  }
385 
386  include_once("./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php");
388  $this->ref_id,
389  "book",
390  "bobj",
391  $this->pool_id,
392  "bobj",
393  $data,
394  "pool_id",
395  "object_id",
396  $this->record_gui->getFilterElements()
397  );
398  }
399 
400  $this->setData($data);
401  }
402 
403  public function getAdvMDRecordGUI()
404  {
405  return $this->record_gui;
406  }
407 
408  public function getOrderField()
409  {
410  $field = parent::getOrderField();
411 
412  // #16560 - this will enable matchting slot sorting to date/week
413  if (in_array($field, array("date", "week"))) {
414  $field = "_sortdate";
415  }
416 
417  return $field;
418  }
419 
424  protected function fillRow($a_set)
425  {
426  $lng = $this->lng;
427  $ilAccess = $this->access;
430 
431  $selected = $this->getSelectedColumns();
432 
433  $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
434 
435  $can_be_cancelled = (($ilAccess->checkAccess('write', '', $this->ref_id) ||
436  $a_set['user_id'] == $ilUser->getId()) &&
437  $a_set["can_be_cancelled"]);
438 
439  if ($can_be_cancelled) {
440  $this->tpl->setVariable("MULTI_ID", $a_set["booking_reservation_id"]);
441  }
442 
443  // #11995
444  $uname = $a_set["user_name"];
445  if (!trim($uname)) {
446  $uname = "[" . $lng->txt("user_deleted") . "]";
447  } else {
448  //$ilCtrl->setParameter($this->parent_obj, 'user_id', $a_set['user_id']);
449  //$this->tpl->setVariable("HREF_PROFILE", $ilCtrl->getLinkTarget($this->parent_obj, 'showprofile'));
450  //$ilCtrl->setParameter($this->parent_obj, 'user_id', '');
451  include_once("./Services/User/classes/class.ilUserUtil.php");
452  $uname = ilUserUtil::getNamePresentation($a_set['user_id'], false, true, "", true);
453  }
454  $this->tpl->setVariable("TXT_CURRENT_USER", $uname);
455 
456  if ($this->has_schedule) {
457  $this->tpl->setVariable("VALUE_DATE", ilDatePresentation::formatDate(new ilDate($a_set["date"], IL_CAL_DATE)));
458  if (in_array("week", $selected)) {
459  $this->tpl->setVariable("VALUE_WEEK", $a_set["week"]);
460  }
461  if (in_array("weekday", $selected)) {
462  $this->tpl->setVariable("VALUE_WEEKDAY", ilCalendarUtil::_numericDayToString($a_set["weekday"], false));
463  }
464  $this->tpl->setVariable("VALUE_SLOT", $a_set["slot"]);
465  $this->tpl->setVariable("VALUE_COUNTER", $a_set["counter"]);
466  } else {
468  $this->tpl->setVariable("TXT_STATUS", $lng->txt('book_reservation_status_' . $a_set['status']));
469  } else {
470  $this->tpl->setVariable("TXT_STATUS", "&nbsp;");
471  }
472  }
473 
474  if ($this->advmd) {
475  foreach ($this->advmd as $item) {
476  $advmd_id = (int) $item["id"];
477 
478  if (!in_array("advmd" . $advmd_id, $selected)) {
479  continue;
480  }
481 
482  $val = " ";
483  if (isset($a_set["md_" . $advmd_id . "_presentation"])) {
484  $pb = $a_set["md_" . $advmd_id . "_presentation"]->getList();
485  if ($pb) {
486  $val = $pb;
487  }
488  }
489 
490  $this->tpl->setCurrentBlock("advmd_bl");
491  $this->tpl->setVariable("VALUE_ADVMD", $val);
492  $this->tpl->parseCurrentBlock();
493  }
494  }
495 
496  if ($can_be_cancelled) {
497  $ilCtrl->setParameter($this->parent_obj, 'reservation_id', $a_set['booking_reservation_id']);
498  $this->tpl->setVariable("URL_ACTION", $ilCtrl->getLinkTarget($this->parent_obj, 'rsvConfirmCancel'));
499  $ilCtrl->setParameter($this->parent_obj, 'reservation_id', "");
500  $this->tpl->setVariable("TXT_ACTION", $lng->txt('book_set_cancel'));
501  }
502 
503  /* advsellist version
504  if (!$this->has_schedule || $date_to->get(IL_CAL_UNIX) > time())
505  {
506  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
507  $alist = new ilAdvancedSelectionListGUI();
508  $alist->setId($a_set['booking_reservation_id']);
509  $alist->setListTitle($lng->txt("actions"));
510 
511  $ilCtrl->setParameter($this->parent_obj, 'reservation_id', $a_set['booking_reservation_id']);
512 
513  if(!$a_set['group_id'])
514  {
515  if($ilAccess->checkAccess('write', '', $this->ref_id))
516  {
517  if($a_set['status'] == ilBookingReservation::STATUS_CANCELLED)
518  {
519  // can be uncancelled?
520  // if(ilBookingReservation::getAvailableObject(array($a_set['object_id']), $date_from->get(IL_CAL_UNIX), $date_to->get(IL_CAL_UNIX)))
521  // {
522  // $alist->addItem($lng->txt('book_set_not_cancel'), 'not_cancel', $ilCtrl->getLinkTarget($this->parent_obj, 'rsvUncancel'));
523  // }
524  }
525  else if($a_set['status'] != ilBookingReservation::STATUS_IN_USE)
526  {
527  if($this->has_schedule)
528  {
529  $alist->addItem($lng->txt('book_set_in_use'), 'in_use', $ilCtrl->getLinkTarget($this->parent_obj, 'rsvInUse'));
530  }
531  $alist->addItem($lng->txt('book_set_cancel'), 'cancel', $ilCtrl->getLinkTarget($this->parent_obj, 'rsvConfirmCancel'));
532  }
533  else if($this->has_schedule)
534  {
535  $alist->addItem($lng->txt('book_set_not_in_use'), 'not_in_use', $ilCtrl->getLinkTarget($this->parent_obj, 'rsvNotInUse'));
536  }
537  }
538  else if($a_set['user_id'] == $ilUser->getId() && $a_set['status'] != ilBookingReservation::STATUS_CANCELLED)
539  {
540  $alist->addItem($lng->txt('book_set_cancel'), 'cancel', $ilCtrl->getLinkTarget($this->parent_obj, 'rsvConfirmCancel'));
541  }
542  }
543  else if($ilAccess->checkAccess('write', '', $this->ref_id) || $a_set['user_id'] == $ilUser->getId())
544  {
545  $alist->addItem($lng->txt('details'), 'details', $ilCtrl->getLinkTarget($this->parent_obj, 'logDetails'));
546  }
547 
548  if(sizeof($alist->getItems()))
549  {
550  if(!$a_set['group_id'])
551  {
552  $this->tpl->setVariable('MULTI_ID', $a_set['booking_reservation_id']);
553  }
554  $this->tpl->setVariable('LAYER', $alist->getHTML());
555  }
556  }
557  */
558  }
559 
560  protected function fillHeaderExcel(ilExcel $a_excel, &$a_row)
561  {
562  $a_excel->setCell($a_row, 0, $this->lng->txt("title"));
563  $col = 0;
564  if ($this->has_schedule) {
565  $a_excel->setCell($a_row, ++$col, $this->lng->txt("date"));
566  $a_excel->setCell($a_row, ++$col, $this->lng->txt("wk_short"));
567  $a_excel->setCell($a_row, ++$col, $this->lng->txt("cal_weekday"));
568  $a_excel->setCell($a_row, ++$col, $this->lng->txt("book_schedule_slot"));
569  $a_excel->setCell($a_row, ++$col, $this->lng->txt("book_no_of_objects"));
570  } else {
571  $a_excel->setCell($a_row, ++$col, $this->lng->txt("status"));
572  }
573 
574  foreach ($this->getSelectableColumns(true) as $advmd_col) {
575  $a_excel->setCell($a_row, ++$col, $advmd_col["txt"]);
576  }
577 
578  $a_excel->setCell($a_row, ++$col, $this->lng->txt("user"));
579 
580  $a_excel->setBold("A" . $a_row . ":" . $a_excel->getColumnCoord($col-1) . $a_row);
581  }
582 
583  protected function fillRowExcel(ilExcel $a_excel, &$a_row, $a_set)
584  {
585  $a_excel->setCell($a_row, 0, $a_set["title"]);
586  $col = 0;
587  if ($this->has_schedule) {
588  $a_excel->setCell($a_row, ++$col, new ilDate($a_set["date"], IL_CAL_DATE));
589  $a_excel->setCell($a_row, ++$col, $a_set["week"]);
590  $a_excel->setCell($a_row, ++$col, ilCalendarUtil::_numericDayToString($a_set["weekday"], false));
591  $a_excel->setCell($a_row, ++$col, $a_set["slot"]);
592  $a_excel->setCell($a_row, ++$col, $a_set["counter"]);
593  } else {
594  $status = "";
596  $status = $this->lng->txt('book_reservation_status_' . $a_set['status']);
597  }
598  $a_excel->setCell($a_row, ++$col, $status);
599  }
600  $a_excel->setCell($a_row, ++$col, $a_set['user_name']);
601 
602  if ($this->advmd) {
603  foreach ($this->advmd as $item) {
604  $advmd_id = (int) $item["id"];
605  $val = " ";
606  if (isset($a_set["md_" . $advmd_id . "_presentation"])) {
607  $pb = $a_set["md_" . $advmd_id . "_presentation"]->getList();
608  if ($pb) {
609  $val = $pb;
610  }
611  }
612  $a_excel->setCell($a_row, ++$col, $val);
613  }
614  }
615  }
616 
617  protected function fillHeaderCSV($a_csv)
618  {
619  $a_csv->addColumn($this->lng->txt("title"));
620  if ($this->has_schedule) {
621  $a_csv->addColumn($this->lng->txt("date"));
622  $a_csv->addColumn($this->lng->txt("wk_short"));
623  $a_csv->addColumn($this->lng->txt("cal_weekday"));
624  $a_csv->addColumn($this->lng->txt("book_schedule_slot"));
625  $a_csv->addColumn($this->lng->txt("book_no_of_objects"));
626  } else {
627  $a_csv->addColumn($this->lng->txt("status"));
628  }
629 
630  foreach ($this->getSelectableColumns(true) as $advmd_col) {
631  $a_csv->addColumn($advmd_col["txt"]);
632  }
633 
634  $a_csv->addColumn($this->lng->txt("user"));
635  $a_csv->addRow();
636  }
637 
638  protected function fillRowCSV($a_csv, $a_set)
639  {
640  $a_csv->addColumn($a_set["title"]);
641  if ($this->has_schedule) {
642  $a_csv->addColumn(ilDatePresentation::formatDate(new ilDate($a_set["date"], IL_CAL_DATE)));
643  $a_csv->addColumn($a_set["week"]);
644  $a_csv->addColumn(ilCalendarUtil::_numericDayToString($a_set["weekday"], false));
645  $a_csv->addColumn($a_set["slot"]);
646  $a_csv->addColumn($a_set["counter"]);
647  } else {
648  $status = "";
650  $status = $this->lng->txt('book_reservation_status_' . $a_set['status']);
651  }
652  $a_csv->addColumn($status);
653  }
654 
655  if ($this->advmd) {
656  foreach ($this->advmd as $item) {
657  $advmd_id = (int) $item["id"];
658  $val = " ";
659  if (isset($a_set["md_" . $advmd_id . "_presentation"])) {
660  $pb = $a_set["md_" . $advmd_id . "_presentation"]->getList();
661  if ($pb) {
662  $val = $pb;
663  }
664  }
665  $a_csv->addColumn($val);
666  }
667  }
668 
669  $a_csv->addColumn($a_set['user_name']);
670  $a_csv->addRow();
671  }
672 }
initFilter()
Init filter.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
initFilter(array $a_filter_pre=null)
Init filter.
setExportFormats(array $formats)
Set available export formats.
const IL_CAL_DATETIME
$_SESSION["AccountId"]
static getList($a_pool_id, $a_title=null)
Get list of booking objects for given type.
static _numericDayToString($a_day, $a_long=true)
get
static getUserFilter(array $a_object_ids)
Get all users who have reservations for object(s)
getSelectableColumns()
Get selectable columns.
global $DIC
Definition: saml.php:7
getItems(array $filter)
Gather data and build rows.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
schedule for booking ressource
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
This class represents a checkbox property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static setUseRelativeDates($a_status)
set use relative dates
$from
Class ilObjBookingPool.
const IL_CAL_UNIX
static getListByDate($a_has_schedule, array $a_object_ids, array $filter=null)
List all reservations by date.
setId($a_val)
Set id.
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
Class for single dates.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
getColumnCoord($a_col)
Get column "name" from number.
setBold($a_coords)
Set cell(s) to bold.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
addMultiCommand($a_cmd, $a_text)
Add Command button.
Date and time handling
$ilUser
Definition: imgupload.php:18
getSelectedColumns()
Get selected columns.
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
const IL_CAL_DATE
disable($a_module_name)
diesables particular modules of table
fillRowExcel(ilExcel $a_excel, &$a_row, $a_set)
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
$def
Definition: croninfo.php:21
setEnableHeader($a_enableheader)
Set Enable Header.
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_pool_id, $a_show_all, $a_has_schedule, array $a_filter_pre=null, $a_group_id=null)
Constructor.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
getId()
Get element id.
static getList($a_pool_id)
Get list of booking objects for given pool.
static getAdvancedMDFields($a_ref_id)
$cols
Definition: xhr_table.php:11
static queryForRecords($adv_rec_obj_ref_id, $adv_rec_obj_type, $adv_rec_obj_subtype, $a_obj_id, $a_subtype, $a_records, $a_obj_id_key, $a_obj_subid_key, array $a_amet_filter=null)
Query data for given object records.
setLimit($a_limit=0, $a_default_limit=0)
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
setFilterCommand($a_val, $a_caption=null)
Set filter command.