ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilBookingParticipantsTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
13{
17 protected $access;
18
22 protected $user;
23
27 protected $ref_id; // [int]
28
32 protected $pool_id; // [int]
33
37 protected $filter; // [array]
38
42 protected $objects; // array
43
51 public function __construct(ilBookingParticipantGUI $a_parent_obj, $a_parent_cmd, $a_ref_id, $a_pool_id)
52 {
53 global $DIC;
54
55 $this->ctrl = $DIC->ctrl();
56 $this->lng = $DIC->language();
57 $this->user = $DIC->user();
58 $this->access = $DIC->access();
59 $this->ref_id = $a_ref_id;
60 $this->pool_id = $a_pool_id;
61
62 $this->setId("bkprt" . $a_ref_id);
63
64 parent::__construct($a_parent_obj, $a_parent_cmd);
65
66 $this->setTitle($this->lng->txt("participants"));
67
68 $this->addColumn($this->lng->txt("name"), "name");
69 $this->addColumn($this->lng->txt("book_bobj"));
70 $this->addColumn($this->lng->txt("action"));
71
72 $this->setDefaultOrderField("name");
73 $this->setDefaultOrderDirection("asc");
74
75 $this->setEnableHeader(true);
76 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
77 $this->setRowTemplate("tpl.booking_participant_row.html", "Modules/BookingManager");
78 $this->setResetCommand("resetParticipantsFilter");
79 $this->setFilterCommand("applyParticipantsFilter");
80 $this->setDisableFilterHiding(true);
81
82 $this->initFilter();
83
84 $this->getItems($this->getCurrentFilter());
85 }
86
87 public function initFilter()
88 {
89 //object
90 $this->objects = array();
91 foreach (ilBookingObject::getList($this->pool_id) as $item) {
92 $this->objects[$item["booking_object_id"]] = $item["title"];
93 }
95 $item->setOptions(array("" => $this->lng->txt('book_all')) + $this->objects);
96 $this->filter["object"] = $item->getValue();
97
99 "title",
101 false,
102 $this->lng->txt("object") . " " . $this->lng->txt("title") . "/" . $this->lng->txt("description")
103 );
104 $this->filter["title"] = $title->getValue();
105
106 //user
107 require_once("./Modules/BookingManager/classes/class.ilBookingParticipant.php");
108 $options = array("" => $this->lng->txt('book_all')) +
111 $item->setOptions($options);
112 $this->filter["user_id"] = $item->getValue();
113 }
114
119 public function getCurrentFilter()
120 {
121 $filter = array();
122 if ($this->filter["object"]) {
123 $filter["object"] = $this->filter["object"];
124 }
125 if ($this->filter["title"]) {
126 $filter["title"] = $this->filter["title"];
127 }
128 if ($this->filter["user_id"]) {
129 $filter["user_id"] = $this->filter["user_id"];
130 }
131
132 return $filter;
133 }
134
139 public function getItems(array $filter)
140 {
141 include_once "Modules/BookingManager/classes/class.ilBookingParticipant.php";
142
143 if ($filter["object"]) {
144 $data = ilBookingParticipant::getList($this->pool_id, $filter, $filter["object"]);
145 } else {
147 }
148
149 $this->setMaxCount(sizeof($data));
150 $this->setData($data);
151 }
152
157 protected function fillRow($a_set)
158 {
159 $this->tpl->setVariable("TXT_NAME", $a_set['name']);
160 $this->tpl->setCurrentBlock('object_titles');
161 foreach ($a_set['object_title'] as $obj_title) {
162 $this->tpl->setVariable("TXT_OBJECT", $obj_title);
163 $this->tpl->parseCurrentBlock();
164 }
165
166 $this->tpl->setCurrentBlock('actions');
167 foreach ($a_set['actions'] as $key => $action) {
168 $this->tpl->setVariable("TXT_ACTION", $action['text']);
169 $this->tpl->setVariable("URL_ACTION", $action['url']);
170 $this->tpl->parseCurrentBlock();
171 }
172 }
173}
user()
Definition: user.php:4
An exception for terminatinating execution or to throw for unit testing.
static getList($a_pool_id, $a_title=null)
Get list of booking objects for given type.
Class ilBookingParticipantGUI.
static getUserFilter($a_pool_id)
Get user data from db for an specific pool id.
static getList($a_booking_pool, array $a_filter=null, $a_object_id=null)
getItems(array $filter)
Gather data and build rows.
__construct(ilBookingParticipantGUI $a_parent_obj, $a_parent_cmd, $a_ref_id, $a_pool_id)
Constructor.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
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.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
setMaxCount($a_max_count)
set max.
$action
$key
Definition: croninfo.php:18
global $DIC
Definition: saml.php:7