ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMStShowUserCoursesTableGUI Class Reference

Class ilMStShowUserCoursesTableGUI. More...

+ Inheritance diagram for ilMStShowUserCoursesTableGUI:
+ Collaboration diagram for ilMStShowUserCoursesTableGUI:

Public Member Functions

 __construct (ilMStShowUserCoursesGUI $parent_obj, $parent_cmd=ilMStShowUserCoursesGUI::CMD_INDEX)
 
 initFilter ()
 
 getSelectableColumns ()
 
 fillRow (array $a_set)
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 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)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 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 separately) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 parseData ()
 
 getTextRepresentationOfOrgUnits ()
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 
 getFieldValuesForExport (ilMStListCourse $my_staff_course)
 
 getSpaceOrValue (string $string)
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

int $usr_id
 
array $filter = array()
 
ilMyStaffAccess $access
 
array $columnDefinition = null
 
array $orgu_names = null
 
ILIAS UI Factory $ui_fac
 
ILIAS UI Renderer $ui_ren
 
- Protected Attributes inherited from ilTable2GUI
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Private Member Functions

 addColumns ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMStShowUserCoursesTableGUI::__construct ( ilMStShowUserCoursesGUI  $parent_obj,
  $parent_cmd = ilMStShowUserCoursesGUI::CMD_INDEX 
)
Parameters
ilMStShowUserCoursesGUI$parent_obj
string$parent_cmd

Definition at line 43 of file class.ilMStShowUserCoursesTableGUI.php.

