19declare(strict_types=1);
35 public function __construct(
object $a_gui,
string $a_cmd,
int $a_user_id)
37 $this->user_id = $a_user_id;
43 $this->
renderer = $DIC->ui()->renderer();
44 $this->uiFactory =
$DIC->ui()->factory();
47 $this->
addColumn($this->
lng->txt(
'appointment'),
'start');
50 $this->
addColumn($this->
lng->txt(
'cal_ch_num_bookings'),
'num_bookings');
51 $this->
addColumn($this->
lng->txt(
'cal_ch_bookings'),
'participants');
52 $this->
addColumn($this->
lng->txt(
'cal_ch_target_object'),
'target');
55 $this->
setRowTemplate(
'tpl.ch_upcoming_row.html',
'components/ILIAS/Calendar');
56 $this->
setFormAction($this->
ctrl->getFormAction($this->getParentObject(), $this->getParentCmd()));
67 $this->
addMultiCommand(
'searchUsersForAppointments', $this->
lng->txt(
'cal_ch_assign_participants'));
79 protected function fillRow(array $a_set): void
81 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
82 $this->tpl->setVariable(
'START', $a_set[
'start_p']);
83 $this->tpl->setVariable(
'TITLE', $a_set[
'title']);
84 $this->tpl->setVariable(
'NUM_BOOKINGS', $a_set[
'num_bookings']);
86 foreach ((array) ($a_set[
'target_links'] ?? []) as $link) {
87 $this->tpl->setCurrentBlock(
'links');
88 $this->tpl->setVariable(
'TARGET', $link[
'title']);
89 $this->tpl->setVariable(
'URL_TARGET', $link[
'link']);
90 $this->tpl->parseCurrentBlock();
92 if ($a_set[
'bookings']) {
93 foreach ($a_set[
'bookings'] as
$user_id => $name) {
95 if (($user_profile_prefs[
"public_profile"] ??
'') ==
"y") {
96 $this->tpl->setCurrentBlock(
'booking_with_link');
98 $this->tpl->setVariable(
100 $this->
ctrl->getLinkTarget($this->getParentObject(),
'showprofile')
103 $this->tpl->setCurrentBlock(
'booking_without_link');
106 $this->tpl->setVariable(
'TXT_BOOKING', $name);
107 $this->tpl->parseCurrentBlock();
111 $this->tpl->setVariable(
'BOOKINGS', implode(
', ', $a_set[
'bookings']));
114 $dropDownItems = array(
115 $this->uiFactory->button()->shy(
116 $this->lng->txt(
'edit'),
117 $this->ctrl->getLinkTarget($this->getParentObject(),
'edit')
119 $this->uiFactory->button()->shy(
120 $this->lng->txt(
'cal_ch_assign_participants'),
121 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'')
123 $this->uiFactory->button()->shy(
124 $this->lng->txt(
'delete'),
125 $this->ctrl->getLinkTarget($this->getParentObject(),
'confirmDelete')
128 $dropDown = $this->uiFactory->dropdown()->standard($dropDownItems)
129 ->withLabel($this->
lng->txt(
'actions'));
130 $this->tpl->setVariable(
'ACTIONS', $this->
renderer->render($dropDown));
146 $booked_user_ids = $booking->getCurrentBookings($app->getEntryId());
147 $booked_user_ids = array_map(
'intval',
ilUtil::_sortIds($booked_user_ids,
'usr_data',
'lastname',
'usr_id'));
151 foreach ($booked_user_ids as
$user_id) {
152 if (!$user_counter) {
160 $data[
$counter][
'num_bookings'] = $booking->getNumberOfBookings();
166 $obj_ids = array_map(
168 ilUtil::_sortIds($booking->getTargetObjIds(),
'object_data',
'title',
'obj_id')
170 foreach ($obj_ids as $obj_id) {
177 $data[
$counter][
'target_links'][$refs_counter][
'link'] = ilLink::_getLink(end($refs));
Builds a Color from either hex- or rgb values.
static getAppointments(int $a_user_id)
Get all appointments.
Consultation hours administration.
fillRow(array $a_set)
@inheritDoc
__construct(object $a_gui, string $a_cmd, int $a_user_id)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
static _lookupFullname(int $a_user_id)
static _lookupName(int $a_user_id)
static _getPreferences(int $user_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
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)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
enable(string $a_module_name)
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
An entity that renders components to a string output.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc