ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCourseParticipantsTableGUI Class Reference
+ Inheritance diagram for ilCourseParticipantsTableGUI:
+ Collaboration diagram for ilCourseParticipantsTableGUI:

Public Member Functions

 __construct (object $a_parent_obj, ilObject $rep_object, bool $a_show_learning_progress=false, bool $a_show_timings=false, bool $a_show_lp_status_sync=false, ?ilCertificateUserForObjectPreloader $preloader=null)
 
 parse ()
 
- Public Member Functions inherited from ilParticipantTableGUI
 __construct (mixed $a_parent_obj, $a_parent_cmd="", $a_template_context="")
 
 initFilter ()
 Init table filter. More...
 
 getSelectableColumns ()
 
 checkAcceptance (int $a_usr_id)
 
- 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

 fillRow (array $a_set)
 
 lookupUserName (int $user_id)
 
- Protected Member Functions inherited from ilParticipantTableGUI
 getRepositoryObject ()
 
 getParticipants ()
 
 initSettings ()
 
 showActionLinks ($a_set)
 
- 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

bool $show_learning_progress = false
 
bool $show_timings = false
 
bool $show_lp_status_sync = false
 
ilAccessHandler $access
 
ilRbacReview $rbacReview
 
ilObjUser $user
 
array $cached_user_names = []
 
- Protected Attributes inherited from ilParticipantTableGUI
ilParticipants $participants = null
 
array $current_filter = []
 
ilObject $rep_object
 
- 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 Attributes

ilCertificateUserForObjectPreloader $preLoader = null
 
ilPrivacySettings $privacy
 

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
 
- Static Protected Attributes inherited from ilParticipantTableGUI
static bool $export_allowed = false
 
static bool $confirmation_required = true
 
static array $accepted_ids = null
 
static array $all_columns = null
 
static bool $has_odf_definitions = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCourseParticipantsTableGUI::__construct ( object  $a_parent_obj,
ilObject  $rep_object,
bool  $a_show_learning_progress = false,
bool  $a_show_timings = false,
bool  $a_show_lp_status_sync = false,
?ilCertificateUserForObjectPreloader  $preloader = null 
)

Definition at line 39 of file class.ilCourseParticipantsTableGUI.php.

References $DIC, ilParticipantTableGUI\$rep_object, ILIAS\GlobalScreen\Provider\__construct(), ilObjUserTracking\_enabledLearningProgress(), ILIAS\Repository\access(), ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), ilTableGUI\enable(), ilTable2GUI\getId(), ilPrivacySettings\getInstance(), ilParticipants\getInstanceByObjId(), ilParticipantTableGUI\getRepositoryObject(), ilParticipantTableGUI\getSelectableColumns(), ilTable2GUI\getSelectedColumns(), ilParticipantTableGUI\initFilter(), ilParticipantTableGUI\initSettings(), ILIAS\Repository\lng(), null, ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableNumInfo(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setFormName(), ilTable2GUI\setId(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowRowsSelector(), ilTable2GUI\setTopCommands(), and ILIAS\Repository\user().

46  {
47  global $DIC;
48 
49  $this->show_learning_progress = $a_show_learning_progress;
50 
51  if (null === $preloader) {
52  $preloader = new ilCertificateUserForObjectPreloader(
55  );
56  }
57  $this->preLoader = $preloader;
58  $this->show_timings = $a_show_timings;
59  $this->show_lp_status_sync = $a_show_lp_status_sync;
60  $this->rep_object = $rep_object;
61 
63  $this->show_lp_status_sync = false;
64  }
65  $this->privacy = ilPrivacySettings::getInstance();
66  $this->access = $DIC->access();
67  $this->participants = ilParticipants::getInstanceByObjId($this->getRepositoryObject()->getId());
68  $this->rbacReview = $DIC->rbac()->review();
69  $this->user = $DIC->user();
70 
71  $this->setId('crs_' . $this->getRepositoryObject()->getId());
72  parent::__construct($a_parent_obj, 'participants');
73 
74  $this->lng->loadLanguageModule('crs');
75  $this->lng->loadLanguageModule('trac');
76  $this->lng->loadLanguageModule('rbac');
77  $this->lng->loadLanguageModule('mmbr');
78  $this->lng->loadLanguageModule('cert');
79  $this->lng->loadLanguageModule('certificate');
80 
81  $this->initSettings();
82 
83  $this->setFormName('participants');
84 
85  $this->addColumn('', 'f', '1', true);
86  $this->addColumn($this->lng->txt('name'), 'name', '20%');
87 
88  $all_cols = $this->getSelectableColumns();
89  foreach ($this->getSelectedColumns() as $col) {
90  $this->addColumn($all_cols[$col]['txt'], $col);
91  }
92 
93  if ($this->show_learning_progress) {
94  $this->addColumn($this->lng->txt('learning_progress'), 'progress');
95  }
96 
97  if ($this->privacy->enabledCourseAccessTimes()) {
98  $this->addColumn($this->lng->txt('last_access'), 'access_ut', '16em');
99  }
100 
101  $this->addColumn($this->lng->txt('crs_member_passed'), 'passed');
102  if ($this->show_lp_status_sync) {
103  $this->addColumn($this->lng->txt('crs_member_passed_status_changed'), 'passed_timestamp');
104  }
105 
106  $this->setSelectAllCheckbox('participants', true);
107  $this->addColumn($this->lng->txt('crs_mem_contact'), 'contact');
108  $this->addColumn($this->lng->txt('crs_blocked'), 'blocked');
109  $this->addColumn($this->lng->txt('crs_notification_list_title'), 'notification');
110 
111  $this->addColumn($this->lng->txt('actions'), 'optional', '', false, 'ilMembershipRowActionsHeader');
112 
113  $this->setRowTemplate("tpl.show_participants_row.html", "components/ILIAS/Course");
114 
115  $this->setDefaultOrderField('roles');
116  $this->enable('sort');
117  $this->enable('header');
118  $this->enable('numinfo');
119  $this->enable('select_all');
120 
121  $this->setEnableNumInfo(true);
122  $this->setExternalSegmentation(false);
123  $this->setTopCommands(true);
124  $this->setEnableHeader(true);
125  $this->setEnableTitle(true);
126  $this->initFilter();
127 
128  $this->setShowRowsSelector(true);
129 
130  $preloader->preLoadDownloadableCertificates($this->getRepositoryObject()->getId());
131  $this->addMultiCommand('editParticipants', $this->lng->txt('edit'));
132  $this->addMultiCommand('confirmDeleteParticipants', $this->lng->txt('remove'));
133  $this->addMultiCommand('sendMailToSelectedUsers', $this->lng->txt('mmbr_btn_mail_selected_users'));
134  $this->lng->loadLanguageModule('user');
135  $this->addMultiCommand('addToClipboard', $this->lng->txt('clipboard_add_btn'));
136 
137  $this->addCommandButton('updateParticipantsStatus', $this->lng->txt('save'));
138  }
setTopCommands(bool $a_val)
enable(string $a_module_name)
setEnableTitle(bool $a_enabletitle)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
setFormName(string $a_name="")
setId(string $a_val)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:22
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
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)
addMultiCommand(string $a_cmd, string $a_text)
setEnableHeader(bool $a_enableheader)
setExternalSegmentation(bool $a_val)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilCourseParticipantsTableGUI::fillRow ( array  $a_set)
protected

Definition at line 140 of file class.ilCourseParticipantsTableGUI.php.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), ilTable2GUI\getId(), ilLPStatusIcons\getInstance(), ilParticipantTableGUI\getParticipants(), ilParticipantTableGUI\getRepositoryObject(), ilTable2GUI\getSelectedColumns(), ilLPStatusIcons\ICON_VARIANT_LONG, IL_CAL_DATE, IL_CAL_UNIX, ILIAS\Repository\lng(), and ilParticipantTableGUI\showActionLinks().

