diff --git a/app/controllers/file.php b/app/controllers/file.php index 34f1fe9edb2e34971581c53d748fda6ce34b9d18..cd60699c2ecbc9b6cab885df3a0e6bcabee44aeb 100644 --- a/app/controllers/file.php +++ b/app/controllers/file.php @@ -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; } diff --git a/app/controllers/resources/resource.php b/app/controllers/resources/resource.php index 6bec6e277d3226577980ed85106a2182a9b8af9f..59cd68137b2a152cadaaa9d21c231614ffa9c74a 100644 --- a/app/controllers/resources/resource.php +++ b/app/controllers/resources/resource.php @@ -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; } } diff --git a/app/views/resources/resource/_standard_properties_display_part.php b/app/views/resources/resource/_standard_properties_display_part.php index 48946c98ab8e5aad49016ef1cbc654f8e13510f8..890b3f719d99f65d45fb44de477c2c4bf606506e 100644 --- a/app/views/resources/resource/_standard_properties_display_part.php +++ b/app/views/resources/resource/_standard_properties_display_part.php @@ -24,7 +24,7 @@ <table class="default"> <colgroup> - <col style="width: 70%"> + <col style="width: 30%"> <col> </colgroup> <thead> diff --git a/app/views/resources/resource/files.php b/app/views/resources/resource/files.php index dd3df9afa1b56d9f94ace6c7cbb713f9bf9034e8..fc46b92e1e5ae281e253bda1752244a01d4d7ae3 100644 --- a/app/views/resources/resource/files.php +++ b/app/views/resources/resource/files.php @@ -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> diff --git a/app/views/resources/room/index.php b/app/views/resources/room/index.php index 8782832e50314f44382f74d4753c2fd254e19ec3..658994409ff61b61b66eea16ec0f74d17f7ee419 100644 --- a/app/views/resources/room/index.php +++ b/app/views/resources/room/index.php @@ -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)) : ?> diff --git a/lib/filesystem/StandardFile.php b/lib/filesystem/StandardFile.php index 5723ef48f659b29170e2ecc1b92dafe73538e2d2..4f7c6164b1577d6b097a106948458334f0ef60a0 100644 --- a/lib/filesystem/StandardFile.php +++ b/lib/filesystem/StandardFile.php @@ -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), diff --git a/resources/assets/javascripts/lib/files.js b/resources/assets/javascripts/lib/files.js index f806787d1585ab9fa1e55a7b62598e2def5a951d..7b628f60311b17521a723319dac4120c3095ecc6 100644 --- a/resources/assets/javascripts/lib/files.js +++ b/resources/assets/javascripts/lib/files.js @@ -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]; }