From 77403f384adedf9677a5cb48201a685d84fbec78 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 19 Jan 2021 21:22:31 +0900 Subject: [PATCH] Fix #1569 add option to control whether notices are included in combined board --- modules/board/board.admin.controller.php | 4 ++++ modules/board/board.view.php | 9 ++++++++- modules/board/lang/en.php | 3 ++- modules/board/lang/ko.php | 3 ++- modules/board/tpl/addition_setup.html | 7 +++++++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/modules/board/board.admin.controller.php b/modules/board/board.admin.controller.php index e1b0ed55f..889076cd2 100644 --- a/modules/board/board.admin.controller.php +++ b/modules/board/board.admin.controller.php @@ -77,6 +77,8 @@ class boardAdminController extends board { if ($args->module_srl) { $args->include_modules = $module_info->include_modules; + $args->include_days = $module_info->include_days; + $args->include_notice = $module_info->include_notice; } // insert/update the board module based on module_srl @@ -187,6 +189,7 @@ class boardAdminController extends board { $module_srl = intval($vars->target_module_srl); $include_modules = array_map('intval', $vars->include_modules ?: []); $include_days = max(0, floatval($vars->include_days)); + $include_notice = $vars->include_notice === 'Y' ? 'Y' : 'N'; $module_info = ModuleModel::getModuleInfoByModuleSrl($module_srl); if (!$module_info) @@ -198,6 +201,7 @@ class boardAdminController extends board { return $item > 0; })); $module_info->include_days = floatval(number_format($include_days, 2, '.', '')); + $module_info->include_notice = $include_notice; $output = getController('module')->updateModule($module_info); if (!$output->toBool()) diff --git a/modules/board/board.view.php b/modules/board/board.view.php index b4f3869a7..a11fb5b3c 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -464,7 +464,14 @@ class boardView extends board } $args = new stdClass(); - $args->module_srl = $this->include_modules ?: $this->module_srl; + if (isset($this->module_info->include_notice) && $this->module_info->include_notice === 'N') + { + $args->module_srl = $this->module_srl; + } + else + { + $args->module_srl = $this->include_modules ?: $this->module_srl; + } $output = DocumentModel::getNoticeList($args, $this->columnList); $notice_list = $output->data; $this->_fillModuleTitles($notice_list); diff --git a/modules/board/lang/en.php b/modules/board/lang/en.php index 63499f948..8d5a97631 100644 --- a/modules/board/lang/en.php +++ b/modules/board/lang/en.php @@ -97,4 +97,5 @@ $lang->about_board_combined_board = 'You can use this board to view documents fr $lang->cmd_board_include_modules = 'Include Boards'; $lang->cmd_board_include_modules_none = '(None)'; $lang->cmd_board_include_days = 'Include Duration'; -$lang->about_board_include_days = 'Only combine recent documents. If this value is set to 0, all documents from selected boards will be combined.
Durations shorter than 1 day can be set as fractions of a day, e.g. 0.25 days = 6 hours.'; \ No newline at end of file +$lang->about_board_include_days = 'Only combine recent documents. If this value is set to 0, all documents from selected boards will be combined.
Durations shorter than 1 day can be set as fractions of a day, e.g. 0.25 days = 6 hours.'; +$lang->cmd_board_include_notice = 'Include Notices'; \ No newline at end of file diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index 490144adc..4e42d86d9 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -109,4 +109,5 @@ $lang->about_board_combined_board = '다른 게시판의 글을 모아서 볼 $lang->cmd_board_include_modules = '포함할 게시판 선택'; $lang->cmd_board_include_modules_none = '(포함하지 않음)'; $lang->cmd_board_include_days = '포함할 기간'; -$lang->about_board_include_days = '최근 글만 모으도록 설정할 수 있습니다. 0을 입력하면 위에서 선택한 게시판의 모든 글을 모아서 보여 줍니다.
1일 미만의 기간은 소수로 표현할 수 있습니다. 예: 0.25일 = 6시간'; \ No newline at end of file +$lang->about_board_include_days = '최근 글만 모으도록 설정할 수 있습니다. 0을 입력하면 위에서 선택한 게시판의 모든 글을 모아서 보여 줍니다.
1일 미만의 기간은 소수로 표현할 수 있습니다. 예: 0.25일 = 6시간'; +$lang->cmd_board_include_notice = '공지글 포함'; \ No newline at end of file diff --git a/modules/board/tpl/addition_setup.html b/modules/board/tpl/addition_setup.html index 9cb2e128d..78b6214e4 100644 --- a/modules/board/tpl/addition_setup.html +++ b/modules/board/tpl/addition_setup.html @@ -32,6 +32,13 @@

{$lang->about_board_include_days}

+
+ +
+ + +
+