140  : void
141  {
142  $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
143  $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']);
144  $this->tpl->setVariable('SELECT_PARTICIPANT', $this->lng->txt("select") . ' ' . $a_set['lastname'] . ', ' . $a_set['firstname']);
145 
146  if (
147  !$this->access->checkAccessOfUser($a_set['usr_id'], 'read', '', $this->getRepositoryObject()->getRefId()) &&
148  is_array($info = $this->access->getInfo())
149  ) {
150  $this->tpl->setCurrentBlock('access_warning');
151  $this->tpl->setVariable('PARENT_ACCESS', $info[0]['text']);
152  $this->tpl->parseCurrentBlock();
153  }
154 
155  if (!$a_set['active']) {
156  $this->tpl->setCurrentBlock('access_warning');
157  $this->tpl->setVariable('PARENT_ACCESS', $this->lng->txt('usr_account_inactive'));
158  $this->tpl->parseCurrentBlock();
159  }
160 
161  foreach ($this->getSelectedColumns() as $field) {
162  switch ($field) {
163  case 'gender':
164  $a_set['gender'] = ($a_set['gender'] ?? '') ? $this->lng->txt('gender_' . $a_set['gender']) : '';
165  $this->tpl->setCurrentBlock('custom_fields');
166  $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
167  $this->tpl->parseCurrentBlock();
168  break;
169 
170  case 'birthday':
171  $a_set['birthday'] = ($a_set['birthday'] ?? false) ? ilDatePresentation::formatDate(new ilDate(
172  $a_set['birthday'],
174  )) : $this->lng->txt('no_date');
175  $this->tpl->setCurrentBlock('custom_fields');
176  $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
177  $this->tpl->parseCurrentBlock();
178  break;
179 
180  case 'consultation_hour':
181  $this->tpl->setCurrentBlock('custom_fields');
182  $dts = array();
183  foreach ((array) ($a_set['consultation_hours'] ?? []) as $ch) {
185  new ilDateTime($ch['dt'], IL_CAL_UNIX),
186  new ilDateTime($ch['dtend'], IL_CAL_UNIX)
187  );
188  if ($ch['explanation']) {
189  $tmp .= ' ' . $ch['explanation'];
190  }
191  $dts[] = $tmp;
192  }
193  $dt_string = implode('<br />', $dts);
194  $this->tpl->setVariable('VAL_CUST', $dt_string);
195  $this->tpl->parseCurrentBlock();
196  break;
197 
198  case 'prtf':
199  $tmp = array();
200  if (is_array($a_set['prtf'])) {
201  foreach ($a_set['prtf'] as $prtf_url => $prtf_txt) {
202  $tmp[] = '<a href="' . $prtf_url . '">' . $prtf_txt . '</a>';
203  }
204  }
205  $this->tpl->setCurrentBlock('custom_fields');
206  $this->tpl->setVariable('VAL_CUST', implode('<br />', $tmp));
207  $this->tpl->parseCurrentBlock();
208  break;
209 
210  case 'odf_last_update':
211  $this->tpl->setCurrentBlock('custom_fields');
212  $this->tpl->setVariable('VAL_CUST', (string) ($a_set['odf_info_txt'] ?? ''));
213  $this->tpl->parseCurrentBlock();
214  break;
215 
216  case 'roles':
217  $this->tpl->setCurrentBlock('custom_fields');
218  $this->tpl->setVariable('VAL_CUST', (string) ($a_set['roles_label'] ?? ''));
219  $this->tpl->parseCurrentBlock();
220  break;
221 
222  case 'org_units':
223  $this->tpl->setCurrentBlock('custom_fields');
224  $this->tpl->setVariable(
225  'VAL_CUST',
226  ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((int) $a_set['usr_id'])
227  );
228  $this->tpl->parseCurrentBlock();
229  break;
230 
231  default:
232  $this->tpl->setCurrentBlock('custom_fields');
233  $this->tpl->setVariable('VAL_CUST', isset($a_set[$field]) ? (string) $a_set[$field] : '');
234  $this->tpl->parseCurrentBlock();
235  break;
236  }
237  }
238 
239  if ($this->privacy->enabledCourseAccessTimes()) {
240  $this->tpl->setVariable('VAL_ACCESS', $a_set['access_time']);
241  }
242  if ($this->show_learning_progress) {
243  $this->tpl->setCurrentBlock('lp');
245  $icon_rendered = $icons->renderIconForStatus($icons->lookupNumStatus($a_set['progress']));
246 
247  $this->tpl->setVariable('LP_STATUS_ALT', $this->lng->txt($a_set['progress']));
248  $this->tpl->setVariable('LP_STATUS_ICON', $icon_rendered);
249 
250  $this->tpl->parseCurrentBlock();
251  }
252 
253  $this->tpl->setVariable('VAL_POSTNAME', 'participants');
254 
255  if ($this->access->checkAccess("grade", "", $this->rep_object->getRefId())) {
256  $this->tpl->setCurrentBlock('grade');
257  $this->tpl->setVariable('VAL_PASSED_ID', $a_set['usr_id']);
258  $this->tpl->setVariable('VAL_PASSED_CHECKED', ($a_set['passed'] ? 'checked="checked"' : ''));
259  $this->tpl->setVariable('PASSED_TITLE', $this->lng->txt('crs_member_passed'));
260  $this->tpl->parseCurrentBlock();
261  } else {
262  $this->tpl->setVariable('VAL_PASSED_TXT', ($a_set['passed']
263  ? $this->lng->txt("yes")
264  : $this->lng->txt("no")));
265  }
266 
267  if (
268  $this->getParticipants()->isAdmin($a_set['usr_id']) ||
269  $this->getParticipants()->isTutor($a_set['usr_id'])
270  ) {
271  // cognos-blu-patch: begin
272  $this->tpl->setCurrentBlock('with_contact');
273  $this->tpl->setVariable('VAL_CONTACT_ID', $a_set['usr_id']);
274  $this->tpl->setVariable('VAL_CONTACT_CHECKED', $a_set['contact'] ? 'checked="checked"' : '');
275  $this->tpl->setVariable('CONTACT_TITLE', $this->lng->txt('crs_mem_contact'));
276  $this->tpl->parseCurrentBlock();
277  // cognos-blu-patch: end
278 
279  $this->tpl->setCurrentBlock('with_notification');
280  $this->tpl->setVariable('VAL_NOTIFICATION_ID', $a_set['usr_id']);
281  $this->tpl->setVariable('VAL_NOTIFICATION_CHECKED', ($a_set['notification'] ? 'checked="checked"' : ''));
282  $this->tpl->setVariable('NOTIFICATION_TITLE', $this->lng->txt('crs_notification_list_title'));
283  $this->tpl->parseCurrentBlock();
284  }
285 
286  // blocked only for real members
287  if (
288  !$this->getParticipants()->isAdmin($a_set['usr_id']) &&
289  !$this->getParticipants()->isTutor($a_set['usr_id'])
290  ) {
291  $this->tpl->setCurrentBlock('with_blocked');
292  $this->tpl->setVariable('VAL_BLOCKED_ID', $a_set['usr_id']);
293  $this->tpl->setVariable('VAL_BLOCKED_CHECKED', ($a_set['blocked'] ? 'checked="checked"' : ''));
294  $this->tpl->setVariable('BLOCKED_TITLE', $this->lng->txt('crs_blocked'));
295  $this->tpl->parseCurrentBlock();
296  }
297 
298  if ($this->show_lp_status_sync) {
299  $this->tpl->setVariable('PASSED_INFO', $a_set["passed_info"]);
300  }
301 
302  $this->showActionLinks($a_set);
303 
304  $isPreloaded = $this->preLoader->isPreloaded($this->getRepositoryObject()->getId(), $a_set['usr_id']);
305  if ($isPreloaded) {
306  $this->tpl->setCurrentBlock('link');
307  $this->tpl->setVariable('LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj, 'deliverCertificate'));
308  $this->tpl->setVariable('LINK_TXT', $this->lng->txt('download_certificate'));
309  $this->tpl->parseCurrentBlock();
310  }
311  $this->ctrl->clearParameters($this->parent_obj);
312 
313  if ($this->show_timings) {
314  $this->ctrl->setParameterByClass('ilcoursecontentgui', 'member_id', $a_set['usr_id']);
315  $this->tpl->setCurrentBlock('link');
316  $this->tpl->setVariable(
317  'LINK_NAME',
318  $this->ctrl->getLinkTargetByClass('ilcoursecontentgui', 'showUserTimings')
319  );
320  $this->tpl->setVariable('LINK_TXT', $this->lng->txt('timings_timings'));
321  $this->tpl->parseCurrentBlock();
322  }
323  }
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
const IL_CAL_UNIX
const IL_CAL_DATE
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
+ Here is the call graph for this function:

