ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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 ()
 
 setShowTemplates (bool $a_value)
 
 getShowTemplates ()
 
 restoreTemplate (string $a_name)
 Restore state from template. More...
 
 saveTemplate (string $a_name)
 Save current state as template. More...
 
 deleteTemplate (string $a_name)
 
 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
 
- Protected Attributes inherited from ilTable2GUI
string $requested_tmpl_delete
 
string $requested_tmpl_create
 
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_templates = false
 
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 58 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().

59  {
60  global $DIC;
61 
62  $this->access = ilMyStaffAccess::getInstance();
63 
64  $this->usr_id = $DIC->http()->request()->getQueryParams()['usr_id'];
65 
66  $this->setPrefix('myst_su');
67  $this->setFormName('myst_su');
68  $this->setId('myst_su');
69 
70  parent::__construct($parent_obj, $parent_cmd, '');
71  $this->setRowTemplate('tpl.list_user_courses_row.html', "Services/MyStaff");
72  $this->setFormAction($DIC->ctrl()->getFormAction($parent_obj));
73  ;
74  $this->setDefaultOrderDirection('desc');
75 
76  $this->setShowRowsSelector(true);
77 
78  $this->setEnableTitle(true);
79  $this->setDisableFilterHiding(true);
80  $this->setEnableNumInfo(true);
81 
82  $this->setExportFormats(array(self::EXPORT_EXCEL, self::EXPORT_CSV));
83 
84  $this->setFilterCols(5);
85  $this->initFilter();
86  $this->addColumns();
87 
88  $this->parseData();
89  }
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)
global $DIC
Definition: feed.php:28
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
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 219 of file class.ilMStShowUserCoursesTableGUI.php.

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

Referenced by __construct().

219  : void
220  {
221  global $DIC;
222 
223  foreach ($this->getSelectableColumns() as $k => $v) {
224  if ($this->isColumnSelected($k)) {
225  $sort = $v['sort_field'] ?? "";
226  $this->addColumn($v['txt'], $sort);
227  }
228  }
229  //Actions
230  if (!$this->getExportMode()) {
231  $this->addColumn($DIC->language()->txt('actions'));
232  }
233  }
global $DIC
Definition: feed.php:28
isColumnSelected(string $col)
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 244 of file class.ilMStShowUserCoursesTableGUI.php.

References $DIC, ilLink\_getStaticLink(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilMStShowUserCoursesGUI\CMD_INDEX, ILIAS\Repository\ctrl(), ilTable2GUI\getSelectedColumns(), getSpaceOrValue(), getTextRepresentationOfOrgUnits(), ilMyStaffGUI\getUserLpStatusAsHtml(), and ActiveRecord\innerjoin().

244  : void
245  {
246  global $DIC;
247 
248  $set = array_pop($a_set);
249 
250  $propGetter = Closure::bind(function ($prop) {
251  return $this->$prop ?? null;
252  }, $set, $set);
253 
254  foreach ($this->getSelectedColumns() as $k => $v) {
255  switch ($k) {
256  case 'usr_reg_status':
257  $this->tpl->setCurrentBlock('td');
258  $this->tpl->setVariable(
259  'VALUE',
260  $this->getSpaceOrValue(ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus()))
261  );
262  $this->tpl->parseCurrentBlock();
263  break;
264  case 'usr_lp_status':
265  $this->tpl->setCurrentBlock('td');
266  $this->tpl->setVariable(
267  'VALUE',
269  );
270  $this->tpl->parseCurrentBlock();
271  break;
272  default:
273  if ($propGetter($k) !== null) {
274  $this->tpl->setCurrentBlock('td');
275  $this->tpl->setVariable(
276  'VALUE',
277  (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))
278  );
279  $this->tpl->parseCurrentBlock();
280  } else {
281  $this->tpl->setCurrentBlock('td');
282  $this->tpl->setVariable('VALUE', ' ');
283  $this->tpl->parseCurrentBlock();
284  }
285  break;
286  }
287  }
288 
289  $actions = new ilAdvancedSelectionListGUI();
290  $actions->setListTitle($DIC->language()->txt("actions"));
291  $actions->setId($set->getUsrId() . "-" . $set->getCrsRefId());
292 
293  $mst_lco_usr_id = $set->getUsrId();
294  $mst_lco_crs_ref_id = $set->getCrsRefId();
295 
296  if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) {
297  $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::COURSE_CONTEXT);
298  $actions->addItem(
300  '',
301  $link
302  );
303  };
304 
305  foreach (
306  ilOrgUnitUserAssignment::innerjoin('object_reference', 'orgu_id', 'ref_id')->where(array(
307  'user_id' => $mst_lco_usr_id,
308  'object_reference.deleted' => null
309  ), array('user_id' => '=', 'object_reference.deleted' => '!='))->get() as $org_unit_assignment
310  ) {
311  if ($DIC->access()->checkAccess("read", "", $org_unit_assignment->getOrguId())) {
312  $org_units = $this->getTextRepresentationOfOrgUnits();
313  $link = ilLink::_getStaticLink($org_unit_assignment->getOrguId(), 'orgu');
314  $actions->addItem($org_units[$org_unit_assignment->getOrguId()], '', $link);
315  }
316  }
317 
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);
320 
321  $actions = ilMyStaffGUI::extendActionMenuWithUserActions(
322  $actions,
323  $mst_lco_usr_id,
324  rawurlencode($this->ctrl->getLinkTargetByClass(
325  "ilMStShowUserCoursesGUI",
327  ))
328  );
329 
330  $this->tpl->setVariable('ACTIONS', $actions->getHTML());
331  $this->tpl->parseCurrentBlock();
332  }
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
static innerjoin( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
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 345 of file class.ilMStShowUserCoursesTableGUI.php.

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

345  : void
346  {
347  $set = array_pop($a_set);
348 
349  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
350  $a_csv->addColumn($v);
351  }
352  $a_csv->addRow();
353  }
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 334 of file class.ilMStShowUserCoursesTableGUI.php.

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

