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