From 87a34af69e049254a83370ef7d97db6be32293d6 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 23 Mar 2023 22:44:47 +0900 Subject: [PATCH] Fix #2072 redirect to proper URL if a document with is_notice=A is requested without mid --- classes/module/ModuleHandler.class.php | 9 +++++++-- modules/document/tpl/document_list.html | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index f0b7bf3f0..89df6fb5d 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -733,7 +733,12 @@ class ModuleHandler extends Handler /** * Check the value of $document_srl. This method is called during init(). * - * @return object|false + * This method returns: + * - Module info object if the document can be shown in the module, + * - null if the document can be shown but the module is unspecified, + * - false if we should redirect to another module. + * + * @return object|null|false */ protected function _checkDocumentSrl() { @@ -745,7 +750,7 @@ class ModuleHandler extends Handler if(!$this->mid || $this->mid !== $module_info->mid) { // If the document is notice-all, preserve the current mid. - if($module_info->is_notice === 'A') + if($module_info->is_notice === 'A' && !empty($this->mid)) { return null; } diff --git a/modules/document/tpl/document_list.html b/modules/document/tpl/document_list.html index 28e90d2e2..ef3f27c5d 100644 --- a/modules/document/tpl/document_list.html +++ b/modules/document/tpl/document_list.html @@ -18,7 +18,7 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}'; | {$status_name_list['SECRET']}({number_format($total_count)}) | - {$status_name_list['TEMP']}({number_format($total_count)}) + {$status_name_list['TEMP']}({number_format($total_count)}) | {$lang->cmd_declared_list} | @@ -33,7 +33,7 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
-
+ @@ -51,8 +51,8 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}'; - {escape($oDocument->getTitleText(), false)}{$lang->no_title_document} - + {escape($oDocument->getTitleText(), false)}{$lang->no_title_document} + - {$module_list[$oDocument->get('module_srl')]->browser_title} @@ -205,7 +205,7 @@ jQuery(function($){ $modalBody.removeClass('showTree'); } else if(thisValue == 'move' || thisValue == 'copy') { $.xeShowMenuSelectorIn($('._menuSelector')); - + $modalBody.addClass('showTree'); $tree = $('._menuSelector .tree'); $tree.bind('select_node.jstree', function(a,b){