ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilBookingSchedulesTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
13{
17 protected $access;
18
22 protected $obj_data_cache;
23
30 public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
31 {
32 global $DIC;
33
34 $this->ctrl = $DIC->ctrl();
35 $this->lng = $DIC->language();
36 $this->access = $DIC->access();
37 $this->obj_data_cache = $DIC["ilObjDataCache"];
38 $ilCtrl = $DIC->ctrl();
39 $lng = $DIC->language();
40 $ilAccess = $DIC->access();
41 $lng = $DIC->language();
42 $ilObjDataCache = $DIC["ilObjDataCache"];
43
44 $this->ref_id = $a_ref_id;
45 $this->setId("bksd");
46
47 parent::__construct($a_parent_obj, $a_parent_cmd);
48
49 $this->addColumn($this->lng->txt("title"), "title");
50 $this->addColumn($this->lng->txt("book_is_used"));
51 $this->addColumn($this->lng->txt("actions"));
52
53 $this->setEnableHeader(true);
54 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
55 $this->setRowTemplate("tpl.booking_schedule_row.html", "Modules/BookingManager");
56
57 $this->getItems($ilObjDataCache->lookupObjId($this->ref_id));
58 }
59
65 public function getItems($a_pool_id)
66 {
68
69 $this->setMaxCount(sizeof($data));
70 $this->setData($data);
71 }
72
77 protected function fillRow($a_set)
78 {
80 $ilAccess = $this->access;
81 $ilCtrl = $this->ctrl;
82
83 $this->tpl->setVariable("TXT_TITLE", $a_set["title"]);
84
85 if ($a_set["is_used"]) {
86 $this->tpl->setVariable("TXT_IS_USED", $lng->txt("yes"));
87 } else {
88 $this->tpl->setVariable("TXT_IS_USED", $lng->txt("no"));
89 }
90
91 $ilCtrl->setParameter($this->parent_obj, 'schedule_id', $a_set['booking_schedule_id']);
92
93 $alist = new ilAdvancedSelectionListGUI();
94 $alist->setId($a_set['booking_schedule_id']);
95 $alist->setListTitle($lng->txt("actions"));
96
97 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
98 $alist->addItem($lng->txt('edit'), 'edit', $ilCtrl->getLinkTarget($this->parent_obj, 'edit')); // #12306
99
100 if (!$a_set["is_used"]) {
101 $alist->addItem($lng->txt('delete'), 'delete', $ilCtrl->getLinkTarget($this->parent_obj, 'confirmDelete'));
102 }
103 }
104
105 $this->tpl->setVariable("LAYER", $alist->getHTML());
106 }
107}
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
static getList($a_pool_id)
Get list of booking objects for given pool.
List booking schedules (for booking pool)
getItems($a_pool_id)
Build summary item rows for given object and filter(s)
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
Constructor.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setMaxCount($a_max_count)
set max.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc