19 declare(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');
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'),
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'),
128 $dropDown = $this->uiFactory->dropdown()->standard($dropDownItems)
129 ->withLabel($this->
lng->txt(
'actions'));
130 $this->tpl->setVariable(
'ACTIONS', $this->
renderer->render($dropDown));
138 $data[$counter][
'id'] = $app->getEntryId();
139 $data[$counter][
'title'] = $app->getTitle();
140 $data[$counter][
'description'] = $app->getDescription();
146 $booked_user_ids = $booking->getCurrentBookings($app->getEntryId());
149 $data[$counter][
'participants'] =
'';
151 foreach ($booked_user_ids as $user_id) {
152 if (!$user_counter) {
154 $data[$counter][
'participants'] = $name[
'lastname'];
159 $data[$counter][
'bookings'] = $users;
160 $data[$counter][
'num_bookings'] = $booking->getNumberOfBookings();
162 $data[$counter][
'group'] =
'';
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));
__construct(object $a_gui, string $a_cmd, int $a_user_id)
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
static _lookupFullname(int $a_user_id)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
static _getPreferences(int $user_id)
get preferences for user
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupName(int $a_user_id)
lookup user name
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
static _lookupTitle(int $obj_id)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
Consultation hours administration.
static getAppointments(int $a_user_id)
Get all appointments.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
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,7),'usr_data','lastname','usr_id') => sorts by lastname.
__construct(Container $dic, ilPlugin $plugin)
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)
addMultiCommand(string $a_cmd, string $a_text)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.