334  : void
335  {
336  $set = array_pop($a_set);
337 
338  $col = 0;
339  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
340  $a_excel->setCell($a_row, $col, $v);
341  $col++;
342  }
343  }
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
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 355 of file class.ilMStShowUserCoursesTableGUI.php.

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

Referenced by fillRowCSV(), and fillRowExcel().

355  : array
356  {
357  $propGetter = Closure::bind(function ($prop) {
358  return $this->$prop ?? null;
359  }, $my_staff_course, $my_staff_course);
360 
361  $field_values = array();
362 
363  foreach ($this->getSelectedColumns() as $k => $v) {
364  switch ($k) {
365  case 'usr_reg_status':
366  $field_values[$k] = ilMStListCourse::getMembershipStatusText($my_staff_course->getUsrRegStatus());
367  break;
368  case 'usr_lp_status':
369  $field_values[$k] = ilMyStaffGUI::getUserLpStatusAsText($my_staff_course);
370  break;
371  default:
372  $field_values[$k] = strip_tags($propGetter($k) ?? "");
373  break;
374  }
375  }
376 
377  return $field_values;
378  }
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 183 of file class.ilMStShowUserCoursesTableGUI.php.

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

Referenced by addColumns().

183  : array
184  {
185  global $DIC;
186 
187  if ($this->columnDefinition !== null) {
189  }
190 
191  $cols = array();
192 
193  $cols['crs_title'] = array(
194  'txt' => $DIC->language()->txt('crs_title'),
195  'default' => true,
196  'width' => 'auto',
197  'sort_field' => 'crs_title',
198  );
199  $cols['usr_reg_status'] = array(
200  'txt' => $DIC->language()->txt('member_status'),
201  'default' => true,
202  'width' => 'auto',
203  'sort_field' => 'reg_status',
204  );
205  if (ilObjUserTracking::_enabledLearningProgress() && $this->access->hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser()) {
206  $cols['usr_lp_status'] = array(
207  'txt' => $DIC->language()->txt('learning_progress'),
208  'default' => true,
209  'width' => 'auto',
210  'sort_field' => 'lp_status',
211  );
212  }
213 
214  $this->columnDefinition = $cols;
215 
217  }
global $DIC
Definition: feed.php:28
$cols
Definition: xhr_table.php:11
+ 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 380 of file class.ilMStShowUserCoursesTableGUI.php.

References ilTable2GUI\getExportMode().

Referenced by fillRow().

