diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index db841f92b..b88af1a9e 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -693,6 +693,11 @@ class ModuleHandler extends Handler { return null; } + // If the requested mid is set to include documents from other modules, preserve the current mid. + elseif($this->mid && ($mid_info = ModuleModel::getModuleInfoByMid($this->mid)) && $mid_info->include_modules && in_array($module_info->module_srl, explode(',', $mid_info->include_modules))) + { + return $mid_info; + } // If this is a GET request, redirect to the correct mid. elseif(Context::getRequestMethod() === 'GET') { diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index 25d4879c3..b938bb828 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -167,6 +167,13 @@ class boardController extends board } } + // Preserve module_srl if the document belongs to a module that is included in this board + if ($oDocument->get('module_srl') != $obj->module_srl && in_array($oDocument->get('module_srl'), explode(',', $this->module_info->include_modules ?: ''))) + { + $obj->module_srl = $oDocument->get('module_srl'); + $obj->category_srl = $oDocument->get('category_srl'); + } + // notice & document style same as before if not manager if(!$this->grant->manager) { diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 526cf6063..32933f52f 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -36,6 +36,11 @@ class boardView extends board $this->page_count = $this->module_info->page_count; } $this->except_notice = $this->module_info->except_notice == 'N' ? FALSE : TRUE; + $this->include_modules = $this->module_info->include_modules ? explode(',', $this->module_info->include_modules) : []; + if (count($this->include_modules) && !in_array($this->module_info->module_srl, $this->include_modules)) + { + $this->include_modules[] = $this->module_info->module_srl; + } // $this->_getStatusNameListecret option backward compatibility $statusList = $this->_getStatusNameList(); @@ -244,7 +249,10 @@ class boardView extends board // if the module srl is not consistent if($oDocument->get('module_srl') != $this->module_info->module_srl && $oDocument->get('is_notice') !== 'A') { - throw new Rhymix\Framework\Exceptions\TargetNotFound; + if (!in_array($oDocument->get('module_srl'), $this->include_modules)) + { + throw new Rhymix\Framework\Exceptions\TargetNotFound; + } } // check the manage grant @@ -466,7 +474,7 @@ class boardView extends board // setup module_srl/page number/ list number/ page count $args = new stdClass(); - $args->module_srl = $this->module_srl; + $args->module_srl = $this->include_modules ?: $this->module_srl; $args->page = intval(Context::get('page')) ?: null; $args->list_count = $this->list_count; $args->page_count = $this->page_count; diff --git a/modules/board/lang/en.php b/modules/board/lang/en.php index dbef6b2c5..65a317803 100644 --- a/modules/board/lang/en.php +++ b/modules/board/lang/en.php @@ -94,4 +94,5 @@ $lang->delete_placeholder = 'Delete Placeholder'; $lang->msg_document_notify_mail = '[%s] The new post : %s'; $lang->cmd_board_combined_board = 'Combined Board'; $lang->about_board_combined_board = 'You can use this board to view documents from other boards. Press the Ctrl key and click to select multiple boards.'; -$lang->cmd_board_include_modules = 'Include Boards'; \ No newline at end of file +$lang->cmd_board_include_modules = 'Include Boards'; +$lang->cmd_board_include_modules_none = '(None)'; \ No newline at end of file diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index f827461cc..dd740c15a 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -106,4 +106,5 @@ $lang->cmd_comment_vote_user = '이 댓글의 추천인 목록'; $lang->msg_not_target = '문서 또는 댓글의 추천인목록만 조회가능합니다.'; $lang->cmd_board_combined_board = '통합 게시판'; $lang->about_board_combined_board = '다른 게시판의 글을 모아서 볼 수 있습니다. 여러 게시판을 선택하려면 Ctrl 키를 누르고 클릭하세요.'; -$lang->cmd_board_include_modules = '포함할 게시판 선택'; \ No newline at end of file +$lang->cmd_board_include_modules = '포함할 게시판 선택'; +$lang->cmd_board_include_modules_none = '(포함하지 않음)'; \ No newline at end of file diff --git a/modules/board/tpl/addition_setup.html b/modules/board/tpl/addition_setup.html index 7b0d4c0d4..1f6364faf 100644 --- a/modules/board/tpl/addition_setup.html +++ b/modules/board/tpl/addition_setup.html @@ -17,6 +17,7 @@