19 declare(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));
91 if ($dateSelectInput->getDate() ===
null) {
100 $ilSelectInput->setOptions([
101 self::STATUS_ALL => $this->
language->txt(
'etal_status_all'),
102 self::STATUS_PENDING => $this->
language->txt(
'etal_status_pending'),
103 self::STATUS_COMPLETED => $this->
language->txt(
'etal_status_completed')
120 $this->
language->txt(
'date_of_talk'),
151 $talk_class = strtolower(ilObjEmployeeTalkGUI::class);
153 $class_path[] = $talk_class;
156 $this->
ctrl->setParameterByClass($talk_class,
'ref_id',
$ref_id);
157 $url = $this->
ctrl->getLinkTargetByClass($class_path, ControlFlowCommand::DEFAULT);
160 if ($this->talk_access->canEdit(
$ref_id)) {
161 $buttons[] = $this->ui_factory->link()->standard(
163 $this->
ctrl->getLinkTargetByClass($class_path, ControlFlowCommand::UPDATE)
166 $buttons[] = $this->ui_factory->link()->standard(
168 $this->
ctrl->getLinkTargetByClass($class_path, ControlFlowCommand::INDEX)
172 if ($this->talk_access->canDelete(
$ref_id)) {
174 $a_set[
'etal_title'],
178 $buttons[] = $this->ui_factory->button()->shy(
181 )->withOnClick($modal->getShowSignal());
182 $this->delete_modals[] = $modal;
184 $this->
ctrl->clearParametersByClass($talk_class);
185 $actions = $this->ui_factory->dropdown()->standard(
$buttons)->withLabel(
189 $this->tpl->setVariable(
"HREF_ETAL_TITLE",
$url);
190 $this->tpl->setVariable(
"VAL_ETAL_TITLE", $a_set[
'etal_title']);
191 $this->tpl->setVariable(
"VAL_ETAL_TEMPLATE", $a_set[
'etal_template']);
193 $this->tpl->setVariable(
"VAL_ETAL_SUPERIOR", $a_set[
'etal_superior']);
194 $this->tpl->setVariable(
"VAL_ETAL_EMPLOYEE", $a_set[
'etal_employee']);
195 $this->tpl->setVariable(
"VAL_ETAL_STATUS", $a_set[
'etal_status']);
196 $this->tpl->setVariable(
"ACTIONS", $this->ui_renderer->render($actions));
204 foreach ($talks as $val) {
209 if (trim($filter[
'etal_employee']) !==
"") {
211 if ($val->getEmployee() !== $filterUser) {
218 $talkData = $talk->getData();
219 $employeeName = $this->
language->txt(
'etal_unknown_username');
220 $superiorName = $this->
language->txt(
'etal_unknown_username');
221 $ownerId = $talk->getOwner();
229 if (trim($filter[
'etal_superior']) !==
"") {
231 if ($talk->getOwner() !== $filterUser) {
236 if (trim($filter[
'etal_title']) !==
"") {
237 if (strpos(strtolower($talk->getTitle()), strtolower(trim($filter[
'etal_title']))) ===
false) {
242 if ($filter[
'etal_date'] !==
false && $filter[
'etal_date'] !==
null && $filter[
'etal_date'] !==
'') {
250 if ($filter[
'etal_status'] !==
"" && intval($filter[
'etal_status'] !== 0)) {
252 if ($filterCompleted && !$val->isCompleted()) {
256 if (!$filterCompleted && $val->isCompleted()) {
261 $template_title =
'';
262 if ($talkData->getTemplateId() > 0 &&
ilObject::_exists($talkData->getTemplateId())) {
264 $template_title = $template->getTitle();
266 if (trim($filter[
'etal_template']) !==
"") {
267 if (strpos(strtolower($template_title), strtolower(trim($filter[
'etal_template']))) ===
false) {
273 "ref_id" => $talk->getRefId(),
274 "etal_title" => $talk->getTitle(),
275 "etal_template" => $template_title,
276 "etal_date" => $talkData->getStartDate(),
277 "etal_superior" => $superiorName,
278 "etal_employee" => $employeeName,
279 "etal_status" => $talkData->isCompleted() ? $this->
language->txt(
'etal_status_completed') : $this->
language->txt(
'etal_status_pending'),
280 "permission_write" =>
false,
281 "permission_delete" => false
299 $item = $this->ui_factory->modal()->interruptiveItem()->standard(
300 (
string) $talk_ref_id,
304 return $this->ui_factory->modal()->interruptive(
306 $this->
language->txt(
'etal_delete_confirmation_msg'),
308 )->withAffectedItems([$item]);
313 return parent::getHTML() . $this->ui_renderer->render($this->delete_modals);
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
static _getAllReferences(int $id)
get all reference ids for object ID
setDisableFilterHiding(bool $a_val=true)
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
setFormName(string $a_name="")
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getUserIdByLogin(string $a_login)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setDefaultOrderField(string $a_defaultorderfield)
setTalkData(array $talks)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
getConfirmationModal(string $talk_title, int $talk_ref_id, string $action)
setDefaultOrderDirection(string $a_defaultorderdirection)
ilObjEmployeeTalkAccess $talk_access
array $delete_modals
InterruptiveModal[].
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static _equals(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
Check if two date are equal.
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)
getCurrentState()
get current settings for order, limit, columns and filter
language()
description: > Example for rendring a language glyph.
__construct(ControlFlowCommandHandler $a_parent_obj, $a_parent_cmd='')
setDefaultFilterVisiblity(bool $a_status)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
setFilterCols(int $a_val)
const int STATUS_COMPLETED
setExternalSegmentation(bool $a_val)
static _lookupLogin(int $a_user_id)
setPrefix(string $a_prefix)