19declare(strict_types=1);
46 bool $show_content =
true,
54 $this->
renderer = $DIC->ui()->renderer();
55 $this->uiFactory =
$DIC->ui()->factory();
56 $this->
profile = $DIC[
'user']->getProfile();
58 $this->
lng->loadLanguageModule(
'grp');
59 $this->
lng->loadLanguageModule(
'crs');
65 $this->
addColumn($this->
lng->txt(
'name'),
'lastname',
'20%');
70 $all_cols[$col][
'txt'],
76 $this->
addColumn($this->
lng->txt(
'application_date'),
'sub_time');
77 $this->
addColumn($this->
lng->txt(
'message'),
'subject',
'40%');
79 $this->
addColumn($this->
lng->txt(
'application_date'),
'sub_time');
83 $this->
addMultiCommand(
'confirmAssignSubscribers', $this->
lng->txt(
'sess_accept_request'));
88 $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->
lng->txt(
'crs_mem_send_mail'));
91 $this->
lng->loadLanguageModule(
'user');
97 $this->
setRowTemplate(
"tpl.show_subscribers_row.html",
"components/ILIAS/Membership");
103 $this->
enable(
'select_all');
123 if (self::$all_columns) {
128 self::$all_columns[
'login'] = [
129 'txt' => $this->
lng->txt(
'login'),
139 is_array(self::$all_columns) &&
140 array_key_exists(
'consultation_hour', self::$all_columns)
142 unset(self::$all_columns[
'consultation_hour']);
147 protected function fillRow(array $a_set): void
152 $this->tpl->setVariable(
160 $this->tpl->setVariable(
'VAL_ID', $a_set[
'usr_id']);
161 $this->tpl->setVariable(
'VAL_NAME', $a_set[
'lastname'] .
', ' . $a_set[
'firstname']);
166 $a_set[
'gender'] = $a_set[
'gender'] ? $this->
lng->txt(
'gender_' . $a_set[
'gender']) :
'';
167 $this->tpl->setCurrentBlock(
'custom_fields');
168 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
169 $this->tpl->parseCurrentBlock();
176 )) : $this->
lng->txt(
'no_date');
177 $this->tpl->setCurrentBlock(
'custom_fields');
178 $this->tpl->setVariable(
'VAL_CUST', $a_set[$field]);
179 $this->tpl->parseCurrentBlock();
182 case 'odf_last_update':
183 $this->tpl->setVariable(
'VAL_CUST', (
string) ($a_set[
'odf_info_txt'] ??
''));
187 $this->tpl->setCurrentBlock(
'custom_fields');
188 $this->tpl->setVariable(
190 ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((
int) $a_set[
'usr_id'])
192 $this->tpl->parseCurrentBlock();
196 $this->tpl->setCurrentBlock(
'custom_fields');
197 $this->tpl->setVariable(
'VAL_CUST', isset($a_set[$field]) ? (
string) $a_set[$field] :
'');
198 $this->tpl->parseCurrentBlock();
203 $this->tpl->setVariable(
209 if (strlen($a_set[
'subject'])) {
210 $this->tpl->setCurrentBlock(
'subject');
211 $this->tpl->setVariable(
'VAL_SUBJECT',
'"' . $a_set[
'subject'] .
'"');
212 $this->tpl->parseCurrentBlock();
214 $this->tpl->touchBlock(
'subject');
224 $this->
ctrl->setParameterByClass(get_class($this->
getParentObject()),
'member_id', $a_set[
'usr_id']);
225 $this->
ctrl->setParameter($this->parent_obj,
'member_id', $a_set[
'usr_id']);
227 $dropDownItems = array();
228 $dropDownItems[] = $this->uiFactory->button()->shy(
229 $this->
lng->txt($this->getRepositoryObject()->getType() .
'_mem_send_mail'),
230 $this->ctrl->getLinkTargetByClass(get_class($this->
getParentObject()),
'sendMailToSelectedUsers')
233 if (self::$has_odf_definitions) {
234 $this->
ctrl->setParameterByClass(
'ilobjectcustomuserfieldsgui',
'member_id', $a_set[
'usr_id']);
235 $dropDownItems[] = $this->uiFactory->button()->shy(
236 $this->
lng->txt($this->getRepositoryObject()->getType() .
'_cdf_edit_member'),
237 $this->ctrl->getLinkTargetByClass(
'ilobjectcustomuserfieldsgui',
'editMember')
241 $dropDown = $this->uiFactory->dropdown()->standard($dropDownItems)
242 ->withLabel($this->
lng->txt(
'actions'));
243 $this->tpl->setVariable(
'ACTION_USER', $this->
renderer->render($dropDown));
255 $sub_ids = $sub_data = [];
256 foreach ($a_subscriber_ids as $usr_id) {
257 $sub_ids[] = $usr_id;
258 $sub_data[$usr_id] = $subscriber_data[$usr_id];
265 $additional_fields[
"firstname"],
266 $additional_fields[
"lastname"],
267 $additional_fields[
"last_login"],
268 $additional_fields[
"access_until"],
269 $additional_fields[
'org_units']
272 $udf_ids = $usr_data_fields = $odf_ids = array();
273 foreach ($additional_fields as $field) {
274 if (strpos($field,
'udf') === 0) {
275 $udf_ids[] = substr($field, 4);
278 if (strpos($field,
'odf') === 0) {
279 $odf_ids[] = substr($field, 4);
283 $usr_data_fields[] = $field;
304 foreach ((array) $usr_data[
'set'] as $user) {
305 $usr_ids[] = $user[
'usr_id'];
309 $course_user_data = $this->
getParentObject()->readMemberData($usr_ids, array());
310 $a_user_data = array();
311 foreach ((array) $usr_data[
'set'] as $ud) {
312 $a_user_data[$ud[
'usr_id']] = array_merge($ud, (array) $course_user_data[$ud[
'usr_id']]);
316 if (is_array($udf_ids)) {
317 $a_user_data = array_reduce(
318 $this->
profile->getDataForMultiple($usr_ids),
319 function (array
$c, ProfileData $v) use ($udf_ids): array {
324 foreach ($udf_ids as $field_id) {
325 $c[$v->getId()][
'udf_' . $field_id] = $v->getAdditionalFieldByIdentifier($field_id);
332 if (is_array($odf_ids)) {
334 foreach (
$data as $usr_id => $fields) {
336 if (!$this->
checkAcceptance($usr_id) || !in_array($usr_id, $usr_ids)) {
340 foreach ($fields as $field_id => $value) {
341 $a_user_data[$usr_id][
'odf_' . $field_id] = $value;
347 if (!isset($a_user_data[$usr_id])) {
351 if ($usr_id == $edit_info[
'update_user']) {
352 $a_user_data[$usr_id][
'odf_last_update'] =
'';
353 $a_user_data[$usr_id][
'odf_info_txt'] =
$GLOBALS[
'DIC'][
'lng']->txt(
'cdf_edited_by_self');
355 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_' . $edit_info[
'editing_time']->get(
IL_CAL_UNIX));
359 $a_user_data[$usr_id][
'odf_last_update'] = $edit_info[
'update_user'];
360 $a_user_data[$usr_id][
'odf_last_update'] .= (
'_' . $edit_info[
'editing_time']->get(
IL_CAL_UNIX));
363 $a_user_data[$usr_id][
'odf_info_txt'] = ($name[
'firstname'] .
' ' . $name[
'lastname'] .
', ' .
ilDatePresentation::formatDate($edit_info[
'editing_time']));
368 foreach ($usr_data[
'set'] as $user) {
374 foreach ($usr_data_fields as $field) {
375 $a_user_data[$user[
'usr_id']][$field] = $user[$field] ?:
'';
380 foreach ($sub_data as $usr_id => $usr_data) {
381 if (!in_array($usr_id, $usr_ids)) {
384 $a_user_data[$usr_id][
'sub_time'] = $usr_data[
'time'];
385 $a_user_data[$usr_id][
'subject'] = $usr_data[
'subject'];
399 $this->show_subject = $a_value;
Builds a Color from either hex- or rgb values.
static _hasFields(int $a_container_id)
Check if there are any define fields.
static _getValuesByObjId(int $a_obj_id)
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 _getInstanceByType(string $a_type)
Get Singleton Instance.
static _checkGroupingDependencies(ilObject $container_obj, ?int $a_user_id=null)
static getAssignedObjects()
static _lookupName(int $a_user_id)
static lookupEntriesByObjectId(int $a_obj_id)
Class ilObject Basic functions for all objects.
static _lookupTitle(int $obj_id)
static lookupSubscribersData(int $a_obj_id)
GUI class for course/group subscriptions.
__construct(object $a_parent_obj, ilObject $rep_object, bool $show_content=true, bool $show_subject=true)
static bool $has_odf_definitions
getSelectableColumns()
Get selectable columns.
setShowSubject(bool $a_value)
showActionLinks(array $a_set)
Show action links (mail ; edit crs|grp data)
readSubscriberData(array $a_subscriber_ids)
read data @access protected
static array $all_columns
fillRow(array $a_set)
Standard Version of Fill Row.
checkAcceptance(int $a_usr_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
determineOffsetAndOrder(bool $a_omit_offset=false)
setExternalSegmentation(bool $a_val)
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
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)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
enable(string $a_module_name)
disable(string $a_module_name)
setMaxCount(int $a_max_count)
set max.
static getUserListData(string $a_order_field, string $a_order_dir, int $a_offset, int $a_limit, string $a_string_filter="", string $a_activation_filter="", ?ilDateTime $a_last_login_filter=null, bool $a_limited_access_filter=false, bool $a_no_courses_filter=false, int $a_course_group_filter=0, int $a_role_filter=0, ?array $a_user_folder_filter=null, ?array $a_additional_fields=null, ?array $a_user_filter=null, string $a_first_letter="", string $a_authentication_filter="")
Get data for user administration list.
An entity that renders components to a string output.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc