Skip to content

Commit

Permalink
EmployeeTalk: make table filter case insensitive, ignore whitespace (…
Browse files Browse the repository at this point in the history
…43194)
  • Loading branch information
schmitz-ilias committed Dec 11, 2024
1 parent 7b904e6 commit 650e807
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ public function setTalkData(array $talks): void
continue;
}

if ($filter['etal_employee'] !== "") {
$filterUser = ilObjUser::getUserIdByLogin($filter['etal_employee']);
if (trim($filter['etal_employee']) !== "") {
$filterUser = ilObjUser::getUserIdByLogin(trim($filter['etal_employee']));
if ($val->getEmployee() !== $filterUser) {
continue;
}
Expand All @@ -226,15 +226,15 @@ public function setTalkData(array $talks): void
$employeeName = ilObjUser::_lookupLogin($talkData->getEmployee());
}

if ($filter['etal_superior'] !== "") {
$filterUser = ilObjUser::getUserIdByLogin($filter['etal_superior']);
if (trim($filter['etal_superior']) !== "") {
$filterUser = ilObjUser::getUserIdByLogin(trim($filter['etal_superior']));
if ($talk->getOwner() !== $filterUser) {
continue;
}
}

if ($filter['etal_title'] !== "") {
if (strpos($talk->getTitle(), $filter['etal_title']) === false) {
if (trim($filter['etal_title']) !== "") {
if (strpos(strtolower($talk->getTitle()), strtolower(trim($filter['etal_title']))) === false) {
continue;
}
}
Expand Down Expand Up @@ -263,8 +263,8 @@ public function setTalkData(array $talks): void
$template = ilObjectFactory::getInstanceByObjId($talkData->getTemplateId());
$template_title = $template->getTitle();
}
if ($filter['etal_template'] !== "") {
if (strpos($template_title, $filter['etal_template']) === false) {
if (trim($filter['etal_template']) !== "") {
if (strpos(strtolower($template_title), strtolower(trim($filter['etal_template']))) === false) {
continue;
}
}
Expand Down

0 comments on commit 650e807

Please sign in to comment.