380  : string
381  {
382  if (!$this->getExportMode()) {
383  if (empty($string)) {
384  return "&nbsp";
385  }
386  }
387 
388  return $string;
389  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTextRepresentationOfOrgUnits()

ilMStShowUserCoursesTableGUI::getTextRepresentationOfOrgUnits ( )
protected

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

References $orgu_names, and ilOrgUnitPathStorage\getTextRepresentationOfOrgUnits().

Referenced by fillRow().

235  : array
236  {
237  if (isset($this->orgu_names)) {
238  return $this->orgu_names;
239  }
240 
241  return $this->orgu_names = ilOrgUnitPathStorage::getTextRepresentationOfOrgUnits();
242  }
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 134 of file class.ilMStShowUserCoursesTableGUI.php.

References $DIC, ilObjUserTracking\_enabledLearningProgress(), ILIAS\Repository\access(), ilTable2GUI\addFilterItem(), ILIAS\UI\examples\Symbol\Glyph\Filter\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, and ilRepositorySelectorInputGUI\setSelectText().

Referenced by __construct().

134  : void
135  {
136  global $DIC;
137 
138  $item = new ilTextInputGUI($DIC->language()->txt("crs_title"), "crs_title");
139  $this->addFilterItem($item);
140  $item->readFromSession();
141  $this->filter['crs_title'] = $item->getValue();
142 
143  // course members
144  $item = new ilRepositorySelectorInputGUI($DIC->language()->txt("usr_filter_coursemember"), "course");
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));
148  $this->addFilterItem($item);
149  $item->readFromSession();
150  //$item->setParent($this->getParentObject());
151  $this->filter["course"] = $item->getValue();
152 
153  //membership status
154  $item = new ilSelectInputGUI($DIC->language()->txt('member_status'), 'memb_status');
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'),
160  ));
161  $this->addFilterItem($item);
162  $item->readFromSession();
163  $this->filter["memb_status"] = $item->getValue();
164 
165  if (ilObjUserTracking::_enabledLearningProgress() && $this->access->hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser()) {
166  //learning progress status
167  $item = new ilSelectInputGUI($DIC->language()->txt('learning_progress'), 'lp_status');
168  //+1 because LP_STATUS_NOT_ATTEMPTED_NUM is 0.
169  $item->setOptions(array(
170  "" => $DIC->language()->txt("mst_opt_all"),
175  ));
176  $this->addFilterItem($item);
177  $item->readFromSession();
178  $this->filter["lp_status"] = $item->getValue();
179  $this->filter["lp_status"] = (int) $this->filter["lp_status"] - 1;
180  }
181  }
const LP_STATUS_COMPLETED_NUM
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_IN_PROGRESS
global $DIC
Definition: feed.php:28
const LP_STATUS_FAILED
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const LP_STATUS_NOT_ATTEMPTED_NUM
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 91 of file class.ilMStShowUserCoursesTableGUI.php.

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

Referenced by __construct().

91  : void
92  {
93  global $DIC;
94 
95  $this->setExternalSorting(true);
96  $this->setExternalSegmentation(true);
97  $this->setDefaultOrderField('crs_title');
98 
99  $this->determineLimit();
100  $this->determineOffsetAndOrder();
101 
102  $arr_usr_id = $this->access->getUsersForUserOperationAndContext(
103  $DIC->user()->getId(),
104  ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
105  ilMyStaffAccess::COURSE_CONTEXT
106  );
107 
108  $this->filter['usr_id'] = $this->usr_id;
109  $options = array(
110  'filters' => $this->filter,
111  'limit' => array(
112  'start' => $this->getOffset(),
113  'end' => $this->getLimit(),
114  ),
115  'count' => true,
116  'sort' => array(
117  'field' => $this->getOrderField(),
118  'direction' => $this->getOrderDirection(),
119  ),
120  );
121 
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();
126 
127  // Workaround because the fillRow Method only accepts arrays
128  $data = array_map(function (ilMStListCourse $it): array {
129  return [$it];
130  }, $data);
131  $this->setData($data);
132  }
setData(array $a_data)
global $DIC
Definition: feed.php:28
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
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 50 of file class.ilMStShowUserCoursesTableGUI.php.

◆ $columnDefinition

array ilMStShowUserCoursesTableGUI::$columnDefinition = null
protected

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

Referenced by getSelectableColumns().

◆ $filter

array ilMStShowUserCoursesTableGUI::$filter = array()
protected

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

◆ $orgu_names

array ilMStShowUserCoursesTableGUI::$orgu_names = null
protected

◆ $usr_id

int ilMStShowUserCoursesTableGUI::$usr_id
protected

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

Referenced by parseData().


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