41 $this->ui_fac = $DIC->ui()->factory();
42 $this->ui_ren = $DIC->ui()->renderer();
46 $this->
setId(
'myst_lcrt');
50 $this->
setRowTemplate(
'tpl.list_courses_row.html',
"components/ILIAS/MyStaff");
51 $this->
setFormAction($DIC->ctrl()->getFormAction($parent_obj));
82 'filters' => $this->
filter,
95 $data = $certificates_fetcher->getData($options);
103 $options[
'limit'] = array(
107 $max_data = $certificates_fetcher->getData($options);
115 $item = new \ilTextInputGUI($DIC->language()->txt(
"title"),
"obj_title");
117 $item->readFromSession();
118 $this->
filter[
'obj_title'] = $item->getValue();
121 $item = new \ilTextInputGUI(
122 $DIC->language()->txt(
"login")
123 .
"/" . $DIC->language()->txt(
"email")
124 .
"/" . $DIC->language()->txt(
"name"),
129 $item->readFromSession();
130 $this->
filter[
'user'] = $item->getValue();
134 $options[0] = $DIC->language()->txt(
'mst_opt_all');
135 foreach ($paths as $org_ref_id =>
$path) {
136 $options[$org_ref_id] =
$path;
138 $item = new \ilSelectInputGUI($DIC->language()->txt(
'obj_orgu'),
'org_unit');
139 $item->setOptions($options);
141 $item->readFromSession();
142 $this->
filter[
'org_unit'] = $item->getValue();
148 if ($this->selectable_columns_cached) {
163 $cols[
'objectTitle'] = array(
164 'txt' => $DIC->language()->txt(
'title'),
167 'sort_field' =>
'objectTitle',
169 $cols[
'issuedOnTimestamp'] = array(
170 'txt' => $DIC->language()->txt(
'mst_cert_issued_on'),
173 'sort_field' =>
'issuedOnTimestamp',
175 if ($arr_searchable_user_columns[
'login'] ??
false) {
176 $cols[
'userLogin'] = array(
177 'txt' => $DIC->language()->txt(
'login'),
180 'sort_field' =>
'userLogin',
183 if ($arr_searchable_user_columns[
'firstname'] ??
false) {
184 $cols[
'userFirstName'] = array(
185 'txt' => $DIC->language()->txt(
'firstname'),
188 'sort_field' =>
'userFirstName',
191 if ($arr_searchable_user_columns[
'lastname'] ??
false) {
192 $cols[
'userLastName'] = array(
193 'txt' => $DIC->language()->txt(
'lastname'),
196 'sort_field' =>
'userLastName',
200 if ($arr_searchable_user_columns[
'email'] ??
false) {
201 $cols[
'userEmail'] = array(
202 'txt' => $DIC->language()->txt(
'email'),
205 'sort_field' =>
'userEmail',
208 if ($arr_searchable_user_columns[
'org_units'] ??
false) {
209 $cols[
'usr_assinged_orgus'] = array(
210 'txt' => $DIC->language()->txt(
'objs_orgu'),
225 $sort = $v[
'sort_field'] ??
"";
232 $this->
addColumn($DIC->language()->txt(
'actions'));
238 if (isset($this->usr_orgu_names[$user_id])) {
239 return $this->usr_orgu_names[
$user_id];
242 return $this->usr_orgu_names[
$user_id] = \ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
252 final protected function fillRow(array $a_set): void
256 $set = array_pop($a_set);
258 $propGetter = \Closure::bind(
function ($prop) {
259 return $this->$prop ??
null;
264 case 'usr_assinged_orgus':
265 $this->tpl->setCurrentBlock(
'td');
266 $this->tpl->setVariable(
270 $this->tpl->parseCurrentBlock();
272 case 'issuedOnTimestamp':
273 $date_time = new \ilDateTime($propGetter($k),
IL_CAL_UNIX);
274 $this->tpl->setCurrentBlock(
'td');
275 $this->tpl->setVariable(
'VALUE', $date_time->get(
IL_CAL_DATE));
276 $this->tpl->parseCurrentBlock();
279 if ($propGetter($k) !==
null) {
280 $this->tpl->setCurrentBlock(
'td');
281 $this->tpl->setVariable(
283 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
285 $this->tpl->parseCurrentBlock();
287 $this->tpl->setCurrentBlock(
'td');
288 $this->tpl->setVariable(
'VALUE',
' ');
289 $this->tpl->parseCurrentBlock();
295 $button = $this->ui_fac->button()->shy($this->
lng->txt(
"mst_download_certificate"), $set->getDownloadLink());
296 $dropdown = $this->ui_fac->dropdown()->standard([$button])->withLabel($this->
lng->txt(
"actions"));
297 $this->tpl->setVariable(
'ACTIONS', $this->ui_ren->render($dropdown));
298 $this->tpl->parseCurrentBlock();
303 $set = array_pop($a_set);
307 $a_excel->
setCell($a_row, $col, $v);
314 $set = array_pop($a_set);
324 $propGetter = \Closure::bind(
function ($prop) {
325 return $this->$prop ??
null;
326 }, $user_certificate_dto, $user_certificate_dto);
328 $field_values = array();
331 case 'usr_assinged_orgus':
334 case 'issuedOnTimestamp':
335 $field_values[$k] = new \ilDateTime($propGetter($k),
IL_CAL_UNIX);
338 $field_values[$k] = strip_tags($propGetter($k) ??
"");
343 return $field_values;
setExportFormats(array $formats)
Set available export formats.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(\ilMStListCertificatesGUI $parent_obj, $parent_cmd=\ilMStListCertificatesGUI::CMD_INDEX)
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
Class ilMStListCertificates.
setEnableTitle(bool $a_enabletitle)
getTextRepresentationOfUsersOrgUnits(int $user_id)
setDisableFilterHiding(bool $a_val=true)
setFormName(string $a_name="")
getFieldValuesForExport(UserCertificateDto $user_certificate_dto)
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilMStListCertificatesTableGUI.
setExternalSorting(bool $a_val)
isColumnSelected(string $col)
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRowCSV(\ilCSVWriter $a_csv, array $a_set)
setDefaultOrderField(string $a_defaultorderfield)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
array $selectable_columns_cached
fillRowExcel(\ilExcel $a_excel, int &$a_row, array $a_set)
setDefaultOrderDirection(string $a_defaultorderdirection)
ILIAS UI Renderer $ui_ren
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
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)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
static _isEnabled($a_key)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
setFilterCols(int $a_val)
setExternalSegmentation(bool $a_val)
setPrefix(string $a_prefix)