From c0f574b2f9142a56558e96af59fb9525b575b0c4 Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Sat, 21 Oct 2023 07:07:06 +0000 Subject: =?UTF-8?q?Raumverwaltung:=20Fehler=20bei=20Dokumenten=20in=20R?= =?UTF-8?q?=C3=A4umen,=20fixes=20#2829?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #2829 Merge request studip/studip!2208 --- app/controllers/file.php | 4 ++++ app/controllers/resources/resource.php | 2 ++ .../resource/_standard_properties_display_part.php | 2 +- app/views/resources/resource/files.php | 18 +++++++++--------- app/views/resources/room/index.php | 4 ---- lib/filesystem/StandardFile.php | 2 ++ resources/assets/javascripts/lib/files.js | 5 +++++ 7 files changed, 23 insertions(+), 14 deletions(-) diff --git a/app/controllers/file.php b/app/controllers/file.php index 34f1fe9..cd60699 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 6bec6e2..59cd681 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 48946c9..890b3f7 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 @@ - + diff --git a/app/views/resources/resource/files.php b/app/views/resources/resource/files.php index dd3df9a..fc46b92 100644 --- a/app/views/resources/resource/files.php +++ b/app/views/resources/resource/files.php @@ -70,16 +70,16 @@ ] ) ?> - isWritable($GLOBALS['user']->id)): ?> - 'STUDIP.Files.openAddFilesWindow(); return false;' - ] - ) ?> - + isWritable($GLOBALS['user']->id)): ?> + 'STUDIP.Files.openAddFilesWindow(); return false;' + ] + ) ?> + diff --git a/app/views/resources/room/index.php b/app/views/resources/room/index.php index 8782832..6589944 100644 --- a/app/views/resources/room/index.php +++ b/app/views/resources/room/index.php @@ -51,10 +51,6 @@

- - - - render_partial('files/_files_thead') ?> getFiles() as $file): ?> isVisible($GLOBALS['user']->id)) : ?> diff --git a/lib/filesystem/StandardFile.php b/lib/filesystem/StandardFile.php index 5723ef4..4f7c616 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 f806787..7b628f6 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]; } -- cgit v1.0