62 $this->
access = ilMyStaffAccess::getInstance();
64 $this->usr_id =
$DIC->http()->request()->getQueryParams()[
'usr_id'];
68 $this->
setId(
'myst_su');
71 $this->
setRowTemplate(
'tpl.list_user_courses_row.html',
"Services/MyStaff");
102 $arr_usr_id = $this->
access->getUsersForUserOperationAndContext(
103 $DIC->user()->getId(),
104 ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
105 ilMyStaffAccess::COURSE_CONTEXT
110 'filters' => $this->
filter,
122 $user_courses_fetcher = new \ILIAS\MyStaff\Courses\ShowUser\ilMStShowUserCourses(
$DIC);
123 $result = $user_courses_fetcher->getData($arr_usr_id, $options);
124 $this->
setMaxCount($result->getTotalDatasetCount());
125 $data = $result->getDataset();
140 $item->readFromSession();
141 $this->
filter[
'crs_title'] = $item->getValue();
145 $item->setSelectText(
$DIC->language()->txt(
"mst_select_course"));
146 $item->setHeaderMessage(
$DIC->language()->txt(
"mst_please_select_course"));
147 $item->setClickableTypes(array(ilMyStaffAccess::COURSE_CONTEXT));
149 $item->readFromSession();
151 $this->
filter[
"course"] = $item->getValue();
155 $item->setOptions(array(
156 "" =>
$DIC->language()->txt(
"mst_opt_all"),
157 ilMStListCourse::MEMBERSHIP_STATUS_REQUESTED =>
$DIC->language()->txt(
'mst_memb_status_requested'),
158 ilMStListCourse::MEMBERSHIP_STATUS_WAITINGLIST =>
$DIC->language()->txt(
'mst_memb_status_waitinglist'),
159 ilMStListCourse::MEMBERSHIP_STATUS_REGISTERED =>
$DIC->language()->txt(
'mst_memb_status_registered'),
162 $item->readFromSession();
163 $this->
filter[
"memb_status"] = $item->getValue();
169 $item->setOptions(array(
170 "" =>
$DIC->language()->txt(
"mst_opt_all"),
177 $item->readFromSession();
178 $this->
filter[
"lp_status"] = $item->getValue();
187 if ($this->columnDefinition !==
null) {
193 $cols[
'crs_title'] = array(
194 'txt' =>
$DIC->language()->txt(
'crs_title'),
197 'sort_field' =>
'crs_title',
199 $cols[
'usr_reg_status'] = array(
200 'txt' =>
$DIC->language()->txt(
'member_status'),
203 'sort_field' =>
'reg_status',
206 $cols[
'usr_lp_status'] = array(
207 'txt' =>
$DIC->language()->txt(
'learning_progress'),
210 'sort_field' =>
'lp_status',
214 $this->columnDefinition =
$cols;
225 $sort = $v[
'sort_field'] ??
"";
231 $this->
addColumn($DIC->language()->txt(
'actions'));
237 if (isset($this->orgu_names)) {
248 $set = array_pop($a_set);
250 $propGetter = Closure::bind(
function ($prop) {
251 return $this->$prop ??
null;
256 case 'usr_reg_status':
257 $this->tpl->setCurrentBlock(
'td');
258 $this->tpl->setVariable(
260 $this->
getSpaceOrValue(ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus()))
262 $this->tpl->parseCurrentBlock();
264 case 'usr_lp_status':
265 $this->tpl->setCurrentBlock(
'td');
266 $this->tpl->setVariable(
270 $this->tpl->parseCurrentBlock();
273 if ($propGetter($k) !==
null) {
274 $this->tpl->setCurrentBlock(
'td');
275 $this->tpl->setVariable(
277 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
279 $this->tpl->parseCurrentBlock();
281 $this->tpl->setCurrentBlock(
'td');
282 $this->tpl->setVariable(
'VALUE',
' ');
283 $this->tpl->parseCurrentBlock();
290 $actions->setListTitle(
$DIC->language()->txt(
"actions"));
291 $actions->setId($set->getUsrId() .
"-" . $set->getCrsRefId());
293 $mst_lco_usr_id = $set->getUsrId();
294 $mst_lco_crs_ref_id = $set->getCrsRefId();
296 if (
$DIC->access()->checkAccess(
"visible",
"", $mst_lco_crs_ref_id)) {
307 'user_id' => $mst_lco_usr_id,
308 'object_reference.deleted' =>
null
309 ), array(
'user_id' =>
'=',
'object_reference.deleted' =>
'!='))->
get() as $org_unit_assignment
311 if (
$DIC->access()->checkAccess(
"read",
"", $org_unit_assignment->getOrguId())) {
314 $actions->addItem($org_units[$org_unit_assignment->getOrguId()],
'', $link);
318 $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class,
'mst_lco_usr_id', $mst_lco_usr_id);
319 $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class,
'mst_lco_crs_ref_id', $mst_lco_crs_ref_id);
321 $actions = ilMyStaffGUI::extendActionMenuWithUserActions(
324 rawurlencode($this->
ctrl->getLinkTargetByClass(
325 "ilMStShowUserCoursesGUI",
330 $this->tpl->setVariable(
'ACTIONS', $actions->getHTML());
331 $this->tpl->parseCurrentBlock();
336 $set = array_pop($a_set);
340 $a_excel->
setCell($a_row, $col, $v);
347 $set = array_pop($a_set);
357 $propGetter = Closure::bind(
function ($prop) {
358 return $this->$prop ??
null;
359 }, $my_staff_course, $my_staff_course);
361 $field_values = array();
365 case 'usr_reg_status':
366 $field_values[$k] = ilMStListCourse::getMembershipStatusText($my_staff_course->
getUsrRegStatus());
368 case 'usr_lp_status':
372 $field_values[$k] = strip_tags($propGetter($k) ??
"");
377 return $field_values;
383 if (empty($string)) {
static innerjoin( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
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="")
Get static link.
Class ilMStShowUserCoursesTableGUI.
getTextRepresentationOfOrgUnits()
getSelectableColumns()
Get selectable columns.
__construct(ilMStShowUserCoursesGUI $parent_obj, $parent_cmd=ilMStShowUserCoursesGUI::CMD_INDEX)
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
CSV Version of Fill Row.
getFieldValuesForExport(ilMStListCourse $my_staff_course)
fillRow(array $a_set)
Standard Version of Fill Row.
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
Excel Version of Fill Row.
getSpaceOrValue(string $string)
static getUserLpStatusAsText(ilMStListCourse $my_staff_course)
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
static _enabledLearningProgress()
static _lookupObjectId(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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc