Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(protected \ilBiblAdminLibraryFacadeInterface $facade
*/
public function executeCommand(): void
{
if ($this->ctrl()->getNextClass() === null) {
if ($this->ctrl()->getNextClass() === null || $this->ctrl()->getNextClass() === '') {
$cmd = $this->ctrl()->getCmd(self::CMD_INDEX);
$this->{$cmd}();
}
Expand Down
16 changes: 9 additions & 7 deletions components/ILIAS/Bibliographic/classes/Field/DataRetrieval.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,26 @@ public function getRows(
OrderingRowBuilder $row_builder,
array $visible_column_ids,
): \Generator {
$records = $this->getRecords($order);
$records = $this->getRecords();
foreach ($records as $idx => $record) {
$row_id = (string) $record['id'];
$field = $this->facade->fieldFactory()->findById($record['id']);
$record['data_type'] = $this->facade->translationFactory()->translate($field);
$record['is_standard_field'] = $field->isStandardField() ? $this->lng->txt('standard') : $this->lng->txt('custom');
yield $row_builder->buildDataRow($row_id, $record)
yield $row_builder->buildOrderingRow($row_id, $record)
->withDisabledAction('translate', !$this->has_write_access);
}
}

protected function getRecords(Order $order): array
protected function getRecords(?Order $order = null): array
{
$records = $this->facade->fieldFactory()->filterAllFieldsForTypeAsArray($this->facade->type());
[$order_field, $order_direction] = $order->join([], fn($ret, $key, $value): array => [$key, $value]);
usort($records, fn($a, $b): int => $a[$order_field] <=> $b[$order_field]);
if ($order_direction === 'DESC') {
return array_reverse($records);
if (!is_null($order)) {
[$order_field, $order_direction] = $order->join([], fn($ret, $key, $value): array => [$key, $value]);
usort($records, fn($a, $b): int => $a[$order_field] <=> $b[$order_field]);
if ($order_direction === 'DESC') {
return array_reverse($records);
}
}
return $records;
}
Expand Down
6 changes: 3 additions & 3 deletions components/ILIAS/Bibliographic/classes/Field/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public function __construct(

$this->components[] = $this->table = $this->ui_factory->table()->ordering(
$data_retrieval,
$this->lng->txt('filter'),
$columns,
new URI(
ILIAS_HTTP_PATH . "/" . $this->ctrl->getLinkTarget($this->calling_gui, \ilBiblAdminFieldGUI::CMD_SAVE_ORDERING)
)
),
$this->lng->txt('filter'),
$columns,
)->withActions($actions)->withRequest(
$DIC->http()->request()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,7 @@ protected function getReplaceBibliographicFileForm(): Standard
$rid = $bibl_obj->getResourceId() ? $bibl_obj->getResourceId()->serialize() : "";
$bibl_upload_handler = new ilObjBibliographicUploadHandlerGUI($rid);

$max_filesize_bytes = $this->upload_limit->getPhpUploadLimitInBytes();
$max_filesize_mb = round($max_filesize_bytes / 1024 / 1024, 1);
$info_file_limitations = $this->lng->txt('file_notice') . " " . number_format($max_filesize_mb, 1) . " MB <br>"
. $this->lng->txt('file_allowed_suffixes') . " .bib, .bibtex, .ris";
$info_file_limitations = $this->lng->txt('file_allowed_suffixes') . " .bib, .bibtex, .ris";
$section_replace_bibliographic_file = $this->ui_factory
->input()
->field()
Expand All @@ -502,7 +499,6 @@ protected function getReplaceBibliographicFileForm(): Standard
$this->lng->txt('bibliography_file'),
$info_file_limitations
)
->withMaxFileSize($max_filesize_bytes)
->withRequired(true)
->withAdditionalTransformation(
$this->getValidBiblFileSuffixConstraint()
Expand Down
Loading