References $DIC, ilTable2GUI\$parent_cmd, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), addColumns(), initFilter(), parseData(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDisableFilterHiding(), ilTable2GUI\setEnableNumInfo(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExportFormats(), ilTable2GUI\setFilterCols(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTable2GUI\setId(), ilTable2GUI\setPrefix(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setShowRowsSelector().

44  {
45  global $DIC;
46 
47  $this->access = ilMyStaffAccess::getInstance();
48  $this->ui_fac = $DIC->ui()->factory();
49  $this->ui_ren = $DIC->ui()->renderer();
50 
51  $this->usr_id = $DIC->http()->request()->getQueryParams()['usr_id'];
52 
53  $this->setPrefix('myst_su');
54  $this->setFormName('myst_su');
55  $this->setId('myst_su');
56 
57  parent::__construct($parent_obj, $parent_cmd, '');
58  $this->setRowTemplate('tpl.list_user_courses_row.html', "components/ILIAS/MyStaff");
59  $this->setFormAction($DIC->ctrl()->getFormAction($parent_obj));
60  ;
61  $this->setDefaultOrderDirection('desc');
62 
63  $this->setShowRowsSelector(true);
64 
65  $this->setEnableTitle(true);
66  $this->setDisableFilterHiding(true);
67  $this->setEnableNumInfo(true);
68 
69  $this->setExportFormats(array(self::EXPORT_EXCEL, self::EXPORT_CSV));
70 
71  $this->setFilterCols(5);
72  $this->initFilter();
73  $this->addColumns();
74 
75  $this->parseData();
76  }
setExportFormats(array $formats)
Set available export formats.
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
setDisableFilterHiding(bool $a_val=true)
setFormName(string $a_name="")
setId(string $a_val)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:22
setDefaultOrderDirection(string $a_defaultorderdirection)
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
setFilterCols(int $a_val)
setPrefix(string $a_prefix)
+ Here is the call graph for this function:

Member Function Documentation

◆ addColumns()

ilMStShowUserCoursesTableGUI::addColumns ( )
private

Definition at line 206 of file class.ilMStShowUserCoursesTableGUI.php.

References $DIC, ilTable2GUI\addColumn(), ilTable2GUI\getExportMode(), getSelectableColumns(), and ilTable2GUI\isColumnSelected().

Referenced by __construct().

206  : void
207  {
208  global $DIC;
209 
210  foreach ($this->getSelectableColumns() as $k => $v) {
211  if ($this->isColumnSelected($k)) {
212  $sort = $v['sort_field'] ?? "";
213  $this->addColumn($v['txt'], $sort);
214  }
215  }
216  //Actions
217  if (!$this->getExportMode()) {
218  $this->addColumn($DIC->language()->txt('actions'));
219  }
220  }
isColumnSelected(string $col)
global $DIC
Definition: shib_login.php:22
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillRow()

ilMStShowUserCoursesTableGUI::fillRow ( array  $a_set)

Definition at line 231 of file class.ilMStShowUserCoursesTableGUI.php.

References $DIC, ilObjOrgUnitTree\_getInstance(), ilLink\_getStaticLink(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilMStShowUserCoursesGUI\CMD_INDEX, ILIAS\Repository\ctrl(), ilTable2GUI\getSelectedColumns(), getSpaceOrValue(), getTextRepresentationOfOrgUnits(), ilMyStaffGUI\getUserLpStatusAsHtml(), ILIAS\Repository\lng(), and null.

231  : void
232  {
233  global $DIC;
234 
235  $set = array_pop($a_set);
236 
237  $propGetter = Closure::bind(function ($prop) {
238  return $this->$prop ?? null;
239  }, $set, $set);
240 
241  foreach ($this->getSelectedColumns() as $k => $v) {
242  switch ($k) {
243  case 'usr_reg_status':
244  $this->tpl->setCurrentBlock('td');
245  $this->tpl->setVariable(
246  'VALUE',
247  $this->getSpaceOrValue(ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus()))
248  );
249  $this->tpl->parseCurrentBlock();
250  break;
251  case 'usr_lp_status':
252  $this->tpl->setCurrentBlock('td');
253  $this->tpl->setVariable(
254  'VALUE',
256  );
257  $this->tpl->parseCurrentBlock();
258  break;
259  default:
260  if ($propGetter($k) !== null) {
261  $this->tpl->setCurrentBlock('td');
262  $this->tpl->setVariable(
263  'VALUE',
264  (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))
265  );
266  $this->tpl->parseCurrentBlock();
267  } else {
268  $this->tpl->setCurrentBlock('td');
269  $this->tpl->setVariable('VALUE', ' ');
270  $this->tpl->parseCurrentBlock();
271  }
272  break;
273  }
274  }
275 
276  $mst_lco_usr_id = $set->getUsrId();
277  $mst_lco_crs_ref_id = $set->getCrsRefId();
278 
279  $actions = [];
280 
281  if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) {
282  $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::COURSE_CONTEXT);
283  $actions[] = $this->ui_fac->link()->standard(
285  $link
286  );
287  };
288 
289  foreach (array_unique(ilObjOrgUnitTree::_getInstance()->getOrgUnitOfUser($mst_lco_usr_id)) as $orgu_id) {
290  if ($DIC->access()->checkAccess("read", "", $orgu_id) && !ilObject::_isInTrash($orgu_id)) {
291  $org_units = $this->getTextRepresentationOfOrgUnits();
292  if (isset($org_units[$orgu_id])) {
293  $link = ilLink::_getStaticLink($orgu_id, 'orgu');
294  $actions[] = $this->ui_fac->link()->standard($org_units[$orgu_id], $link);
295  }
296  }
297  }
298 
299  $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class, 'mst_lco_usr_id', $set->getUsrId());
300  $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class, 'mst_lco_crs_ref_id', $set->getCrsRefId());
301 
302  $actions[] = \ilMyStaffGUI::extendActionMenuWithUserActions(
303  $mst_lco_usr_id,
304  rawurlencode($this->ctrl->getLinkTargetByClass(
305  "ilMStShowUserCoursesGUI",
307  ))
308  );
309 
310  $dropdown = $this->ui_fac->dropdown()->standard($actions)->withLabel($this->lng->txt("actions"));
311  $this->tpl->setVariable("ACTIONS", $this->ui_ren->render($dropdown));
312  $this->tpl->parseCurrentBlock();
313  }
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupTitle(int $obj_id)
static _isInTrash(int $ref_id)
global $DIC
Definition: shib_login.php:22
static _lookupObjectId(int $ref_id)
+ Here is the call graph for this function:

