Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter courses and groups on "right to leave" in unsubscribe multiple view for ILIAS 7 #4650

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,20 @@ public function manageObject()
$top_tb->setLeadingImage(ilUtil::getImagePath('arrow_upright.svg'), $this->lng->txt('actions'));

$button = ilSubmitButton::getInstance();
$grouped_items = $this->blockView->getItemGroups();
if ($this->viewSettings->isSelectedItemsViewActive()) {
$button->setCaption('remove');
} else {
$button->setCaption('pd_unsubscribe_memberships');
foreach ($grouped_items as $group) {
$items = $group->getItems();
$group->setItems([]);
iszmais marked this conversation as resolved.
Show resolved Hide resolved
foreach ($items as $item) {
if ($this->rbacsystem->checkAccess('leave', $item['ref_id'])) {
$group->pushItem($item);
}
}
}
}
$button->setCommand('confirmRemove');
$top_tb->addStickyItem($button);
Expand All @@ -528,7 +538,7 @@ public function manageObject()
$bot_tb->addStickyItem($button);
$bot_tb->setOpenFormTag(false);

return $top_tb->getHTML() . $this->renderManageList() . $bot_tb->getHTML();
return $top_tb->getHTML() . $this->renderManageList($grouped_items) . $bot_tb->getHTML();
}

/**
Expand Down Expand Up @@ -822,7 +832,7 @@ protected function getLegacyContent() : string
return $renderer->render($subs);
}

protected function renderManageList() : string
protected function renderManageList(array $grouped_items) : string
{
$ui = $this->ui;

Expand All @@ -849,11 +859,7 @@ protected function renderManageList() : string
}
}

$grouped_items = $this->blockView->getItemGroups();

$renderer = new ilDashObjectsTableRenderer($this);

return $renderer->render($grouped_items);
return (new ilDashObjectsTableRenderer($this))->render($grouped_items);
}

/**
Expand Down