49 $this->
access = ilMyStaffAccess::getInstance();
50 $this->ui_fac = $DIC->ui()->factory();
51 $this->ui_ren = $DIC->ui()->renderer();
53 $this->usr_id = $DIC->http()->request()->getQueryParams()[
'usr_id'];
57 $this->
setId(
'myst_su');
60 $this->
setRowTemplate(
'tpl.list_user_courses_row.html',
"Services/MyStaff");
61 $this->
setFormAction($DIC->ctrl()->getFormAction($parent_obj));
91 $arr_usr_id = $this->
access->getUsersForUserOperationAndContext(
92 $DIC->user()->getId(),
93 ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
94 ilMyStaffAccess::COURSE_CONTEXT
99 'filters' => $this->
filter,
111 $user_courses_fetcher = new \ILIAS\MyStaff\Courses\ShowUser\ilMStShowUserCourses($DIC);
112 $result = $user_courses_fetcher->getData($arr_usr_id, $options);
113 $this->
setMaxCount($result->getTotalDatasetCount());
114 $data = $result->getDataset();
127 $item =
new ilTextInputGUI($DIC->language()->txt(
"crs_title"),
"crs_title");
129 $item->readFromSession();
130 $this->
filter[
'crs_title'] = $item->getValue();
134 $item->
setSelectText($DIC->language()->txt(
"mst_select_course"));
135 $item->setHeaderMessage($DIC->language()->txt(
"mst_please_select_course"));
136 $item->setClickableTypes(array(ilMyStaffAccess::COURSE_CONTEXT));
138 $item->readFromSession();
140 $this->
filter[
"course"] = $item->getValue();
143 $item =
new ilSelectInputGUI($DIC->language()->txt(
'member_status'),
'memb_status');
145 "" => $DIC->language()->txt(
"mst_opt_all"),
146 ilMStListCourse::MEMBERSHIP_STATUS_REQUESTED => $DIC->language()->txt(
'mst_memb_status_requested'),
147 ilMStListCourse::MEMBERSHIP_STATUS_WAITINGLIST => $DIC->language()->txt(
'mst_memb_status_waitinglist'),
148 ilMStListCourse::MEMBERSHIP_STATUS_REGISTERED => $DIC->language()->txt(
'mst_memb_status_registered'),
151 $item->readFromSession();
152 $this->
filter[
"memb_status"] = $item->getValue();
156 $item =
new ilSelectInputGUI($DIC->language()->txt(
'learning_progress'),
'lp_status');
159 "" => $DIC->language()->txt(
"mst_opt_all"),
166 $item->readFromSession();
167 $this->
filter[
"lp_status"] = $item->getValue();
176 if ($this->columnDefinition !== null) {
182 $cols[
'crs_title'] = array(
183 'txt' => $DIC->language()->txt(
'crs_title'),
186 'sort_field' =>
'crs_title',
188 $cols[
'usr_reg_status'] = array(
189 'txt' => $DIC->language()->txt(
'member_status'),
192 'sort_field' =>
'reg_status',
195 $cols[
'usr_lp_status'] = array(
196 'txt' => $DIC->language()->txt(
'learning_progress'),
199 'sort_field' =>
'lp_status',
203 $this->columnDefinition = $cols;
214 $sort = $v[
'sort_field'] ??
"";
220 $this->
addColumn($DIC->language()->txt(
'actions'));
226 if (isset($this->orgu_names)) {
237 $set = array_pop($a_set);
239 $propGetter = Closure::bind(
function ($prop) {
240 return $this->$prop ?? null;
245 case 'usr_reg_status':
246 $this->tpl->setCurrentBlock(
'td');
247 $this->tpl->setVariable(
249 $this->
getSpaceOrValue(ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus()))
251 $this->tpl->parseCurrentBlock();
253 case 'usr_lp_status':
254 $this->tpl->setCurrentBlock(
'td');
255 $this->tpl->setVariable(
259 $this->tpl->parseCurrentBlock();
262 if ($propGetter($k) !== null) {
263 $this->tpl->setCurrentBlock(
'td');
264 $this->tpl->setVariable(
266 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
268 $this->tpl->parseCurrentBlock();
270 $this->tpl->setCurrentBlock(
'td');
271 $this->tpl->setVariable(
'VALUE',
' ');
272 $this->tpl->parseCurrentBlock();
278 $mst_lco_usr_id = $set->getUsrId();
279 $mst_lco_crs_ref_id = $set->getCrsRefId();
283 if ($DIC->access()->checkAccess(
"visible",
"", $mst_lco_crs_ref_id)) {
285 $actions[] = $this->ui_fac->link()->standard(
294 if (isset($org_units[$orgu_id])) {
296 $actions[] = $this->ui_fac->link()->standard($org_units[$orgu_id], $link);
301 $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class,
'mst_lco_usr_id', $set->getUsrId());
302 $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class,
'mst_lco_crs_ref_id', $set->getCrsRefId());
304 $actions[] = \ilMyStaffGUI::extendActionMenuWithUserActions(
306 rawurlencode($this->
ctrl->getLinkTargetByClass(
307 "ilMStShowUserCoursesGUI",
312 $dropdown = $this->ui_fac->dropdown()->standard($actions)->withLabel($this->
lng->txt(
"actions"));
313 $this->tpl->setVariable(
"ACTIONS", $this->ui_ren->render($dropdown));
314 $this->tpl->parseCurrentBlock();
319 $set = array_pop($a_set);
323 $a_excel->
setCell($a_row, $col, $v);
330 $set = array_pop($a_set);
340 $propGetter = Closure::bind(
function ($prop) {
341 return $this->$prop ?? null;
342 }, $my_staff_course, $my_staff_course);
344 $field_values = array();
348 case 'usr_reg_status':
349 $field_values[$k] = ilMStListCourse::getMembershipStatusText($my_staff_course->
getUsrRegStatus());
351 case 'usr_lp_status':
355 $field_values[$k] = strip_tags($propGetter($k) ??
"");
360 return $field_values;
366 if (empty($string)) {
const LP_STATUS_COMPLETED_NUM
setExportFormats(array $formats)
Set available export formats.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setEnableTitle(bool $a_enabletitle)
const LP_STATUS_NOT_ATTEMPTED
getTextRepresentationOfOrgUnits()
const LP_STATUS_IN_PROGRESS_NUM
setDisableFilterHiding(bool $a_val=true)
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
setFormName(string $a_name="")
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
const LP_STATUS_IN_PROGRESS
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
setExternalSorting(bool $a_val)
static _enabledLearningProgress()
isColumnSelected(string $col)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
static _lookupTitle(int $obj_id)
getSpaceOrValue(string $string)
setDefaultOrderField(string $a_defaultorderfield)
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
static _isInTrash(int $ref_id)
setDefaultOrderDirection(string $a_defaultorderdirection)
static _lookupObjectId(int $ref_id)
static getUserLpStatusAsText(ilMStListCourse $my_staff_course)
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
__construct(ilMStShowUserCoursesGUI $parent_obj, $parent_cmd=ilMStShowUserCoursesGUI::CMD_INDEX)
const LP_STATUS_NOT_ATTEMPTED_NUM
setEnableNumInfo(bool $a_val)
ILIAS UI Renderer $ui_ren
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)
getFieldValuesForExport(ilMStListCourse $my_staff_course)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
Class ilMStShowUserCoursesTableGUI.
const LP_STATUS_COMPLETED
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
const LP_STATUS_FAILED_NUM
setFilterCols(int $a_val)
setExternalSegmentation(bool $a_val)
setPrefix(string $a_prefix)