◆ lookupUserName()

ilCourseParticipantsTableGUI::lookupUserName ( int  $user_id)
protected
Returns
array{user_id: int, firstname: string, lastname: string, login: string, title: string}

Definition at line 542 of file class.ilCourseParticipantsTableGUI.php.

References $user_id, and ilObjUser\_lookupName().

Referenced by parse().

542  : array
543  {
544  if (isset($this->cached_user_names[$user_id])) {
545  return $this->cached_user_names[$user_id];
546  }
547  return $this->cached_user_names[$user_id] = ilObjUser::_lookupName($user_id);
548  }
static _lookupName(int $a_user_id)
lookup user name
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse()

ilCourseParticipantsTableGUI::parse ( )

Definition at line 325 of file class.ilCourseParticipantsTableGUI.php.

References ilTableGUI\$data, $user_id, ilObjOrgUnitTree\_getInstance(), ilCourseUserData\_getValuesByObjId(), ILIAS\Repository\access(), ilParticipantTableGUI\checkAcceptance(), ilTable2GUI\determineOffsetAndOrder(), ilDatePresentation\formatDate(), ilTable2GUI\getId(), ilPrivacySettings\getInstance(), ilTableGUI\getOrderDirection(), ilTable2GUI\getParentObject(), ilParticipantTableGUI\getRepositoryObject(), ilTable2GUI\getSelectedColumns(), ilUserQuery\getUserListData(), IL_CAL_UNIX, ILIAS\Repository\int(), ilTable2GUI\isColumnSelected(), ILIAS\Repository\lng(), ilUserDefinedData\lookupData(), ilObjectCustomUserFieldHistory\lookupEntriesByObjectId(), ilBookingEntry\lookupManagedBookingsForObject(), lookupUserName(), null, ilTable2GUI\setData(), ilArrayUtil\sortArray(), and ILIAS\Repository\user().

