|
| __construct (protected ilCourseParticipantsGroupsTableDataRetrieval $data_retrieval, protected ilUIServices $ui_services, protected ilUIService $ui_service, protected ilHTTPServices $http_services, protected ilRefineryFactory $refinery, protected ilLanguage $lng, protected ilCtrl $ctrl, protected ilDataFactory $data_factory, protected ilGlobalTemplateInterface $tpl, protected ilAccess $access, protected ilObjectDataCache $object_data_cache) |
|
| getHTML () |
|
| handleCommands () |
|
◆ __construct()
ilCourseParticipantsGroupsTableGUI::__construct |
( |
protected ilCourseParticipantsGroupsTableDataRetrieval |
$data_retrieval, |
|
|
protected ilUIServices |
$ui_services, |
|
|
protected ilUIService |
$ui_service, |
|
|
protected ilHTTPServices |
$http_services, |
|
|
protected ilRefineryFactory |
$refinery, |
|
|
protected ilLanguage |
$lng, |
|
|
protected ilCtrl |
$ctrl, |
|
|
protected ilDataFactory |
$data_factory, |
|
|
protected ilGlobalTemplateInterface |
$tpl, |
|
|
protected ilAccess |
$access, |
|
|
protected ilObjectDataCache |
$object_data_cache |
|
) |
| |
◆ addToGroup()
ilCourseParticipantsGroupsTableGUI::addToGroup |
( |
array |
$user_ids, |
|
|
int |
$group_ref_id |
|
) |
| |
|
protected |
Definition at line 182 of file class.ilCourseParticipantsGroupsTableGUI.php.
References $message, ilGroupParticipants\_getInstanceByObjId(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilParticipants\IL_GRP_MEMBER, ILIAS\Repository\lng(), and ilGroupMembershipMailNotification\TYPE_ADMISSION_MEMBER.
Referenced by handleCommands().
184 if (!$this->
access->checkRbacOrPositionPermissionAccess(
'manage_members',
'manage_members', $group_ref_id)) {
185 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
186 $this->
ctrl->redirectByClass(ilCourseParticipantsGroupsGUI::class,
'show');
191 foreach ($user_ids as $new_member) {
196 $members_obj->sendNotification(
201 if ($rejected_count === 0) {
202 $message = $this->
lng->txt(
'grp_msg_member_assigned');
204 $accepted_count = count($user_ids) - $rejected_count;
206 $this->
lng->txt(
'grp_not_all_users_assigned_msg'),
211 $this->tpl->setOnScreenMessage(
'success',
$message,
true);
212 $this->
ctrl->redirectByClass(ilCourseParticipantsGroupsGUI::class,
'show');
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
const TYPE_ADMISSION_MEMBER
◆ buildAddToGroupString()
ilCourseParticipantsGroupsTableGUI::buildAddToGroupString |
( |
int |
$group_ref_id | ) |
|
|
protected |
◆ getActions()
ilCourseParticipantsGroupsTableGUI::getActions |
( |
| ) |
|
|
protected |
Definition at line 99 of file class.ilCourseParticipantsGroupsTableGUI.php.
References $ref_id, $row_id_token, buildAddToGroupString(), and ILIAS\Repository\lng().
Referenced by initTable().
101 $this->url_builder =
new URLBuilder($this->data_factory->uri($this->http_services->request()->getUri()->__toString()));
102 list($this->url_builder, $this->action_parameter_token, $this->row_id_token) =
103 $this->url_builder->acquireParameters(
104 [
'datatable', self::TABLE_ID],
105 self::TABLE_ACTION_ID,
109 foreach ($this->data_retrieval->getSelectableGroups() as
$ref_id => $group_name) {
111 $actions[$action_id] = $this->ui_services->factory()->table()->action()->multi(
112 $this->
lng->txt(self::LNG_ADD_TO_GROUP) .
': ' . $group_name,
113 $this->url_builder->withParameter($this->action_parameter_token, $action_id),
116 $action_id = $this->data_retrieval->buildConfirmUnsubscribeActionId((
int) $ref_id);
117 $actions[$action_id] = $this->ui_services->factory()->table()->action()->single(
118 $group_name .
' ' . $this->
lng->txt(self::LNG_TABLE_ACTION_CONFIRM_UNSUBSCRIBE),
119 $this->url_builder->withParameter($this->action_parameter_token, $action_id),
ilURLBuilderToken $row_id_token
buildAddToGroupString(int $group_ref_id)
◆ getColumns()
ilCourseParticipantsGroupsTableGUI::getColumns |
( |
| ) |
|
|
protected |
Definition at line 81 of file class.ilCourseParticipantsGroupsTableGUI.php.
References ILIAS\Repository\lng().
Referenced by initTable().
84 self::TABLE_COL_NAME => $this->ui_services->factory()->table()->column()->text(
85 $this->
lng->txt(self::LNG_TABLE_COL_NAME)
87 self::TABLE_COL_LOGIN => $this->ui_services->factory()->table()->column()->text(
88 $this->
lng->txt(self::LNG_TABLE_COL_LOGIN)
90 self::TABLE_COL_GROUP_NUMBER => $this->ui_services->factory()->table()->column()->number(
91 $this->
lng->txt(self::LNG_TABLE_COL_GROUP_NUMBER)
93 self::TABLE_COL_GROUPS => $this->ui_services->factory()->table()->column()->text(
94 $this->
lng->txt(self::LNG_TABLE_COL_GROUPS)
95 )->withIsSortable(
false)
◆ getFilterFields()
ilCourseParticipantsGroupsTableGUI::getFilterFields |
( |
| ) |
|
|
protected |
- Returns
- []
Definition at line 145 of file class.ilCourseParticipantsGroupsTableGUI.php.
References ILIAS\Repository\lng().
Referenced by initFilter().
148 self::TABLE_FILTER_NAME => $this->ui_services->factory()->input()->field()->text(
149 $this->
lng->txt(self::LNG_TABLE_COL_NAME)
151 self::TABLE_FILTER_GROUPS => $this->ui_services->factory()->input()->field()->select(
152 $this->
lng->txt(self::TABLE_COL_GROUPS),
153 $this->data_retrieval->getSelectableGroups()
◆ getHTML()
ilCourseParticipantsGroupsTableGUI::getHTML |
( |
| ) |
|
◆ handleCommands()
ilCourseParticipantsGroupsTableGUI::handleCommands |
( |
| ) |
|
Definition at line 272 of file class.ilCourseParticipantsGroupsTableGUI.php.
References $ref_id, addToGroup(), buildAddToGroupString(), initTable(), readIdsFromQuery(), ILIAS\Repository\refinery(), and unsubscribe().
275 if (!$this->http_services->wrapper()->query()->has($this->action_parameter_token->getName())) {
278 $action = $this->http_services->wrapper()->query()->retrieve(
279 $this->action_parameter_token->getName(),
282 $tokens = $this->http_services->wrapper()->query()->retrieve(
283 $this->row_id_token->getName(),
284 $this->
refinery->custom()->transformation(fn($v) => $v)
286 $all_entries = ($tokens[0] ??
"") === self::ALL_OBJECTS;
289 $user_ids = $this->data_retrieval->getAllUserIds();
294 foreach ($this->data_retrieval->getSelectableGroups() as
$ref_id => $group_name) {
299 if ($action === $this->data_retrieval->buildUnsubscribeActionId($ref_id)) {
303 if ($action === $this->data_retrieval->buildConfirmUnsubscribeActionId($ref_id)) {
304 $this->showConfirmUnsubscribeModal($user_ids, $ref_id);
addToGroup(array $user_ids, int $group_ref_id)
unsubscribe(array $user_ids, int $group_id)
buildAddToGroupString(int $group_ref_id)
◆ initFilter()
ilCourseParticipantsGroupsTableGUI::initFilter |
( |
| ) |
|
|
private |
Definition at line 126 of file class.ilCourseParticipantsGroupsTableGUI.php.
References ILIAS\Repository\ctrl(), ILIAS\Repository\filter(), and getFilterFields().
Referenced by getHTML().
128 if (isset($this->
filter)) {
132 $this->
filter = $this->ui_service->filter()->standard(
134 $this->
ctrl->getLinkTargetByClass(ilCourseParticipantsGroupsGUI::class,
'show'),
136 array_fill(0, count($filter_fields),
true),
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
◆ initTable()
ilCourseParticipantsGroupsTableGUI::initTable |
( |
| ) |
|
|
protected |
◆ readIdsFromQuery()
ilCourseParticipantsGroupsTableGUI::readIdsFromQuery |
( |
| ) |
|
|
protected |
◆ unsubscribe()
ilCourseParticipantsGroupsTableGUI::unsubscribe |
( |
array |
$user_ids, |
|
|
int |
$group_id |
|
) |
| |
|
protected |
Definition at line 215 of file class.ilCourseParticipantsGroupsTableGUI.php.
References $user_id, ilGroupParticipants\_getInstanceByObjId(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilGroupMembershipMailNotification\TYPE_DISMISS_MEMBER.
Referenced by handleCommands().
218 if (!$this->
access->checkRbacOrPositionPermissionAccess(
'manage_members',
'manage_members', $group_id)) {
219 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
220 $this->
ctrl->redirectByClass(ilCourseParticipantsGroupsGUI::class,
'show');
224 $members_obj->delete((
int) $user_id);
226 $members_obj->sendNotification(
231 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"grp_msg_membership_annulled"),
true);
232 $this->
ctrl->redirectByClass(ilCourseParticipantsGroupsGUI::class,
"show");
235 #[NoReturn] protected function showConfirmUnsubscribeModal(array $user_ids, int $group_ref_id): void 238 foreach ($user_ids as $user_id) {
239 $items[] = $this->ui_services->factory()->modal()->interruptiveItem()->standard(
242 $this->ui_services->factory()->image()->standard(
ilUtil::getImagePath(
'standard/icon_usr.svg'),
'')
const TYPE_DISMISS_MEMBER
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
◆ $action_parameter_token
ilURLBuilderToken ilCourseParticipantsGroupsTableGUI::$action_parameter_token |
|
protected |
◆ $filter
ilFilter ilCourseParticipantsGroupsTableGUI::$filter |
|
protected |
◆ $row_id_token
ilURLBuilderToken ilCourseParticipantsGroupsTableGUI::$row_id_token |
|
protected |
◆ $table
ilDataTable ilCourseParticipantsGroupsTableGUI::$table |
|
protected |
◆ $url_builder
URLBuilder ilCourseParticipantsGroupsTableGUI::$url_builder |
|
protected |
◆ ALL_OBJECTS
const string ilCourseParticipantsGroupsTableGUI::ALL_OBJECTS = 'ALL_OBJECTS' |
|
protected |
◆ FILTER_ID
const string ilCourseParticipantsGroupsTableGUI::FILTER_ID = 'crsprtcpntsgrpstbl_filter' |
|
protected |
◆ foreach
ilCourseParticipantsGroupsTableGUI::foreach($user_ids as $user_id) |
◆ LNG_ADD_TO_GROUP
const string ilCourseParticipantsGroupsTableGUI::LNG_ADD_TO_GROUP = 'crs_add_to_group' |
|
protected |
◆ LNG_TABLE_ACTION_CONFIRM_UNSUBSCRIBE
const string ilCourseParticipantsGroupsTableGUI::LNG_TABLE_ACTION_CONFIRM_UNSUBSCRIBE = 'grp_unsubscribe' |
|
protected |
◆ LNG_TABLE_COL_GROUP_NUMBER
const string ilCourseParticipantsGroupsTableGUI::LNG_TABLE_COL_GROUP_NUMBER = 'crs_groups_nr' |
|
protected |
◆ LNG_TABLE_COL_GROUPS
const string ilCourseParticipantsGroupsTableGUI::LNG_TABLE_COL_GROUPS = 'groups' |
|
protected |
◆ LNG_TABLE_COL_LOGIN
const string ilCourseParticipantsGroupsTableGUI::LNG_TABLE_COL_LOGIN = 'login' |
|
protected |
◆ LNG_TABLE_COL_NAME
const string ilCourseParticipantsGroupsTableGUI::LNG_TABLE_COL_NAME = 'name' |
|
protected |
◆ LNG_TABLE_TITLE
const string ilCourseParticipantsGroupsTableGUI::LNG_TABLE_TITLE = 'crs_grp_assignments' |
|
protected |
◆ ROW_ID
const string ilCourseParticipantsGroupsTableGUI::ROW_ID = 'row_ids' |
|
protected |
◆ TABLE_ACTION_ADD_TO_GROUP
const string ilCourseParticipantsGroupsTableGUI::TABLE_ACTION_ADD_TO_GROUP = 'add_to_group' |
|
protected |
◆ TABLE_ACTION_ID
const string ilCourseParticipantsGroupsTableGUI::TABLE_ACTION_ID = 'table_action' |
|
protected |
◆ TABLE_COL_GROUP_NUMBER
const string ilCourseParticipantsGroupsTableGUI::TABLE_COL_GROUP_NUMBER = 'groups_number' |
◆ TABLE_COL_GROUPS
const string ilCourseParticipantsGroupsTableGUI::TABLE_COL_GROUPS = 'groups' |
◆ TABLE_COL_LOGIN
const string ilCourseParticipantsGroupsTableGUI::TABLE_COL_LOGIN = 'login' |
◆ TABLE_COL_NAME
const string ilCourseParticipantsGroupsTableGUI::TABLE_COL_NAME = 'name' |
◆ TABLE_FILTER_GROUPS
const string ilCourseParticipantsGroupsTableGUI::TABLE_FILTER_GROUPS = 'filter_groups' |
◆ TABLE_FILTER_NAME
const string ilCourseParticipantsGroupsTableGUI::TABLE_FILTER_NAME = 'filter_name' |
◆ TABLE_ID
const string ilCourseParticipantsGroupsTableGUI::TABLE_ID = 'crsprtcpntsgrpstbl' |
|
protected |
The documentation for this class was generated from the following file: