3 declare(strict_types=1);
21 public function __construct(
object $a_parent_obj,
string $a_parent_cmd,
int $a_user_id)
25 $this->user_id = $a_user_id;
26 $this->
setId(
'chgrp_' . $this->user_id);
29 $this->renderer = $DIC->ui()->renderer();
30 $this->uiFactory = $DIC->ui()->factory();
40 $this->
setRowTemplate(
'tpl.ch_group_row.html',
'Services/Calendar');
46 $this->
addColumn($this->
lng->txt(
'cal_ch_assigned_apps'),
'apps');
47 $this->
addColumn($this->
lng->txt(
'cal_ch_max_books'),
'max_books');
59 protected function fillRow(array $a_set): void
61 $this->tpl->setVariable(
'TITLE', $a_set[
'title']);
62 $this->tpl->setVariable(
'MAX_BOOKINGS', $a_set[
'max_books']);
63 $this->tpl->setVariable(
'ASSIGNED', $a_set[
'assigned']);
65 $dropDownItems[] = array();
69 $dropDownItems[] = $this->uiFactory->button()->shy(
70 $this->
lng->txt(
'edit'),
75 if ($a_set[
'assigned']) {
76 $dropDownItems[] = $this->uiFactory->button()->shy(
77 $this->
lng->txt(
'cal_ch_assign_participants'),
78 $this->
ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'')
82 $dropDownItems[] = $this->uiFactory->button()->shy(
83 $this->
lng->txt(
'delete'),
86 $dropDown = $this->uiFactory->dropdown()->standard($dropDownItems)
87 ->withLabel($this->
lng->txt(
'actions'));
88 $this->tpl->setVariable(
'ACTIONS', $this->renderer->render($dropDown));
95 public function parse(array $groups): void
99 foreach ($groups as $group) {
100 $rows[$counter][
'id'] = $group->getGroupId();
101 $rows[$counter][
'title'] = $group->getTitle();
102 $rows[$counter][
'max_books'] = $group->getMaxAssignments();
103 $rows[$counter][
'assigned'] = count(
106 $group->getGroupId(),
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_user_id)
UIImplementationFactory $uiFactory
setDefaultOrderField(string $a_defaultorderfield)
static getAppointmentIdsByGroup(int $a_user_id, int $a_ch_group_id, ?ilDateTime $start=null)
Get appointment ids by consultation hour group.
parse(array $groups)
Parse Groups.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
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)