ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilBookingAssignParticipantsTableGUI.php
Go to the documentation of this file.
1<?php
2
24{
26 protected ilObjUser $user;
27 protected int $ref_id;
28 protected int $pool_id;
29 protected int $bp_object_id;
31 protected int $current_bookings;
32 protected array $filter;
33 protected array $objects;
35
36 public function __construct(
37 object $a_parent_obj,
38 string $a_parent_cmd,
39 int $a_ref_id,
40 int $a_pool_id,
41 int $a_booking_obj_id
42 ) {
43 global $DIC;
44 $main_tpl = $DIC->ui()->mainTemplate();
45
46 $this->ctrl = $DIC->ctrl();
47 $this->lng = $DIC->language();
48 $this->user = $DIC->user();
49 $this->access = $DIC->access();
50 $this->ref_id = $a_ref_id;
51 $this->bp_object_id = $a_booking_obj_id;
52 $this->pool_id = $a_pool_id;
53 $this->bp_object = new ilBookingObject($a_booking_obj_id);
54 $this->pool = new ilObjBookingPool($this->pool_id, false);
55
56 $this->setId("bkaprt" . $a_ref_id);
57
58 parent::__construct($a_parent_obj, $a_parent_cmd);
59
60 $this->setTitle($this->lng->txt("book_assign_participant") . ": " . $this->bp_object->getTitle());
61
62 $this->addColumn("", "", 1);
63 $this->addColumn($this->lng->txt("name"), "name");
64 if ($this->pool->getScheduleType() !== ilObjBookingPool::TYPE_FIX_SCHEDULE) {
65 $this->addColumn($this->lng->txt("book_bobj"));
66 }
67 $this->addColumn($this->lng->txt("action"));
68
69 $this->setDefaultOrderField("name");
70 $this->setDefaultOrderDirection("asc");
71
72 $this->setEnableHeader(true);
73 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
74 $this->setRowTemplate("tpl.booking_assign_participant_row.html", "components/ILIAS/BookingManager");
75
76
77 $this->addHiddenInput('object_id', $a_booking_obj_id);
78 if ($this->pool->getScheduleType() !== ilObjBookingPool::TYPE_FIX_SCHEDULE) {
79 $this->setSelectAllCheckbox('mass');
80 $this->addMultiCommand("bookMultipleParticipants", $this->lng->txt("assign"));
81 }
82 $this->getItems();
83
84
85 if ($this->pool->getScheduleType() === ilObjBookingPool::TYPE_NO_SCHEDULE) {
86 $main_tpl->setOnScreenMessage('info', sprintf(
87 $this->lng->txt("book_objects_available"),
89 ));
90 }
91 }
92
93 public function getItems(): void
94 {
95 if ($this->pool->getScheduleType() === ilObjBookingPool::TYPE_FIX_SCHEDULE) {
96 $data = ilBookingParticipant::getList($this->pool_id, []);
97 } else {
99 }
100 $this->setMaxCount(count($data));
101 $this->setData($data);
102 }
103
104 protected function fillRow(array $a_set): void
105 {
106 if ($this->pool->getScheduleType() !== ilObjBookingPool::TYPE_FIX_SCHEDULE) {
107 $this->tpl->setCurrentBlock("multi");
108 $this->tpl->setVariable("MULTI_ID", $a_set['user_id']);
109 $this->tpl->parseCurrentBlock();
110 }
111
112 $this->tpl->setVariable("TXT_NAME", $a_set['name']);
113 $this->tpl->setCurrentBlock('object_titles');
114
115 if ($this->pool->getScheduleType() !== ilObjBookingPool::TYPE_FIX_SCHEDULE) {
116 foreach ($a_set['object_title'] as $obj_title) {
117 $this->tpl->setCurrentBlock("object_title");
118 $this->tpl->setVariable("TXT_OBJECT", $obj_title);
119 $this->tpl->parseCurrentBlock();
120 }
121 $this->tpl->setCurrentBlock("object_titles");
122 $this->tpl->parseCurrentBlock();
123 }
124
125 $this->ctrl->setParameter($this->parent_obj, 'bkusr', $a_set['user_id']);
126 $this->ctrl->setParameter($this->parent_obj, 'object_id', $this->bp_object_id);
127
128 $this->tpl->setVariable("TXT_ACTION", $this->lng->txt("book_assign"));
129 $this->tpl->setVariable("URL_ACTION", $this->ctrl->getLinkTarget($this->parent_obj, 'book'));
130
131 $this->ctrl->setParameter($this->parent_obj, 'bkusr', '');
132 $this->ctrl->setParameter($this->parent_obj, 'object_id', '');
133 }
134}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_ref_id, int $a_pool_id, int $a_booking_obj_id)
fillRow(array $a_set)
Standard Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAssignableParticipants(int $a_bp_object_id)
Get participants who can not have a reservation for this booking pool object id.
static getList(int $a_booking_pool, ?array $a_filter=null, ?int $a_object_id=null)
static numAvailableFromObjectNoSchedule(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addHiddenInput(string $a_name, string $a_value)
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
ilGlobalTemplateInterface $main_tpl
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
setMaxCount(int $a_max_count)
set max.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26