Fix #1569 add option to control whether notices are included in combined board

This commit is contained in:
Kijin Sung 2021-01-19 21:22:31 +09:00
parent 06f973d227
commit 77403f384a
5 changed files with 23 additions and 3 deletions

View file

@ -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())

View file

@ -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);

View file

@ -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.<br />Durations shorter than 1 day can be set as fractions of a day, e.g. 0.25 days = 6 hours.';
$lang->about_board_include_days = 'Only combine recent documents. If this value is set to 0, all documents from selected boards will be combined.<br />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';

View file

@ -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을 입력하면 위에서 선택한 게시판의 모든 글을 모아서 보여 줍니다.<br />1일 미만의 기간은 소수로 표현할 수 있습니다. 예: 0.25일 = 6시간';
$lang->about_board_include_days = '최근 글만 모으도록 설정할 수 있습니다. 0을 입력하면 위에서 선택한 게시판의 모든 글을 모아서 보여 줍니다.<br />1일 미만의 기간은 소수로 표현할 수 있습니다. 예: 0.25일 = 6시간';
$lang->cmd_board_include_notice = '공지글 포함';

View file

@ -32,6 +32,13 @@
<p class="x_help-block">{$lang->about_board_include_days}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->cmd_board_include_notice}</label>
<div class="x_controls">
<label class="x_inline"><input name="include_notice" type="radio" value="Y" checked="checked"|cond="$module_info->include_notice !== 'N'" /> {$lang->cmd_yes} </label>
<label class="x_inline"><input name="include_notice" type="radio" value="N" checked="checked"|cond="$module_info->include_notice === 'N'" /> {$lang->cmd_no} </label>
</div>
</div>
<div class="btnArea">
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
</div>