◆ fillRowCSV()

ilMStShowUserCoursesTableGUI::fillRowCSV ( ilCSVWriter  $a_csv,
array  $a_set 
)
protected

Definition at line 326 of file class.ilMStShowUserCoursesTableGUI.php.

References ilCSVWriter\addColumn(), ilCSVWriter\addRow(), and getFieldValuesForExport().

326  : void
327  {
328  $set = array_pop($a_set);
329 
330  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
331  $a_csv->addColumn($v);
332  }
333  $a_csv->addRow();
334  }
addColumn(string $a_col)
getFieldValuesForExport(ilMStListCourse $my_staff_course)
+ Here is the call graph for this function:

◆ fillRowExcel()

ilMStShowUserCoursesTableGUI::fillRowExcel ( ilExcel  $a_excel,
int &  $a_row,
array  $a_set 
)
protected

Definition at line 315 of file class.ilMStShowUserCoursesTableGUI.php.

References getFieldValuesForExport(), and ilExcel\setCell().

315  : void
316  {
317  $set = array_pop($a_set);
318 
319  $col = 0;
320  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
321  $a_excel->setCell($a_row, $col, $v);
322  $col++;
323  }
324  }
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
getFieldValuesForExport(ilMStListCourse $my_staff_course)
+ Here is the call graph for this function:

◆ getFieldValuesForExport()

ilMStShowUserCoursesTableGUI::getFieldValuesForExport ( ilMStListCourse  $my_staff_course)
protected

Definition at line 336 of file class.ilMStShowUserCoursesTableGUI.php.

References ilTable2GUI\getSelectedColumns(), ilMyStaffGUI\getUserLpStatusAsText(), ILIAS\MyStaff\ListCourses\ilMStListCourse\getUsrRegStatus(), and null.

Referenced by fillRowCSV(), and fillRowExcel().

