203 : void
204 {
210
212
213
214 $info_gui->addSection(
$lng->
txt(
"book_your_preferences"));
216 $preferences = $preferences->getPreferences();
217 $cnt = 1;
218 if (isset($preferences[$this->
user->getId()])) {
219 foreach ($preferences[$this->
user->getId()] as $book_obj_id) {
221 $info_gui->addProperty((string) $cnt++, $book_obj->getTitle());
222 }
223 } else {
224 $info_gui->addProperty(
"",
$lng->
txt(
"book_no_preferences_for_you"));
225 }
226
227
228 $this->service->domain()->preferences($this->pool)->storeBookings(
229 $this->repo->getPreferences($this->pool->getId())
230 );
231 $bookings = $this->service->domain()->preferences($this->pool)->readBookings();
232 $info_gui->addSection(
$lng->
txt(
"book_your_bookings"));
233 $cnt = 1;
234 if (isset($bookings[$this->
user->getId()])) {
235 foreach ($bookings[$this->
user->getId()] as $book_obj_id) {
237 $post_file = $this->objects_manager->getBookingInfoFilename($book_obj_id);
238
239
240 $post_info_button = "";
241 if ($post_file || $book_obj->getPostText()) {
243 $b =
$ui->factory()->button()->shy(
244 $lng->
txt(
"book_post_booking_information"),
246 );
247 $post_info_button =
"<br>" .
$ui->renderer()->render(
$b);
248 }
249 $info_gui->addProperty((string) $cnt++, $book_obj->getTitle() . $post_info_button);
250 }
251 } else {
252 $info_gui->addProperty(
"",
$lng->
txt(
"book_no_bookings_for_you"));
253 }
254
255
256 if ($this->
access->canManageAllReservations($this->pool->getRefId())) {
257 $info_gui->addSection(
$lng->
txt(
"book_all_users"));
259 $preferences = $preferences->getPreferences();
260 foreach ($preferences as
$user_id => $obj_ids) {
261 $booking_str =
"<br>" .
$lng->
txt(
"book_log") .
": -";
263 $booking_str =
"<br>" .
$lng->
txt(
"book_log") .
": " . implode(
", ", array_map(
264 static function ($obj_id) {
266 },
268 ));
269 }
270
271 $info_gui->addProperty(
273 $lng->
txt(
"book_preferences") .
": " . implode(
", ", array_map(
static function ($obj_id) {
275 }, $obj_ids)) . $booking_str
276 );
277 }
278 }
279
281 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPreferences(int $a_pool_id)
Get booking preferences for a pool id.
ilGlobalTemplateInterface $main_tpl
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
setContent(string $a_html)
Sets content for standard template.