포인트 지급 방식 변경, 댓글 수정 허용 관련 문제점 개선

This commit is contained in:
qw5414 2016-02-09 02:11:29 +09:00
parent ec2bbca41e
commit a56954684a
7 changed files with 66 additions and 13 deletions

View file

@ -196,7 +196,7 @@ class boardController extends board
// if the document is not existed
if(!$document_srl)
{
return $this->doError('msg_invalid_document');
return new Object(-1, 'msg_invalid_document');
}
$oDocumentModel = &getModel('document');
@ -302,8 +302,18 @@ class boardController extends board
if(!$obj->comment_srl)
{
$obj->comment_srl = getNextSequence();
} else {
}
else
{
$comment = $oCommentModel->getComment($obj->comment_srl, $this->grant->manager);
if($this->module_info->protect_comment === 'Y' && $this->grant->manager == false)
{
$childs = $oCommentModel->getChildComments($obj->comment_srl);
if (count($childs) > 0)
{
return new Object(-1, 'msg_board_protect_comment');
}
}
}
$oMemberModel = getModel('member');
@ -330,11 +340,15 @@ class boardController extends board
$output = $oCommentController->insertComment($obj, $bAnonymous);
// parent_srl is not existed
} else {
}
else
{
$output = $oCommentController->insertComment($obj, $bAnonymous);
}
// update the comment if it is not existed
} else {
}
else
{
// check the grant
if(!$comment->isGranted())
{
@ -343,7 +357,6 @@ class boardController extends board
$obj->parent_srl = $comment->parent_srl;
$output = $oCommentController->updateComment($obj, $this->grant->manager);
$comment_srl = $obj->comment_srl;
}
if(!$output->toBool())
@ -366,7 +379,18 @@ class boardController extends board
$comment_srl = Context::get('comment_srl');
if(!$comment_srl)
{
return $this->doError('msg_invalid_request');
return new Object(-1, 'msg_invalid_request');
}
$oCommentModel = getModel('comment');
if($this->module_info->protect_comment === 'Y' && $this->grant->manager==false)
{
$childs = $oCommentModel->getChildComments($comment_srl);
if(count($childs) > 0)
{
return new Object(-1, 'msg_board_protect_comment');
}
}
// generate comment controller object

View file

@ -30,6 +30,7 @@ $lang->about_secret = '게시판 및 댓글의 비밀글 기능을 사용할 수
$lang->about_admin_mail = '글이나 댓글이 등록될때 등록된 메일주소로 메일이 발송됩니다. 콤마(,)로 연결시 다수의 메일주소로 발송할 수 있습니다.';
$lang->about_list_config = '게시판의 목록형식 사용시 원하는 항목들로 배치를 할 수 있습니다. 단 스킨에서 지원하지 않는 경우 불가능합니다. 대상항목/ 표시항목의 항목을 더블클릭하면 추가/ 제거가 됩니다.';
$lang->about_use_status = '글 작성 시 선택할 수 있는 상태를 지정해주세요.';
$lang->about_protect_comment = '댓글의 댓글이 있을경우 해당댓글을 삭제 및 수정을 할 수 없도록 합니다.';
$lang->msg_not_enough_point = '포인트가 부족합니다';
$lang->write_comment = '댓글 쓰기';
$lang->msg_not_allow_comment = '해당 글의 댓글 쓰기가 잠겨있습니다.';
@ -40,7 +41,9 @@ $lang->category_settings = '분류 설정';
$lang->hide_category = '분류 숨기기';
$lang->about_hide_category = '임시로 분류를 사용하지 않으려면 체크하세요.';
$lang->protect_content = '글 보호 기능';
$lang->protect_comment = '댓글 보호 기능';
$lang->about_protect_content = '작성된 글에 댓글이 작성된 경우 글 작성자는 해당 글을 수정하거나 삭제 할 수 없습니다. ';
$lang->msg_protect_content = '댓글이 작성된 게시물의 글을 수정 또는 삭제 할 수 없습니다.';
$lang->msg_admin_document_no_modify = '최고관리자의 게시물을 수정할 권한이 없습니다.';
$lang->msg_admin_comment_no_modify = '최고관리자의 댓글을 수정할 권한이 없습니다.';
$lang->msg_board_protect_comment = '댓글이 작성된 댓글의 글을 수정 또는 삭제할 수 없습니다.';

View file

@ -68,7 +68,7 @@
<input type="text" name="page_count" id="page_count" value="{$module_info->page_count?$module_info->page_count:10}" style="width:30px" />
<p class="x_help-inline">{$lang->about_page_count}</p>
</div>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="lang_header_text">{$lang->header_text}</label>
<div class="x_controls">
@ -135,7 +135,7 @@
<input type="text" name="mobile_page_count" id="mobile_page_count" value="{$module_info->mobile_page_count?$module_info->mobile_page_count:5}" style="width:30px" />
<p class="x_help-inline">{$lang->about_mobile_page_count}</p>
</div>
</div>
</div>
</section>
<section class="section">
<h1>{$lang->subtitle_advanced}</h1>
@ -199,12 +199,18 @@
<label class="x_inline" for="consultation"><input type="checkbox" name="consultation" id="consultation" value="Y" checked="checked"|cond="$module_info->consultation == 'Y'" /> {$lang->about_consultation}</label>
</div>
</div>
<div class="x_control-group">
<div class="x_control-group">
<label class="x_control-label">{$lang->protect_content}</label>
<div class="x_controls">
<label class="x_inline" for="protect_content"><input type="checkbox" name="protect_content" id="protect_content" value="Y" checked="checked"|cond="$module_info->protect_content == 'Y'" /> {$lang->about_protect_content}</label>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->protect_comment}</label>
<div class="x_controls">
<label class="x_inline" for="protect_comment"><input type="checkbox" name="protect_comment" id="protect_comment" value="Y" checked="checked"|cond="$module_info->protect_comment == 'Y'" /> {$lang->about_protect_comment}</label>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->status}</label>
<div class="x_controls">

View file

@ -59,3 +59,6 @@ $lang->search_target_list['last_login'] = '최근 로그인 일시';
$lang->search_target_list['last_login_more'] = '최근 로그인 일시(이상)';
$lang->search_target_list['last_login_less'] = '최근 로그인 일시(이하)';
$lang->search_target_list['extra_vars'] = '사용자 정의';
$lang->no_point_date = '댓글작성 포인트 기간';
$lang->about_no_point_date = '설정한 날자보다 이전에 게시된 글에 대해서 댓글을 작성하여도 포인트를 지급하지 않습니다. (단위는 일단위)';
$lang->day_ago = '일전';

View file

@ -24,6 +24,7 @@ class pointAdminController extends point
$config = $oModuleModel->getModuleConfig('point');
// Arrange variables
$args = Context::getRequestVars();
$oModuleController = getController('module');
//if module IO config is off
if($args->able_module == 'Y')
@ -64,7 +65,10 @@ class pointAdminController extends point
// Check if reading a document is not allowed
if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y';
else $config->disable_read_document = 'N';
//check is reading a document is not regdate setting
$config->no_point_date = (int)$args->no_point_date;
$oMemberModel = getModel('member');
$group_list = $oMemberModel->getGroups();
@ -114,11 +118,9 @@ class pointAdminController extends point
$config->able_module = 'N';
// Delete Triggers
$oModuleController = getController('module');
$oModuleController->deleteModuleTriggers('point');
}
// Save
$oModuleController = getController('module');
$oModuleController->insertModuleConfig('point', $config);
$this->setMessage('success_updated');

View file

@ -234,10 +234,18 @@ class pointController extends point
$document_srl = $obj->document_srl;
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
if(!$oDocument->isExists() || abs($oDocument->get('member_srl'))==abs($member_srl)) return new Object();
// Get the point module information
$oModuleModel = getModel('module');
$config = $oModuleModel->getModuleConfig('point');
if($config->no_point_date > 0)
{
if($oDocument->get('regdate') < date('YmdHis', strtotime('-'.$config->no_point_date.' day')))
{
return new Object();
}
}
if(!$oDocument->isExists() || abs($oDocument->get('member_srl'))==abs($member_srl)) return new Object();
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
// Get the points of the member
$oPointModel = getModel('point');

View file

@ -91,6 +91,13 @@
{$lang->about_disable_read_document}
</div>
</div>
<div class="x_control-group">
<label for="no_point_date" class="x_control-label">{$lang->no_point_date}</label>
<div class="x_controls" style="padding-top:3px">
<input type="number" name="no_point_date" id="no_point_date" value="{$config->no_point_date}" style="width:50px;" />{$lang->day_ago}
<p>{$lang->about_no_point_date}</p>
</div>
</div>
<div class="x_clearfix btnArea">
<span class="x_pull-right"><input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_save}" /></span>
</div>