336  : array
337  {
338  $propGetter = Closure::bind(function ($prop) {
339  return $this->$prop ?? null;
340  }, $my_staff_course, $my_staff_course);
341 
342  $field_values = array();
343 
344  foreach ($this->getSelectedColumns() as $k => $v) {
345  switch ($k) {
346  case 'usr_reg_status':
347  $field_values[$k] = ilMStListCourse::getMembershipStatusText($my_staff_course->getUsrRegStatus());
348  break;
349  case 'usr_lp_status':
350  $field_values[$k] = ilMyStaffGUI::getUserLpStatusAsText($my_staff_course);
351  break;
352  default:
353  $field_values[$k] = strip_tags($propGetter($k) ?? "");
354  break;
355  }
356  }
357 
358  return $field_values;
359  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getUserLpStatusAsText(ilMStListCourse $my_staff_course)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilMStShowUserCoursesTableGUI::getSelectableColumns ( )
final

Definition at line 170 of file class.ilMStShowUserCoursesTableGUI.php.

References $columnDefinition, $DIC, ilObjUserTracking\_enabledLearningProgress(), ILIAS\Repository\access(), and null.

Referenced by addColumns().

170  : array
171  {
172  global $DIC;
173 
174  if ($this->columnDefinition !== null) {
176  }
177 
178  $cols = array();
179 
180  $cols['crs_title'] = array(
181  'txt' => $DIC->language()->txt('crs_title'),
182  'default' => true,
183  'width' => 'auto',
184  'sort_field' => 'crs_title',
185  );
186  $cols['usr_reg_status'] = array(
187  'txt' => $DIC->language()->txt('member_status'),
188  'default' => true,
189  'width' => 'auto',
190  'sort_field' => 'reg_status',
191  );
192  if (ilObjUserTracking::_enabledLearningProgress() && $this->access->hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser()) {
193  $cols['usr_lp_status'] = array(
194  'txt' => $DIC->language()->txt('learning_progress'),
195  'default' => true,
196  'width' => 'auto',
197  'sort_field' => 'lp_status',
198  );
199  }
200 
201  $this->columnDefinition = $cols;
202 
204  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSpaceOrValue()

ilMStShowUserCoursesTableGUI::getSpaceOrValue ( string  $string)
protected

Definition at line 361 of file class.ilMStShowUserCoursesTableGUI.php.

References ilTable2GUI\getExportMode().

Referenced by fillRow().

361  : string
362  {
363  if (!$this->getExportMode()) {
364  if (empty($string)) {
365  return "&nbsp";
366  }
367  }
368 
369  return $string;
370  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTextRepresentationOfOrgUnits()

ilMStShowUserCoursesTableGUI::getTextRepresentationOfOrgUnits ( )
protected

Definition at line 222 of file class.ilMStShowUserCoursesTableGUI.php.

References $orgu_names, and ilOrgUnitPathStorage\getTextRepresentationOfOrgUnits().

Referenced by fillRow().

222  : array
223  {
224  if (isset($this->orgu_names)) {
225  return $this->orgu_names;
226  }
227 
228  return $this->orgu_names = ilOrgUnitPathStorage::getTextRepresentationOfOrgUnits();
229  }
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFilter()

ilMStShowUserCoursesTableGUI::initFilter ( )
final

Definition at line 121 of file class.ilMStShowUserCoursesTableGUI.php.

References $DIC, ilObjUserTracking\_enabledLearningProgress(), ILIAS\Repository\access(), ilTable2GUI\addFilterItem(), ILIAS\Repository\filter(), ILIAS\Repository\int(), ilLPStatus\LP_STATUS_COMPLETED, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, ilSelectInputGUI\setOptions(), and ilRepositorySelectorInputGUI\setSelectText().

Referenced by __construct().

121  : void
122  {
123  global $DIC;
124 
125  $item = new ilTextInputGUI($DIC->language()->txt("crs_title"), "crs_title");
126  $this->addFilterItem($item);
127  $item->readFromSession();
128  $this->filter['crs_title'] = $item->getValue();
129 
130  // course members
131  $item = new ilRepositorySelectorInputGUI($DIC->language()->txt("usr_filter_coursemember"), "course");
132  $item->setSelectText($DIC->language()->txt("mst_select_course"));
133  $item->setHeaderMessage($DIC->language()->txt("mst_please_select_course"));
134  $item->setClickableTypes(array(ilMyStaffAccess::COURSE_CONTEXT));
135  $this->addFilterItem($item);
136  $item->readFromSession();
137  //$item->setParent($this->getParentObject());
138  $this->filter["course"] = $item->getValue();
139 
140  //membership status
141  $item = new ilSelectInputGUI($DIC->language()->txt('member_status'), 'memb_status');
142  $item->setOptions(array(
143  "" => $DIC->language()->txt("mst_opt_all"),
144  ilMStListCourse::MEMBERSHIP_STATUS_REQUESTED => $DIC->language()->txt('mst_memb_status_requested'),
145  ilMStListCourse::MEMBERSHIP_STATUS_WAITINGLIST => $DIC->language()->txt('mst_memb_status_waitinglist'),
146  ilMStListCourse::MEMBERSHIP_STATUS_REGISTERED => $DIC->language()->txt('mst_memb_status_registered'),
147  ));
148  $this->addFilterItem($item);
149  $item->readFromSession();
150  $this->filter["memb_status"] = $item->getValue();
151 
152  if (ilObjUserTracking::_enabledLearningProgress() && $this->access->hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser()) {
153  //learning progress status
154  $item = new ilSelectInputGUI($DIC->language()->txt('learning_progress'), 'lp_status');
155  //+1 because LP_STATUS_NOT_ATTEMPTED_NUM is 0.
156  $item->setOptions(array(
157  "" => $DIC->language()->txt("mst_opt_all"),
162  ));
163  $this->addFilterItem($item);
164  $item->readFromSession();
165  $this->filter["lp_status"] = $item->getValue();
166  $this->filter["lp_status"] = (int) $this->filter["lp_status"] - 1;
167  }
168  }
const LP_STATUS_COMPLETED_NUM
This class represents a selection list property in a property form.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS_NUM
setOptions(array $a_options)
const LP_STATUS_IN_PROGRESS
const LP_STATUS_FAILED
This class represents a repository selector in a property form.
global $DIC
Definition: shib_login.php:22
const LP_STATUS_NOT_ATTEMPTED_NUM
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
const LP_STATUS_COMPLETED
const LP_STATUS_FAILED_NUM
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseData()

ilMStShowUserCoursesTableGUI::parseData ( )
protected

Definition at line 78 of file class.ilMStShowUserCoursesTableGUI.php.

References ilTableGUI\$data, $DIC, $usr_id, ILIAS\Repository\access(), ilTable2GUI\determineLimit(), ilTable2GUI\determineOffsetAndOrder(), ILIAS\Repository\filter(), ilTable2GUI\getLimit(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTable2GUI\setData(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), and ilTableGUI\setMaxCount().

Referenced by __construct().

78  : void
79  {
80  global $DIC;
81 
82  $this->setExternalSorting(true);
83  $this->setExternalSegmentation(true);
84  $this->setDefaultOrderField('crs_title');
85 
86  $this->determineLimit();
87  $this->determineOffsetAndOrder();
88 
89  $arr_usr_id = $this->access->getUsersForUserOperationAndContext(
90  $DIC->user()->getId(),
91  ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
92  ilMyStaffAccess::COURSE_CONTEXT
93  );
94 
95  $this->filter['usr_id'] = $this->usr_id;
96  $options = array(
97  'filters' => $this->filter,
98  'limit' => array(
99  'start' => $this->getOffset(),
100  'end' => $this->getLimit(),
101  ),
102  'count' => true,
103  'sort' => array(
104  'field' => $this->getOrderField(),
105  'direction' => $this->getOrderDirection(),
106  ),
107  );
108 
109  $user_courses_fetcher = new \ILIAS\MyStaff\Courses\ShowUser\ilMStShowUserCourses($DIC);
110  $result = $user_courses_fetcher->getData($arr_usr_id, $options);
111  $this->setMaxCount($result->getTotalDatasetCount());
112  $data = $result->getDataset();
113 
114  // Workaround because the fillRow Method only accepts arrays
115  $data = array_map(function (ilMStListCourse $it): array {
116  return [$it];
117  }, $data);
118  $this->setData($data);
119  }
setData(array $a_data)
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
global $DIC
Definition: shib_login.php:22
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
setExternalSegmentation(bool $a_val)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilMyStaffAccess ilMStShowUserCoursesTableGUI::$access
protected

Definition at line 33 of file class.ilMStShowUserCoursesTableGUI.php.

◆ $columnDefinition

array ilMStShowUserCoursesTableGUI::$columnDefinition = null
protected

Definition at line 34 of file class.ilMStShowUserCoursesTableGUI.php.

Referenced by getSelectableColumns().

◆ $filter

array ilMStShowUserCoursesTableGUI::$filter = array()
protected

Definition at line 32 of file class.ilMStShowUserCoursesTableGUI.php.

◆ $orgu_names

array ilMStShowUserCoursesTableGUI::$orgu_names = null
protected

◆ $ui_fac

ILIAS UI Factory ilMStShowUserCoursesTableGUI::$ui_fac
protected

Definition at line 36 of file class.ilMStShowUserCoursesTableGUI.php.

◆ $ui_ren

ILIAS UI Renderer ilMStShowUserCoursesTableGUI::$ui_ren
protected

Definition at line 37 of file class.ilMStShowUserCoursesTableGUI.php.

◆ $usr_id

int ilMStShowUserCoursesTableGUI::$usr_id
protected

Definition at line 31 of file class.ilMStShowUserCoursesTableGUI.php.

Referenced by parseData().


The documentation for this class was generated from the following file: