ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilBookingAssignParticipantsTableGUI.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;
28
32 protected $pool_id;
33
37 protected $bp_object_id;
38
42 protected $bp_object;
43
47 protected $current_bookings; // [int]
48
52 protected $filter; // [array]
53
57 protected $objects; // array
58
62 protected $pool;
63
72 public function __construct(ilBookingProcessGUI $a_parent_obj, $a_parent_cmd, $a_ref_id, $a_pool_id, $a_booking_obj_id)
73 {
74 global $DIC;
75
76 $this->ctrl = $DIC->ctrl();
77 $this->lng = $DIC->language();
78 $this->user = $DIC->user();
79 $this->access = $DIC->access();
80 $this->ref_id = $a_ref_id;
81 $this->bp_object_id = $a_booking_obj_id;
82 $this->pool_id = $a_pool_id;
83 $this->bp_object = new ilBookingObject($a_booking_obj_id);
84 $this->pool = new ilObjBookingPool($this->pool_id, false);
85
86 $this->setId("bkaprt" . $a_ref_id);
87
88 parent::__construct($a_parent_obj, $a_parent_cmd);
89
90 $this->setTitle($this->lng->txt("book_assign_participant") . ": " . $this->bp_object->getTitle());
91
92 $this->addColumn("", "", 1);
93 $this->addColumn($this->lng->txt("name"), "name");
94 if ($this->pool->getScheduleType() != ilObjBookingPool::TYPE_FIX_SCHEDULE) {
95 $this->addColumn($this->lng->txt("book_bobj"));
96 }
97 $this->addColumn($this->lng->txt("action"));
98
99 $this->setDefaultOrderField("name");
100 $this->setDefaultOrderDirection("asc");
101
102 $this->setEnableHeader(true);
103 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
104 $this->setRowTemplate("tpl.booking_assign_participant_row.html", "Modules/BookingManager");
105
106
107 $this->addHiddenInput('object_id', $a_booking_obj_id);
108 if ($this->pool->getScheduleType() != ilObjBookingPool::TYPE_FIX_SCHEDULE) {
109 $this->setSelectAllCheckbox('mass');
110 $this->addMultiCommand("bookMultipleParticipants", $this->lng->txt("assign"));
111 }
112 $this->getItems();
113
114
115 if ($this->pool->getScheduleType() == ilObjBookingPool::TYPE_NO_SCHEDULE) {
117 sprintf(
118 $this->lng->txt("book_objects_available"),
120 )
121 );
122 }
123 }
124
128 public function getItems()
129 {
130 if ($this->pool->getScheduleType() == ilObjBookingPool::TYPE_FIX_SCHEDULE) {
131 $data = ilBookingParticipant::getList($this->pool_id, []);
132 } else {
134 }
135 $this->setMaxCount(sizeof($data));
136 $this->setData($data);
137 }
138
143 protected function fillRow($a_set)
144 {
145 if ($this->pool->getScheduleType() != ilObjBookingPool::TYPE_FIX_SCHEDULE) {
146 $this->tpl->setCurrentBlock("multi");
147 $this->tpl->setVariable("MULTI_ID", $a_set['user_id']);
148 $this->tpl->parseCurrentBlock();
149 }
150
151 $this->tpl->setVariable("TXT_NAME", $a_set['name']);
152 $this->tpl->setCurrentBlock('object_titles');
153
154 if ($this->pool->getScheduleType() != ilObjBookingPool::TYPE_FIX_SCHEDULE) {
155 foreach ($a_set['object_title'] as $obj_title) {
156 $this->tpl->setCurrentBlock("object_title");
157 $this->tpl->setVariable("TXT_OBJECT", $obj_title);
158 $this->tpl->parseCurrentBlock();
159 }
160 $this->tpl->setCurrentBlock("object_titles");
161 $this->tpl->parseCurrentBlock();
162 }
163
164 $this->ctrl->setParameter($this->parent_obj, 'bkusr', $a_set['user_id']);
165 $this->ctrl->setParameter($this->parent_obj, 'object_id', $this->bp_object_id);
166
167 $this->tpl->setVariable("TXT_ACTION", $this->lng->txt("book_assign"));
168 $this->tpl->setVariable("URL_ACTION", $this->ctrl->getLinkTarget($this->parent_obj, 'book'));
169
170 $this->ctrl->setParameter($this->parent_obj, 'bkusr', '');
171 $this->ctrl->setParameter($this->parent_obj, 'object_id', '');
172 }
173}
user()
Definition: user.php:4
An exception for terminatinating execution or to throw for unit testing.
__construct(ilBookingProcessGUI $a_parent_obj, $a_parent_cmd, $a_ref_id, $a_pool_id, $a_booking_obj_id)
Constructor.
a bookable ressource
static getAssignableParticipants($a_bp_object_id)
Get participants who can not have a reservation for this booking pool object id.
static getList($a_booking_pool, array $a_filter=null, $a_object_id=null)
Booking process ui class.
static numAvailableFromObjectNoSchedule($a_obj_id)
Class ilObjBookingPool.
Class ilTable2GUI.
addHiddenInput($a_name, $a_value)
Add Hidden Input field.
setEnableHeader($a_enableheader)
Set Enable Header.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setMaxCount($a_max_count)
set max.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc