휴지통 으로 보내는 옵션을 기본화 시키고 그러지 않을경우는 항상 자리 남김 또는 삭제 하도록 개선

This commit is contained in:
Johnny 2022-07-08 03:23:36 +09:00
parent df42e43259
commit a8331a48f3
2 changed files with 24 additions and 20 deletions

View file

@ -206,8 +206,11 @@ class commentAdminController extends comment
$this->_sendMessageForComment($message_content, $comment_srl_list);
}
// for message send - end
// comment into trash
if($isTrash == 'true')
{
$this->_moveCommentToTrash($comment_srl_list, $oCommentController, $oDB, $message_content);
}
$deleted_count = 0;
// Delete the comment posting
@ -225,38 +228,40 @@ class commentAdminController extends comment
if($module_info->comment_delete_message === 'yes')
{
$output = $oCommentController->updateCommentByDelete($comment, true);
if(!$output->toBool())
if(!$output->toBool() && $output->error !== -2)
{
$oDB->rollback();
return $output;
}
if($isTrash == 'true')
}
elseif(starts_with('only_comm', $module_info->comment_delete_message))
{
$childs = CommentModel::getChildComments($comment_srl);
if(count($childs) > 0)
{
$output = $oCommentController->moveCommentToTrash($comment, true);
if(!$output->toBool())
$output = $oCommentController->updateCommentByDelete($comment, true);
if(!$output->toBool() && $output->error !== -2)
{
$oDB->rollback();
return $output;
}
unset($comment_srl_list[$i]);
}
}
else
{
$output = $oCommentController->deleteComment($comment_srl, TRUE, toBool($isTrash));
if(!$output->toBool() && $output->error !== -2)
{
$oDB->rollback();
return $output;
}
}
if(!$output->toBool() && $output->error !== -2)
{
$oDB->rollback();
return $output;
}
$deleted_count++;
}
// comment into trash
if($isTrash == 'true')
{
$this->_moveCommentToTrash($comment_srl_list, $oCommentController, $oDB, $message_content);
}
$oDB->commit();

View file

@ -931,8 +931,7 @@ class commentController extends comment
}
// If the case manager to delete comments, it indicated that the administrator deleted.
$logged_info = Context::get('logged_info');
if($is_admin === true && $obj->member_srl !== $logged_info->member_srl)
if($is_admin === true && $obj->member_srl !== $this->user->member_srl)
{
$obj->content = lang('msg_admin_deleted_comment');
$obj->status = RX_STATUS_DELETED_BY_ADMIN;