18 declare(strict_types=1);
64 $this->
setId(
'myst_lu');
68 $this->uiFactory = $DIC->ui()->factory();
69 $this->uiRenderer = $DIC->ui()->renderer();
72 $this->
setRowTemplate(
'tpl.list_users_row.html',
"Services/MyStaff");
73 $this->
setFormAction($DIC->ctrl()->getFormAction($parent_obj));
103 $arr_usr_id = $this->
access->getUsersForUser($DIC->user()->getId());
106 'filters' => $this->
filter,
118 $result = $list_users_fetcher->getData($arr_usr_id, $options);
120 $this->
setMaxCount($result->getTotalDatasetCount());
121 $data = $result->getDataset();
136 $DIC->language()->txt(
"login") .
"/" . $DIC->language()->txt(
"email") .
"/" . $DIC->language()
141 $item->readFromSession();
142 $this->
filter[
'user'] = $item->getValue();
146 $options[0] = $DIC->language()->txt(
'mst_opt_all');
147 foreach ($paths as $org_ref_id =>
$path) {
148 $options[$org_ref_id] =
$path;
150 $item =
new ilSelectInputGUI($DIC->language()->txt(
'obj_orgu'),
'org_unit');
151 $item->setOptions($options);
152 $item->addCustomAttribute(
"style='width:100%'");
154 $item->readFromSession();
155 $this->
filter[
'org_unit'] = $item->getValue();
161 if ($this->selectable_columns_cached) {
170 $arr_fields_without_table_sort = array(
173 'interests_help_offered',
174 'interests_help_looking',
179 if (!in_array(
$key, $arr_fields_without_table_sort)) {
185 foreach ($user_defined_fields->getDefinitions() as $field => $definition) {
186 unset(
$cols[
"udf_" . $field]);
203 $sort = $v[
'sort_field'] ??
"";
209 $this->
addColumn($DIC->language()->txt(
'actions'));
215 if (isset($this->usr_orgu_names[$user_id])) {
216 return $this->usr_orgu_names[$user_id];
219 return $this->usr_orgu_names[$user_id] = \ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
228 final protected function fillRow(array $a_set): void
232 $set = array_pop($a_set);
234 $propGetter = Closure::bind(
function ($prop) {
235 return $this->$prop ?? null;
239 $this->tpl->setCurrentBlock(
'user_profile_picture');
240 $il_obj_user = $set->returnIlUserObj();
241 $avatar = $this->uiFactory->image()->standard($il_obj_user->getPersonalPicturePath(
'small'), $il_obj_user->getPublicName());
242 $this->tpl->setVariable(
'user_profile_picture', $this->uiRenderer->render($avatar));
243 $this->tpl->parseCurrentBlock();
248 $this->tpl->setCurrentBlock(
'td');
249 $this->tpl->setVariable(
253 $this->tpl->parseCurrentBlock();
256 $this->tpl->setCurrentBlock(
'td');
257 $this->tpl->setVariable(
'VALUE', $DIC->language()->txt(
'gender_' . $set->getGender()));
258 $this->tpl->parseCurrentBlock();
260 case 'interests_general':
261 $this->tpl->setCurrentBlock(
'td');
262 $this->tpl->setVariable(
'VALUE', ($set->returnIlUserObj()
263 ->getGeneralInterestsAsText() ? $set->returnIlUserObj()->getGeneralInterestsAsText() :
' '));
264 $this->tpl->parseCurrentBlock();
266 case 'interests_help_offered':
267 $this->tpl->setCurrentBlock(
'td');
268 $this->tpl->setVariable(
'VALUE', ($set->returnIlUserObj()
269 ->getOfferingHelpAsText() ? $set->returnIlUserObj()->getOfferingHelpAsText() :
' '));
270 $this->tpl->parseCurrentBlock();
272 case 'interests_help_looking':
273 $this->tpl->setCurrentBlock(
'td');
274 $this->tpl->setVariable(
'VALUE', ($set->returnIlUserObj()
275 ->getLookingForHelpAsText() ? $set->returnIlUserObj()->getLookingForHelpAsText() :
' '));
276 $this->tpl->parseCurrentBlock();
279 if ($propGetter($k) !== null) {
280 $this->tpl->setCurrentBlock(
'td');
281 $this->tpl->setVariable(
283 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
285 $this->tpl->parseCurrentBlock();
287 $this->tpl->setCurrentBlock(
'td');
288 $this->tpl->setVariable(
'VALUE',
' ');
289 $this->tpl->parseCurrentBlock();
296 $actions->setListTitle($this->
language->txt(
"actions"));
297 $actions->setId(strval($set->getUsrId()));
299 $mst_lus_usr_id = $set->getUsrId();
301 if ($this->
access->hasCurrentUserAccessToCourseMemberships()) {
302 $DIC->ctrl()->setParameterByClass(\ilMStShowUserCoursesGUI::class,
'usr_id', $mst_lus_usr_id);
304 $DIC->language()->txt(
'mst_show_courses'),
306 $DIC->ctrl()->getLinkTargetByClass(array(
307 \ilDashboardGUI::class,
309 \ilMStShowUserGUI::class,
310 \ilMStShowUserCoursesGUI::class,
315 if ($this->
access->hasCurrentUserAccessToCertificates()) {
316 $DIC->ctrl()->setParameterByClass(\ilUserCertificateGUI::class,
'usr_id', $mst_lus_usr_id);
318 $DIC->language()->txt(
'mst_list_certificates'),
320 $DIC->ctrl()->getLinkTargetByClass(array(
321 \ilDashboardGUI::class,
323 \ilMStShowUserGUI::class,
324 \ilUserCertificateGUI::class,
329 if ($this->
access->hasCurrentUserAccessToCompetences()) {
330 $DIC->ctrl()->setParameterByClass(\ilMStShowUserCompetencesGUI::class,
'usr_id', $mst_lus_usr_id);
332 $DIC->language()->txt(
'mst_list_competences'),
334 $DIC->ctrl()->getLinkTargetByClass(array(
335 \ilDashboardGUI::class,
337 \ilMStShowUserGUI::class,
338 \ilMStShowUserCompetencesGUI::class,
343 $this->
ctrl->setParameterByClass(\ilMStListUsersGUI::class,
'mst_lus_usr_id', $mst_lus_usr_id);
345 $actions = ilMyStaffGUI::extendActionMenuWithUserActions(
351 $this->tpl->setVariable(
'ACTIONS', $actions->getHTML());
352 $this->tpl->parseCurrentBlock();
359 return rawurlencode($DIC->ctrl()->getLinkTargetByClass(
360 strtolower(ilMyStaffGUI::class),
367 $set = array_pop($a_set);
371 $a_excel->
setCell($a_row, $col, $v);
378 $set = array_pop($a_set);
390 $propGetter = Closure::bind(
function ($prop) {
391 return $this->$prop ?? null;
392 }, $my_staff_user, $my_staff_user);
394 $field_values = array();
402 $field_values[$k] = $DIC->language()->txt(
'gender_' . $my_staff_user->
getGender());
404 case 'interests_general':
405 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getGeneralInterestsAsText();
407 case 'interests_help_offered':
408 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getOfferingHelpAsText();
410 case 'interests_help_looking':
411 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getLookingForHelpAsText();
414 $field_values[$k] = strip_tags($propGetter($k) ??
"");
419 return $field_values;
ILIAS UI Renderer $uiRenderer
setExportFormats(array $formats)
Set available export formats.
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
getTextRepresentationOfUsersOrgUnits(int $user_id)
setEnableTitle(bool $a_enabletitle)
__construct(ilMStListUsersGUI $parent_obj, $parent_cmd=ilMStListUsersGUI::CMD_INDEX)
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
setDisableFilterHiding(bool $a_val=true)
getFieldValuesForExport(ilMStListUser $my_staff_user)
ILIAS UI Factory $uiFactory
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
setFormName(string $a_name="")
Class ilMStListUsersTableGUI.
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
setExternalSorting(bool $a_val)
isColumnSelected(string $col)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
array $selectable_columns_cached
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
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)
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
static _isEnabled($a_key)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
setFilterCols(int $a_val)
setExternalSegmentation(bool $a_val)
setPrefix(string $a_prefix)