Skip to content
Snippets Groups Projects
Commit c0f574b2 authored by Dennis Benz's avatar Dennis Benz Committed by Elmar Ludwig
Browse files

Raumverwaltung: Fehler bei Dokumenten in Räumen, fixes #2829

Closes #2829

Merge request !2208
parent 831e46e2
No related branches found
No related tags found
No related merge requests found
......@@ -149,6 +149,10 @@ class FileController extends AuthenticatedController
$changes['redirect'] = $this->url_for("file/edit_license/{$folder->getId()}", [
'file_refs' => $ref_ids,
]);
} elseif ($folder->range_type === 'Resource') {
$changes['close_dialog'] = [
'reload-on-close' => true
];
} else {
$changes['close_dialog'] = true;
}
......
......@@ -1471,5 +1471,7 @@ class Resources_ResourceController extends AuthenticatedController
//Set the last visit date to the current timestamp:
$this->last_visitdate = time();
$this->show_bulk_checkboxes = true;
}
}
......@@ -24,7 +24,7 @@
<table class="default">
<colgroup>
<col style="width: 70%">
<col style="width: 30%">
<col>
</colgroup>
<thead>
......
......@@ -70,16 +70,16 @@
]
) ?>
<? endif ?>
<? if ($folder->isWritable($GLOBALS['user']->id)): ?>
<?= Studip\LinkButton::create(
_('Dokument hinzufügen'),
'#',
[
'onclick' => 'STUDIP.Files.openAddFilesWindow(); return false;'
]
) ?>
<? endif ?>
</span>
<? if ($folder->isWritable($GLOBALS['user']->id)): ?>
<?= Studip\LinkButton::create(
_('Dokument hinzufügen'),
'#',
[
'onclick' => 'STUDIP.Files.openAddFilesWindow(); return false;'
]
) ?>
<? endif ?>
</td>
</tr>
</tfoot>
......
......@@ -51,10 +51,6 @@
<h1><?= _('Dateien') ?></h1>
</header>
<table class="default sortable-table" data-sortlist="[[2, 0]]">
<colgroup>
<col style="width: 70%">
<col>
</colgroup>
<?= $this->render_partial('files/_files_thead') ?>
<? foreach ($resource_folder->getFiles() as $file): ?>
<? if ($file->isVisible($GLOBALS['user']->id)) : ?>
......
......@@ -298,6 +298,7 @@ class StandardFile implements FileType, ArrayAccess, StandardFileInterface
$this->isEditable($GLOBALS['user']->id)
&& Config::get()->OERCAMPUS_ENABLED
&& $GLOBALS['perm']->have_perm(Config::get()->OER_PUBLIC_STATUS)
&& in_array($this->fileref->folder->range_type, ['course', 'user'])
) {
$actionMenu->addLink(
URLHelper::getURL('dispatch.php/file/share_oer/' . $this->fileref->id),
......@@ -311,6 +312,7 @@ class StandardFile implements FileType, ArrayAccess, StandardFileInterface
$GLOBALS['user']->id !== 'nobody' && $this->fileref->user_id !== $GLOBALS['user']->id &&
!$this->isEditable($GLOBALS['user']->id) &&
in_array($this->fileref->content_terms_of_use_id, ['SELFMADE_NONPUB', 'FREE_LICENSE'])
&& $this->fileref->folder->range_type === 'course'
) {
$actionMenu->addLink(
URLHelper::getURL('dispatch.php/file/suggest_oer/' . $this->fileref->id),
......
......@@ -241,6 +241,11 @@ const Files = {
},
addFileDisplay: (html, delay = 0) => {
// Prevent undefined filesapp errors
if (STUDIP.Files.filesapp === undefined) {
return;
}
if (!Array.isArray(html)) {
html = html === null ? [] : [html];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment