19declare(strict_types=1);
46 $this->
access = ilMyStaffAccess::getInstance();
47 $this->ui_fac =
$DIC->ui()->factory();
48 $this->ui_ren =
$DIC->ui()->renderer();
52 $this->
setId(
'myst_lc');
56 $this->
setRowTemplate(
'tpl.list_courses_row.html',
"components/ILIAS/MyStaff");
88 'filters' => $this->
filter,
100 $arr_usr_id = $this->
access->getUsersForUserOperationAndContext(
101 $DIC->user()->getId(),
102 ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
103 ilMyStaffAccess::COURSE_CONTEXT
106 $list_courses_fetcher = new \ILIAS\MyStaff\ListCourses\ilMStListCourses(
$DIC);
107 $result = $list_courses_fetcher->getData($arr_usr_id, $options);
108 $this->
setMaxCount($result->getTotalDatasetCount());
109 $data = $result->getDataset();
112 $data = array_map(
function (\
ILIAS\MyStaff\ListCourses\ilMStListCourse $it): array {
124 $item->readFromSession();
125 $this->
filter[
'crs_title'] = $item->getValue();
130 $item->setSelectText(
$DIC->language()->txt(
"mst_select_course"));
131 $item->setHeaderMessage(
$DIC->language()->txt(
"mst_please_select_course"));
132 $item->setClickableTypes(array(ilMyStaffAccess::COURSE_CONTEXT));
134 $item->readFromSession();
136 $this->
filter[
"course"] = $item->getValue();
140 $item->setOptions(array(
141 "" =>
$DIC->language()->txt(
"mst_opt_all"),
142 \
ILIAS\MyStaff\ListCourses\ilMStListCourse::MEMBERSHIP_STATUS_REQUESTED =>
$DIC->language()->txt(
'mst_memb_status_requested'),
143 \
ILIAS\MyStaff\ListCourses\ilMStListCourse::MEMBERSHIP_STATUS_WAITINGLIST =>
$DIC->language()->txt(
'mst_memb_status_waitinglist'),
144 \
ILIAS\MyStaff\ListCourses\ilMStListCourse::MEMBERSHIP_STATUS_REGISTERED =>
$DIC->language()->txt(
'mst_memb_status_registered'),
147 $item->readFromSession();
148 $this->
filter[
"memb_status"] = $item->getValue();
154 $item->setOptions(array(
155 "" =>
$DIC->language()->txt(
"mst_opt_all"),
162 $item->readFromSession();
163 $this->
filter[
"lp_status"] = $item->getValue();
171 $DIC->language()->txt(
"login") .
"/" .
$DIC->language()->txt(
"email") .
"/" .
$DIC->language()
177 $item->readFromSession();
178 $this->
filter[
'user'] = $item->getValue();
182 $options[0] =
$DIC->language()->txt(
'mst_opt_all');
183 foreach ($paths as $org_ref_id =>
$path) {
184 $options[$org_ref_id] =
$path;
187 $item->setOptions($options);
189 $item->readFromSession();
190 $this->
filter[
'org_unit'] = $item->getValue();
196 if (isset($this->orgu_names)) {
205 if (isset($this->usr_orgu_names[
$user_id])) {
206 return $this->usr_orgu_names[
$user_id];
209 return $this->usr_orgu_names[
$user_id] = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits(
$user_id);
214 if ($this->cached_selectable_columns) {
229 $cols[
'crs_title'] = array(
230 'txt' =>
$DIC->language()->txt(
'crs_title'),
233 'sort_field' =>
'crs_title',
235 $cols[
'usr_reg_status'] = array(
236 'txt' =>
$DIC->language()->txt(
'member_status'),
239 'sort_field' =>
'reg_status',
242 $cols[
'usr_lp_status'] = array(
243 'txt' =>
$DIC->language()->txt(
'learning_progress'),
246 'sort_field' =>
'lp_status',
250 if ($arr_searchable_user_columns[
'login'] ??
false) {
251 $cols[
'usr_login'] = array(
252 'txt' =>
$DIC->language()->txt(
'login'),
255 'sort_field' =>
'usr_login',
258 if ($arr_searchable_user_columns[
'firstname'] ??
false) {
259 $cols[
'usr_firstname'] = array(
260 'txt' =>
$DIC->language()->txt(
'firstname'),
263 'sort_field' =>
'usr_firstname',
266 if ($arr_searchable_user_columns[
'lastname'] ??
false) {
267 $cols[
'usr_lastname'] = array(
268 'txt' =>
$DIC->language()->txt(
'lastname'),
271 'sort_field' =>
'usr_lastname',
275 if ($arr_searchable_user_columns[
'email'] ??
false) {
276 $cols[
'usr_email'] = array(
277 'txt' =>
$DIC->language()->txt(
'email'),
280 'sort_field' =>
'usr_email',
284 if ($arr_searchable_user_columns[
'org_units'] ??
false) {
285 $cols[
'usr_assinged_orgus'] = array(
286 'txt' =>
$DIC->language()->txt(
'objs_orgu'),
301 $sort = $v[
'sort_field'] ??
"";
308 $this->
addColumn($DIC->language()->txt(
'actions'));
318 final protected function fillRow(array $a_set): void
322 $set = array_pop($a_set);
324 $propGetter = Closure::bind(
function ($prop) {
325 return $this->$prop ??
null;
330 case 'usr_assinged_orgus':
331 $this->tpl->setCurrentBlock(
'td');
332 $this->tpl->setVariable(
336 $this->tpl->parseCurrentBlock();
338 case 'usr_reg_status':
339 $this->tpl->setCurrentBlock(
'td');
340 $this->tpl->setVariable(
342 \
ILIAS\MyStaff\ListCourses\ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus())
344 $this->tpl->parseCurrentBlock();
346 case 'usr_lp_status':
347 $this->tpl->setCurrentBlock(
'td');
349 $this->tpl->parseCurrentBlock();
352 if ($propGetter($k) !==
null) {
353 $this->tpl->setCurrentBlock(
'td');
354 $this->tpl->setVariable(
356 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
358 $this->tpl->parseCurrentBlock();
360 $this->tpl->setCurrentBlock(
'td');
361 $this->tpl->setVariable(
'VALUE',
' ');
362 $this->tpl->parseCurrentBlock();
368 $mst_lco_usr_id = $set->getUsrId();
369 $mst_lco_crs_ref_id = $set->getCrsRefId();
373 if (
$DIC->access()->checkAccess(
"visible",
"", $mst_lco_crs_ref_id)) {
375 $actions[] = $this->ui_fac->link()->standard(
384 if (isset($org_units[$orgu_id])) {
386 $actions[] = $this->ui_fac->link()->standard($org_units[$orgu_id], $link);
391 $DIC->ctrl()->setParameterByClass(ilMStListCoursesGUI::class,
'mst_lco_usr_id', $mst_lco_usr_id);
392 $DIC->ctrl()->setParameterByClass(ilMStListCoursesGUI::class,
'mst_lco_crs_ref_id', $mst_lco_crs_ref_id);
394 $actions[] = \ilMyStaffGUI::extendActionMenuWithUserActions(
396 rawurlencode($this->
ctrl->getLinkTargetByClass(
397 "ilMStListCoursesGUI",
402 $dropdown = $this->ui_fac->dropdown()->standard($actions)->withLabel($this->
lng->txt(
"actions"));
403 $this->tpl->setVariable(
"ACTIONS", $this->ui_ren->render($dropdown));
404 $this->tpl->parseCurrentBlock();
409 $set = array_pop($a_set);
413 $a_excel->
setCell($a_row, $col, $v);
420 $set = array_pop($a_set);
430 $propGetter = Closure::bind(
function ($prop) {
431 return $this->$prop ??
null;
432 }, $my_staff_course, $my_staff_course);
434 $field_values = array();
437 case 'usr_assinged_orgus':
440 case 'usr_reg_status':
443 case 'usr_lp_status':
447 $field_values[$k] = strip_tags($propGetter($k) ??
"");
452 return $field_values;
static getMembershipStatusText(int $status)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_COMPLETED
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
Class ilMStListCoursesGUI.
Class ilMStListCoursesTableGUI.
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
Excel Version of Fill Row.
getTextRepresentationOfOrgUnits()
getSelectableColumns()
Get selectable columns.
getTextRepresentationOfUsersOrgUnits(int $user_id)
getFieldValuesForExport(\ILIAS\MyStaff\ListCourses\ilMStListCourse $my_staff_course)
ILIAS UI Renderer $ui_ren
array $cached_selectable_columns
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
CSV Version of Fill Row.
__construct(ilMStListCoursesGUI $parent_obj, $parent_cmd=ilMStListCoursesGUI::CMD_INDEX)
static getUserLpStatusAsText(ilMStListCourse $my_staff_course)
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
static _enabledLearningProgress()
static _lookupObjectId(int $ref_id)
static _isInTrash(int $ref_id)
static _lookupTitle(int $obj_id)
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isColumnSelected(string $col)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
determineOffsetAndOrder(bool $a_omit_offset=false)
setEnableNumInfo(bool $a_val)
setExportFormats(array $formats)
Set available export formats.
setExternalSegmentation(bool $a_val)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setEnableTitle(bool $a_enabletitle)
setFormName(string $a_name="")
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)
setDefaultOrderField(string $a_defaultorderfield)
setDisableFilterHiding(bool $a_val=true)
setExternalSorting(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setFilterCols(int $a_val)
setData(array $a_data)
Set table data.
setMaxCount(int $a_max_count)
set max.
This class represents a text property in a property form.
static _isEnabled($a_key)
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.