325  : void
326  {
327  $this->determineOffsetAndOrder(true);
328 
329  $additional_fields = $this->getSelectedColumns();
330  unset($additional_fields["firstname"]);
331  unset($additional_fields["lastname"]);
332  unset($additional_fields["last_login"]);
333  unset($additional_fields["access_until"]);
334  unset($additional_fields['consultation_hour']);
335  unset($additional_fields['prtf']);
336  unset($additional_fields['roles']);
337  unset($additional_fields['org_units']);
338 
339  $part = $this->participants->getParticipants();
340 
341  $part = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
342  'manage_members',
343  'manage_members',
344  $this->getRepositoryObject()->getRefId(),
345  $part
346  );
347 
348  if ($part === []) {
349  $this->setData(array());
350  return;
351  }
352 
353  $udf_ids = $usr_data_fields = $odf_ids = array();
354  foreach ($additional_fields as $field) {
355  if (substr($field, 0, 3) == 'udf') {
356  $udf_ids[] = substr($field, 4);
357  continue;
358  }
359  if (substr($field, 0, 3) == 'odf') {
360  $odf_ids[] = substr($field, 4);
361  continue;
362  }
363 
364  $usr_data_fields[] = $field;
365  }
366 
367  $usr_data = ilUserQuery::getUserListData(
368  '',
369  '',
370  0,
371  9999,
372  $this->current_filter['login'],
373  '',
374  null,
375  false,
376  false,
377  0,
378  0,
379  null,
380  $usr_data_fields,
381  $part
382  );
383  // filter by array
384  $usr_ids = array();
385  $local_roles = $this->getParentObject()->getLocalRoles();
386  foreach ((array) $usr_data['set'] as $user) {
387  if ($this->current_filter['roles'] ?? false) {
388  if (!$this->rbacReview->isAssigned($user['usr_id'], $this->current_filter['roles'])) {
389  continue;
390  }
391  }
392  if ($this->current_filter['org_units'] ?? false) {
393  $org_unit = $this->current_filter['org_units'];
394 
395  $assigned = ilObjOrgUnitTree::_getInstance()->getOrgUnitOfUser($user['usr_id']);
396  if (!in_array($org_unit, $assigned)) {
397  continue;
398  }
399  }
400 
401  $usr_ids[] = $user['usr_id'];
402  }
403 
404  // merge course data
405  $course_user_data = $this->getParentObject()->readMemberData(
406  $usr_ids,
407  $this->getSelectedColumns(),
408  true
409  );
410  $a_user_data = array();
411  foreach ((array) $usr_data['set'] as $ud) {
412  $user_id = (int) $ud['usr_id'];
413 
414  if (!in_array($user_id, $usr_ids)) {
415  continue;
416  }
417  // #15434
418  if (!$this->checkAcceptance($user_id)) {
419  $ud = [
420  'active' => $ud['active'],
421  'firstname' => $ud['firstname'],
422  'lastname' => $ud['lastname'],
423  'login' => $ud['login']
424  ];
425  }
426 
427  $a_user_data[$user_id] = array_merge($ud, $course_user_data[$user_id]);
428 
429  $roles = array();
430  foreach ($local_roles as $role_id => $role_name) {
431  // @todo fix performance
432  if ($this->rbacReview->isAssigned($user_id, $role_id)) {
433  $roles[] = $role_name;
434  }
435  }
436 
437  $a_user_data[$user_id]['name'] = ($a_user_data[$user_id]['lastname'] . ', ' . $a_user_data[$user_id]['firstname']);
438  $a_user_data[$user_id]['roles_label'] = implode('<br />', $roles);
439  $a_user_data[$user_id]['roles'] = $this->participants->setRoleOrderPosition($user_id);
440 
441  if ($this->show_lp_status_sync) {
442  // #9912 / #13208
443  $passed_info = "";
444  $passed_timestamp = '';
445  if ($a_user_data[$user_id]["passed_info"]) {
446  $pinfo = $a_user_data[$user_id]["passed_info"];
447  if ($pinfo["user_id"]) {
448  if ($pinfo["user_id"] < 0) {
449  $passed_info = $this->lng->txt("crs_passed_status_system");
450  } elseif ($pinfo["user_id"] > 0) {
451  $name = $this->lookupUserName((int) $pinfo["user_id"]);
452  $passed_info = $this->lng->txt("crs_passed_status_manual_by") . ": " . $name["login"];
453  }
454  }
455  if ($pinfo["timestamp"]) {
456  $passed_info .= "<br />" . ilDatePresentation::formatDate($pinfo["timestamp"]);
457  $passed_timestamp = $pinfo["timestamp"];
458  }
459  }
460  $a_user_data[$user_id]["passed_info"] = $passed_info;
461  $a_user_data[$user_id]["passed_timestamp"] = $passed_timestamp;
462  }
463  }
464 
465  // Custom user data fields
466  if ($udf_ids !== []) {
467  $data = ilUserDefinedData::lookupData($usr_ids, $udf_ids);
468  foreach ($data as $usr_id => $fields) {
469  if (!$this->checkAcceptance((int) $usr_id)) {
470  continue;
471  }
472 
473  foreach ($fields as $field_id => $value) {
474  $a_user_data[$usr_id]['udf_' . $field_id] = $value;
475  }
476  }
477  }
478  // Object specific user data fields
479  if ($odf_ids !== []) {
481  foreach ($data as $usr_id => $fields) {
482  $usr_id = (int) $usr_id;
483  // #7264: as we get data for all course members filter against user data
484  if (!$this->checkAcceptance($usr_id) || !in_array($usr_id, $usr_ids)) {
485  continue;
486  }
487 
488  foreach ($fields as $field_id => $value) {
489  $a_user_data[$usr_id]['odf_' . $field_id] = $value;
490  }
491  }
492 
493  // add last edit date
494  foreach (ilObjectCustomUserFieldHistory::lookupEntriesByObjectId($this->getRepositoryObject()->getId()) as $usr_id => $edit_info) {
495  if (!isset($a_user_data[$usr_id])) {
496  continue;
497  }
498 
499  if ($usr_id == $edit_info['update_user']) {
500  $a_user_data[$usr_id]['odf_last_update'] = '';
501  $a_user_data[$usr_id]['odf_info_txt'] = $this->lng->txt('cdf_edited_by_self');
502  if (ilPrivacySettings::getInstance()->enabledAccessTimesByType($this->getRepositoryObject()->getType())) {
503  $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
504  $a_user_data[$usr_id]['odf_info_txt'] .= (', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
505  }
506  } else {
507  $a_user_data[$usr_id]['odf_last_update'] = $edit_info['update_user'];
508  $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
509 
510  $name = $this->lookupUserName((int) $edit_info['update_user']);
511  $a_user_data[$usr_id]['odf_info_txt'] = ($name['firstname'] . ' ' . $name['lastname'] . ', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
512  }
513  }
514  }
515 
516  // consultation hours
517  if ($this->isColumnSelected('consultation_hour')) {
519  $this->getRepositoryObject()->getId(),
520  $this->user->getId()
521  ) as $buser => $booking) {
522  if (isset($a_user_data[$buser])) {
523  $a_user_data[$buser]['consultation_hour'] = $booking[0]['dt'];
524  $a_user_data[$buser]['consultation_hour_end'] = $booking[0]['dtend'];
525  $a_user_data[$buser]['consultation_hours'] = $booking;
526  }
527  }
528  }
529 
530  // always sort by name first
531  $a_user_data = ilArrayUtil::sortArray(
532  $a_user_data,
533  'name',
534  $this->getOrderDirection()
535  );
536  $this->setData($a_user_data);
537  }
static lookupData(array $a_user_ids, array $a_field_ids)
Lookup data.
setData(array $a_data)
static _getValuesByObjId(int $a_obj_id)
const IL_CAL_UNIX
static getUserListData(string $a_order_field, string $a_order_dir, int $a_offset, int $a_limit, string $a_string_filter="", string $a_activation_filter="", ?ilDateTime $a_last_login_filter=null, bool $a_limited_access_filter=false, bool $a_no_courses_filter=false, int $a_course_group_filter=0, int $a_role_filter=0, ?array $a_user_folder_filter=null, ?array $a_additional_fields=null, ?array $a_user_filter=null, string $a_first_letter="", string $a_authentication_filter="")
Get data for user administration list.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isColumnSelected(string $col)
static lookupManagedBookingsForObject(int $a_obj_id, int $a_usr_id)
Lookup bookings for own and managed consultation hours of an object.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
determineOffsetAndOrder(bool $a_omit_offset=false)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilCourseParticipantsTableGUI::$access
protected

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

◆ $cached_user_names

array ilCourseParticipantsTableGUI::$cached_user_names = []
protected

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

◆ $preLoader

ilCertificateUserForObjectPreloader ilCourseParticipantsTableGUI::$preLoader = null
private

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

◆ $privacy

ilPrivacySettings ilCourseParticipantsTableGUI::$privacy
private

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

◆ $rbacReview

ilRbacReview ilCourseParticipantsTableGUI::$rbacReview
protected

Definition at line 35 of file class.ilCourseParticipantsTableGUI.php.

◆ $show_learning_progress

bool ilCourseParticipantsTableGUI::$show_learning_progress = false
protected

Definition at line 27 of file class.ilCourseParticipantsTableGUI.php.

◆ $show_lp_status_sync

bool ilCourseParticipantsTableGUI::$show_lp_status_sync = false
protected

Definition at line 29 of file class.ilCourseParticipantsTableGUI.php.

◆ $show_timings

bool ilCourseParticipantsTableGUI::$show_timings = false
protected

Definition at line 28 of file class.ilCourseParticipantsTableGUI.php.

◆ $user

ilObjUser ilCourseParticipantsTableGUI::$user
protected

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


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