Work: Allow invisible folders from documents - refs BT#20589

pull/4624/head
Christian 3 years ago
parent e366d94388
commit 6e0d1d1d07
  1. 12
      main/inc/lib/document.lib.php
  2. 2
      main/work/add_document.php

@ -3490,8 +3490,8 @@ class DocumentManager
// If we are in LP display hidden folder https://support.chamilo.org/issues/6679
$lp_visibility_condition = null;
if ($lp_id) {
if ($showInvisibleFiles) {
if ($lp_id || $showOnlyFolders) {
if ($showInvisibleFiles || $showOnlyFolders) {
$lp_visibility_condition .= ' OR last.visibility = 0';
}
}
@ -3600,6 +3600,14 @@ class DocumentManager
api_get_user_id()
);
if ($showOnlyFolders) {
$isFolder = ('folder' === $resource['filetype']);
$visibility = (int) $resource['visibility'];
if (!$isFolder && 0 == $visibility) {
continue;
}
}
if ($showInvisibleFiles === false) {
if (!$is_visible) {
continue;

@ -82,7 +82,7 @@ if (empty($docId)) {
'/',
api_get_path(WEB_CODE_PATH).'work/add_document.php?id='.$workId.'&'.api_get_cidreq(),
false,
false,
true,
false,
false
);

Loading…
Cancel
Save