19declare(strict_types=1);
48 $this->ui_factory =
$DIC->ui()->factory();
49 $this->ui_renderer =
$DIC->ui()->renderer();
51 $this->
language->loadLanguageModule(
'etal');
52 $this->
language->loadLanguageModule(
'orgu');
56 $this->
setId(
'myst_etal_list');
59 $this->
setRowTemplate(
'tpl.list_employee_talk_row.html',
"components/ILIAS/EmployeeTalk");
60 $this->
setFormAction($DIC->ctrl()->getFormAction($a_parent_obj));
86 if ($dateSelectInput->getDate() ===
null) {
95 $ilSelectInput->setOptions([
96 self::STATUS_ALL => $this->
language->txt(
'etal_status_all'),
97 self::STATUS_PENDING => $this->language->txt(
'etal_status_pending'),
98 self::STATUS_COMPLETED => $this->language->txt(
'etal_status_completed')
115 $this->
language->txt(
'date_of_talk'),
146 $talk_class = strtolower(ilObjEmployeeTalkGUI::class);
148 $class_path[] = $talk_class;
151 $this->
ctrl->setParameterByClass($talk_class,
'ref_id',
$ref_id);
155 if ($this->talk_access->canEdit(
$ref_id)) {
156 $buttons[] = $this->ui_factory->link()->standard(
158 $this->ctrl->getLinkTargetByClass($class_path, ControlFlowCommand::UPDATE)
161 $buttons[] = $this->ui_factory->link()->standard(
163 $this->ctrl->getLinkTargetByClass($class_path, ControlFlowCommand::INDEX)
167 if ($this->talk_access->canDelete(
$ref_id)) {
169 $a_set[
'etal_title'],
173 $buttons[] = $this->ui_factory->button()->shy(
176 )->withOnClick($modal->getShowSignal());
177 $this->delete_modals[] = $modal;
179 $this->
ctrl->clearParametersByClass($talk_class);
180 $actions = $this->ui_factory->dropdown()->standard(
$buttons)->withLabel(
184 $this->tpl->setVariable(
"HREF_ETAL_TITLE",
$url);
185 $this->tpl->setVariable(
"VAL_ETAL_TITLE", $a_set[
'etal_title']);
186 $this->tpl->setVariable(
"VAL_ETAL_TEMPLATE", $a_set[
'etal_template']);
188 $this->tpl->setVariable(
"VAL_ETAL_SUPERIOR", $a_set[
'etal_superior']);
189 $this->tpl->setVariable(
"VAL_ETAL_EMPLOYEE", $a_set[
'etal_employee']);
190 $this->tpl->setVariable(
"VAL_ETAL_STATUS", $a_set[
'etal_status']);
191 $this->tpl->setVariable(
"ACTIONS", $this->ui_renderer->render($actions));
197 foreach ($talks as $val) {
204 if ($val->getEmployee() !== $filterUser) {
211 $talkData = $talk->getData();
212 $employeeName = $this->
language->txt(
'etal_unknown_username');
213 $superiorName = $this->
language->txt(
'etal_unknown_username');
214 $ownerId = $talk->getOwner();
224 if ($talk->getOwner() !== $filterUser) {
230 if (strpos(strtolower($talk->getTitle()), strtolower(trim($title_filter))) ===
false) {
245 $status_filter !==
'0'
248 if ($filterCompleted && !$val->isCompleted()) {
252 if (!$filterCompleted && $val->isCompleted()) {
257 $template_title =
'';
258 if ($talkData->getTemplateId() > 0 &&
ilObject::_exists($talkData->getTemplateId())) {
260 $template_title = $template->getTitle();
263 if (strpos(strtolower($template_title), strtolower(trim($template_filter))) ===
false) {
269 "ref_id" => $talk->getRefId(),
270 "etal_title" => $talk->getTitle(),
271 "etal_template" => $template_title,
272 "etal_date" => $talkData->getStartDate(),
273 "etal_superior" => $superiorName,
274 "etal_employee" => $employeeName,
275 "etal_status" => $talkData->isCompleted() ? $this->
language->txt(
'etal_status_completed') : $this->
language->txt(
'etal_status_pending'),
276 "permission_write" =>
false,
277 "permission_delete" => false
286 if ($item ===
null) {
296 ): InterruptiveModal {
297 $item = $this->ui_factory->
modal()->interruptiveItem()->
standard(
298 (string) $talk_ref_id,
302 return $this->ui_factory->modal()->interruptive(
304 $this->language->txt(
'etal_delete_confirmation_msg'),
306 )->withAffectedItems([$item]);
311 return parent::getHTML() . $this->ui_renderer->render($this->delete_modals);
Builds a Color from either hex- or rgb values.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _equals(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
Check if two date are equal.
getFilterValueByPostVar(string $post_var)
setTalkData(array $talks)
array $delete_modals
InterruptiveModal[].
getConfirmationModal(string $talk_title, int $talk_ref_id, string $action)
const int STATUS_COMPLETED
__construct(ControlFlowCommandHandler $a_parent_obj, $a_parent_cmd='')
ilObjEmployeeTalkAccess $talk_access
static getUserIdByLogin(string $a_login)
static _lookupLogin(int $a_user_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
static _getAllReferences(int $id)
get all reference ids for object ID
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
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.
getFilterItemByPostVar(string $a_post_var)
setEnableNumInfo(bool $a_val)
setEnableTitle(bool $a_enabletitle)
setFormName(string $a_name="")
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setPrefix(string $a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
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)
setDisableFilterHiding(bool $a_val=true)
getFilterValue(ilTableFilterItem $a_item)
Get current filter value.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setFilterCols(int $a_val)
setDefaultFilterVisiblity(bool $a_status)
setData(array $a_data)
Set table data.
An entity that renders components to a string output.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
modal(string $title="", string $cancel_label="")