mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
commit
bd46493b01
16 changed files with 367 additions and 57 deletions
|
|
@ -250,6 +250,7 @@ $lang->msg_crypto_not_available = 'OpenSSL extension is not installed.';
|
|||
$lang->comment_to_be_approved = 'Your comment must be approved by admin before being published.';
|
||||
$lang->success_registed = 'Registered successfully.';
|
||||
$lang->success_declared = 'Reported successfully.';
|
||||
$lang->success_declared_cancel = 'The report was successfully canceled.';
|
||||
$lang->success_updated = 'Updated successfully.';
|
||||
$lang->success_deleted = 'Deleted successfully.';
|
||||
$lang->success_declare_canceled = 'Your report has been canceled.';
|
||||
|
|
@ -273,6 +274,7 @@ $lang->failed_voted_canceled = 'You cannot cancel an upvote that you did\'t make
|
|||
$lang->failed_blamed = 'No permission to downvote.';
|
||||
$lang->failed_blamed_canceled = 'You cannot cancel a downvote that you did\'t make.';
|
||||
$lang->failed_declared = 'No permission to Report.';
|
||||
$lang->failed_declared_cancel = 'You cannot cancel the report.';
|
||||
$lang->fail_to_delete_have_children = 'Cannot delete the article with comments.';
|
||||
$lang->confirm_submit = 'Are you sure you want to submit?';
|
||||
$lang->confirm_logout = 'Are you sure you want to sign out?';
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ $lang->cmd_vote = '추천';
|
|||
$lang->cmd_vote_down = '비추천';
|
||||
$lang->cmd_declare = '신고';
|
||||
$lang->cmd_cancel_declare = '신고 취소';
|
||||
$lang->cmd_cancel_vote = '추천 취소';
|
||||
$lang->cmd_cancel_vote_down = '비추천 취소';
|
||||
$lang->cmd_declared_list = '신고 목록';
|
||||
$lang->cmd_copy = '복사';
|
||||
$lang->cmd_move = '이동';
|
||||
|
|
@ -250,6 +252,7 @@ $lang->msg_crypto_not_available = 'openssl 확장모듈이 설치되어 있지
|
|||
$lang->comment_to_be_approved = '관리자의 확인이 필요한 댓글입니다.';
|
||||
$lang->success_registed = '등록했습니다.';
|
||||
$lang->success_declared = '신고했습니다.';
|
||||
$lang->success_declared_cancel = '신고를 취소 했습니다.';
|
||||
$lang->success_updated = '수정했습니다.';
|
||||
$lang->success_deleted = '삭제했습니다.';
|
||||
$lang->success_declare_canceled = '신고가 취소되었습니다.';
|
||||
|
|
@ -270,9 +273,11 @@ $lang->fail_to_delete = '삭제 실패했습니다.';
|
|||
$lang->fail_to_move = '이동 실패했습니다.';
|
||||
$lang->failed_voted = '추천할 수 없습니다.';
|
||||
$lang->failed_voted_canceled = '추천한 적이 없으므로 취소할 수 없습니다.';
|
||||
$lang->failed_voted_cancel = '추천을 취소할 수 없습니다.';
|
||||
$lang->failed_blamed = '비추천할 수 없습니다.';
|
||||
$lang->failed_blamed_canceled = '비추천한 적이 없으므로 취소할 수 없습니다.';
|
||||
$lang->failed_declared = '신고할 수 없습니다.';
|
||||
$lang->failed_declared_cancel = '신고를 취소할 수 없습니다.';
|
||||
$lang->fail_to_delete_have_children = '댓글이 있어서 삭제할 수 없습니다.';
|
||||
$lang->confirm_submit = '등록하시겠습니까?';
|
||||
$lang->confirm_logout = '로그아웃하시겠습니까?';
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ $lang->about_allow_no_category = '분류를 선택하지 않은 글도 허용하
|
|||
$lang->protect_content = '글 보호 기능';
|
||||
$lang->protect_comment = '댓글 보호 기능';
|
||||
$lang->protect_regdate = '기간 제한 기능';
|
||||
$lang->cancel_vote = '추천/비추천/신고 취소 허용';
|
||||
$lang->document_length_limit = '문서 길이 제한';
|
||||
$lang->comment_length_limit = '댓글 길이 제한';
|
||||
$lang->about_document_length_limit = '지나치게 용량이 큰 글을 작성하지 못하도록 합니다. 지저분한 태그가 많이 붙은 글을 붙여넣기하면 제한을 초과할 수도 있습니다.';
|
||||
|
|
@ -58,6 +59,7 @@ $lang->about_comment_length_limit = '지나치게 용량이 큰 댓글을 작성
|
|||
$lang->update_order_on_comment = '댓글 작성시 글 수정 시각 갱신';
|
||||
$lang->about_update_order_on_comment = '댓글이 작성되면 해당 글의 수정 시각을 갱신합니다. 포럼형 게시판, 최근 댓글 표시 기능 등에 필요합니다.';
|
||||
$lang->non_login_vote = '비회원 추천 허용';
|
||||
$lang->about_cancel_vote = '추천 비추천 신고를 취소할 수 있습니다.';
|
||||
$lang->about_non_login_vote = '로그인하지 않은 방문자도 추천할 수 있도록 합니다.';
|
||||
$lang->about_protect_regdate = '글이나 댓글을 작성한 후 일정 기간이 지나면 수정 또는 삭제할 수 없도록 합니다. (단위 : day)';
|
||||
$lang->about_protect_content = '댓글이 달린 글은 수정 또는 삭제할 수 없도록 합니다.';
|
||||
|
|
|
|||
|
|
@ -289,6 +289,18 @@
|
|||
<p class="x_help-block">{$lang->about_non_login_vote}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->cancel_vote}</label>
|
||||
<div class="x_controls">
|
||||
<label class="x_inline">
|
||||
<input type="radio" id="cancel_vote_y" name="cancel_vote" value="Y" checked="checked"|cond="$module_info->cancel_vote == 'Y'" /> {$lang->cmd_yes}
|
||||
</label>
|
||||
<label class="x_inline">
|
||||
<input type="radio" id="cancel_vote_n" name="cancel_vote" value="N" checked="checked"|cond="$module_info->cancel_vote != 'Y'" /> {$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_cancel_vote}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->protect_content}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
<action name="procDocumentVoteDownCancel" type="controller" />
|
||||
<action name="procDocumentTempSave" type="controller" permission="member" />
|
||||
<action name="procDocumentDeclare" type="controller" permission="member" />
|
||||
<action name="procDocumentDeclareCancel" type="controller" permission="member" />
|
||||
<action name="procDocumentGetList" type="controller" permission="manager" check_type="document" check_var="document_srls" />
|
||||
<action name="procDocumentAddCart" type="controller" permission="manager" check_type="document" check_var="srls" />
|
||||
<action name="procDocumentManageCheckedDocument" type="controller" permission="manager" check_type="document" check_var="cart" />
|
||||
|
|
@ -62,4 +63,4 @@
|
|||
<title xml:lang="tr">Document</title>
|
||||
</menu>
|
||||
</menus>
|
||||
</module>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -63,9 +63,17 @@ class documentController extends document
|
|||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($this->module_info->cancel_vote !== 'Y')
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('failed_voted_cancel');
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
if(!$document_srl)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
|
|
@ -150,6 +158,11 @@ class documentController extends document
|
|||
}
|
||||
}
|
||||
|
||||
if($this->module_info->cancel_vote !== 'Y')
|
||||
{
|
||||
return new Rhymix\Framework\Exception('failed_voted_canceled');
|
||||
}
|
||||
|
||||
$document_srl = Context::get('target_srl');
|
||||
if(!$document_srl) throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
|
||||
|
|
@ -180,26 +193,31 @@ class documentController extends document
|
|||
*/
|
||||
function updateVotedCountCancel($document_srl, $oDocument, $point)
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
if(!$_SESSION['voted_document'][$document_srl] && !$this->user->member_srl)
|
||||
{
|
||||
return new BaseObject(-1, $point > 0 ? 'failed_voted_canceled' : 'failed_blamed_canceled');
|
||||
}
|
||||
|
||||
// Check if the current user has voted previously.
|
||||
$args = new stdClass;
|
||||
$args->document_srl = $document_srl;
|
||||
$args->point = $point;
|
||||
if($logged_info->member_srl)
|
||||
if($this->user->member_srl)
|
||||
{
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
$args->member_srl = $this->user->member_srl;
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$output = executeQuery('document.getDocumentVotedLogInfo', $args);
|
||||
|
||||
if(!$output->data->count)
|
||||
{
|
||||
return new BaseObject(-1, $point > 0 ? 'failed_voted_canceled' : 'failed_blamed_canceled');
|
||||
}
|
||||
|
||||
$point = $output->data->point;
|
||||
|
||||
// Call a trigger (before)
|
||||
$trigger_obj = new stdClass;
|
||||
$trigger_obj->member_srl = $oDocument->get('member_srl');
|
||||
|
|
@ -215,35 +233,38 @@ class documentController extends document
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$args = new stdClass();
|
||||
$d_args = new stdClass();
|
||||
$args->document_srl = $d_args->document_srl = $document_srl;
|
||||
$d_args->member_srl = $logged_info->member_srl;
|
||||
if ($trigger_obj->update_target === 'voted_count')
|
||||
|
||||
if($point != 0)
|
||||
{
|
||||
$args->voted_count = $trigger_obj->after_point;
|
||||
$output = executeQuery('document.updateVotedCount', $args);
|
||||
$args = new stdClass();
|
||||
$d_args = new stdClass();
|
||||
$args->document_srl = $d_args->document_srl = $document_srl;
|
||||
$d_args->member_srl = $this->user->member_srl;
|
||||
if ($trigger_obj->update_target === 'voted_count')
|
||||
{
|
||||
$args->voted_count = $trigger_obj->after_point;
|
||||
$output = executeQuery('document.updateVotedCount', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->blamed_count = $trigger_obj->after_point;
|
||||
$output = executeQuery('document.updateBlamedCount', $args);
|
||||
}
|
||||
$d_output = executeQuery('document.deleteDocumentVotedLog', $d_args);
|
||||
if(!$d_output->toBool()) return $d_output;
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->blamed_count = $trigger_obj->after_point;
|
||||
$output = executeQuery('document.updateBlamedCount', $args);
|
||||
}
|
||||
$d_output = executeQuery('document.deleteDocumentVotedLog', $d_args);
|
||||
if(!$d_output->toBool()) return $d_output;
|
||||
|
||||
// session reset
|
||||
$_SESSION['voted_document'][$document_srl] = false;
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('document.updateVotedCountCancel', 'after', $trigger_obj);
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -267,8 +288,7 @@ class documentController extends document
|
|||
// if an user select message from options, message would be the option.
|
||||
$message_option = strval(Context::get('message_option'));
|
||||
$improper_document_reasons = lang('improper_document_reasons');
|
||||
$declare_message = ($message_option !== 'others' && isset($improper_document_reasons[$message_option]))?
|
||||
$improper_document_reasons[$message_option] : trim(Context::get('declare_message'));
|
||||
$declare_message = ($message_option !== 'others' && isset($improper_document_reasons[$message_option])) ? $improper_document_reasons[$message_option] : trim(Context::get('declare_message'));
|
||||
|
||||
// if there is return url, set that.
|
||||
if(Context::get('success_return_url'))
|
||||
|
|
@ -279,6 +299,43 @@ class documentController extends document
|
|||
return $this->declaredDocument($document_srl, $declare_message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 신고를 취소하는 액션
|
||||
* @return BaseObject|object
|
||||
* @throws \Rhymix\Framework\Exceptions\InvalidRequest
|
||||
* @throws \Rhymix\Framework\Exceptions\MustLogin
|
||||
*/
|
||||
function procDocumentDeclareCancel()
|
||||
{
|
||||
if(!Context::get('is_logged'))
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\MustLogin;
|
||||
}
|
||||
|
||||
$document_srl = intval(Context::get('target_srl'));
|
||||
|
||||
$oDocument = getModel('document')->getDocument($document_srl);
|
||||
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
$module_info = getModel('module')->getModuleInfoByDocumentSrl($document_srl);
|
||||
|
||||
if($module_info->cancel_vote !== 'Y')
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('failed_declared_cancel');
|
||||
}
|
||||
|
||||
if(Context::get('success_return_url'))
|
||||
{
|
||||
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||
}
|
||||
|
||||
return $this->declaredDocumentCancel($document_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete alias when module deleted
|
||||
* @param int $module_srl
|
||||
|
|
@ -1609,7 +1666,7 @@ class documentController extends document
|
|||
}
|
||||
|
||||
// Get currently logged in user.
|
||||
$member_srl = intval($this->user->member_srl);
|
||||
$member_srl = $this->user->member_srl;
|
||||
|
||||
// Check if document's author is a member.
|
||||
if($oDocument->get('member_srl'))
|
||||
|
|
@ -1720,6 +1777,122 @@ class documentController extends document
|
|||
$this->setMessage('success_declared');
|
||||
}
|
||||
|
||||
/**
|
||||
* 신고 취소
|
||||
* @param $document_srl
|
||||
* @return BaseObject|object|void
|
||||
*/
|
||||
function declaredDocumentCancel($document_srl)
|
||||
{
|
||||
$member_srl = $this->user->member_srl;
|
||||
if(!$_SESSION['declared_document'][$document_srl] && $member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'failed_declared_cancel');
|
||||
}
|
||||
|
||||
// Get the original document
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$args = new stdClass;
|
||||
$args->document_srl = $document_srl;
|
||||
if($member_srl)
|
||||
{
|
||||
$args->member_srl = $member_srl;
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->ipaddress = \RX_CLIENT_IP;
|
||||
}
|
||||
$output = executeQuery('document.getDocumentDeclaredLogInfo', $args);
|
||||
|
||||
if($output->data->count <= 0 || !isset($output->data->count))
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = false;
|
||||
return new BaseObject(-1, 'failed_declared_cancel');
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('document.getDeclaredDocument', $args);
|
||||
|
||||
$declared_count = ($output->data->declared_count) ? $output->data->declared_count : 0;
|
||||
|
||||
$trigger_obj = new stdClass();
|
||||
$trigger_obj->document_srl = $document_srl;
|
||||
$trigger_obj->declared_count = $declared_count;
|
||||
// Call a trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('document.declaredDocumentCancel', 'before', $trigger_obj);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
if($declared_count > 1)
|
||||
{
|
||||
$output = executeQuery('document.updateDeclaredDocumentCancel', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = executeQuery('document.deleteDeclaredDocument', $args);
|
||||
}
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = executeQuery('document.deleteDeclaredDocumentLog', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$message_targets = array();
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document', $module_srl);
|
||||
if ($document_config->declared_message && in_array('admin', $document_config->declared_message))
|
||||
{
|
||||
$output = executeQueryArray('member.getAdmins', new stdClass);
|
||||
foreach ($output->data as $admin)
|
||||
{
|
||||
$message_targets[$admin->member_srl] = true;
|
||||
}
|
||||
}
|
||||
if ($document_config->declared_message && in_array('manager', $document_config->declared_message))
|
||||
{
|
||||
$output = executeQueryArray('module.getModuleAdmin', (object)['module_srl' => $module_srl]);
|
||||
foreach ($output->data as $manager)
|
||||
{
|
||||
$message_targets[$manager->member_srl] = true;
|
||||
}
|
||||
}
|
||||
if ($message_targets)
|
||||
{
|
||||
$oCommunicationController = getController('communication');
|
||||
$message_title = lang('document.declared_cancel_message_title');
|
||||
$message_content = sprintf('<p><a href="%s">%s</a></p><p>%s</p>', $oDocument->getPermanentUrl(), $oDocument->getTitleText());
|
||||
foreach ($message_targets as $target_member_srl => $val)
|
||||
{
|
||||
$oCommunicationController->sendMessage($this->user->member_srl, $target_member_srl, $message_title, $message_content, false);
|
||||
}
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$trigger_obj->declared_count = $declared_count - 1;
|
||||
ModuleHandler::triggerCall('document.declaredDocumentCancel', 'after', $trigger_obj);
|
||||
|
||||
$_SESSION['declared_document'][$document_srl] = false;
|
||||
|
||||
$this->setMessage('success_declared_cancel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Increase the number of comments in the document
|
||||
* Update modified date, modifier, and order with increasing comment count
|
||||
|
|
|
|||
|
|
@ -482,30 +482,82 @@ class documentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info->member_srl)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(isset($_SESSION['voted_document'][$this->document_srl]))
|
||||
{
|
||||
return $_SESSION['voted_document'][$this->document_srl];
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info->member_srl)
|
||||
{
|
||||
$module_info = getModel('module')->getModuleInfoByModuleSrl($this->get('module_srl'));
|
||||
if($module_info->non_login_vote !== 'Y')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$args = new stdClass;
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
if($logged_info->member_srl)
|
||||
{
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$args->document_srl = $this->document_srl;
|
||||
$output = executeQuery('document.getDocumentVotedLog', $args);
|
||||
if($output->data->point)
|
||||
{
|
||||
return $_SESSION['voted_document'][$this->document_srl] = $output->data->point;
|
||||
}
|
||||
|
||||
return $_SESSION['voted_document'][$this->document_srl] = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시글에 신고한 이력이 있는지 검사
|
||||
* @return bool|int
|
||||
*/
|
||||
function getDeclared()
|
||||
{
|
||||
if(!$this->isExists())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info->member_srl)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(isset($_SESSION['declared_document'][$this->document_srl]))
|
||||
{
|
||||
return $_SESSION['declared_document'][$this->document_srl];
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
if($logged_info->member_srl)
|
||||
{
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->ipaddress = \RX_CLIENT_IP;
|
||||
}
|
||||
$args->document_srl = $this->document_srl;
|
||||
$output = executeQuery('document.getDocumentDeclaredLogInfo', $args);
|
||||
$declaredCount = intval($output->data->count);
|
||||
if($declaredCount > 0)
|
||||
{
|
||||
return $_SESSION['declared_document'][$this->document_srl] = $declaredCount;
|
||||
}
|
||||
|
||||
return $_SESSION['declared_document'][$this->document_srl] = false;
|
||||
}
|
||||
|
||||
function getTitle($cut_size = 0, $tail = '...')
|
||||
{
|
||||
if(!$this->isExists())
|
||||
|
|
|
|||
|
|
@ -431,9 +431,6 @@ class documentModel extends document
|
|||
{
|
||||
// Post number and the current login information requested Wanted
|
||||
$document_srl = Context::get('target_srl');
|
||||
$mid = Context::get('cur_mid');
|
||||
$logged_info = Context::get('logged_info');
|
||||
$act = Context::get('cur_act');
|
||||
// to menu_list "pyosihalgeul, target, url" put into an array
|
||||
$menu_list = array();
|
||||
// call trigger
|
||||
|
|
@ -441,7 +438,7 @@ class documentModel extends document
|
|||
|
||||
$oDocumentController = getController('document');
|
||||
// Members must be a possible feature
|
||||
if($logged_info->member_srl)
|
||||
if($this->user->member_srl)
|
||||
{
|
||||
$oDocumentModel = getModel('document');
|
||||
$columnList = array('document_srl', 'module_srl', 'member_srl', 'ipaddress');
|
||||
|
|
@ -452,23 +449,46 @@ class documentModel extends document
|
|||
|
||||
$oModuleModel = getModel('module');
|
||||
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
|
||||
if($document_config->use_vote_up!='N' && $member_srl!=$logged_info->member_srl)
|
||||
$oDocumentisVoted = $oDocument->getVoted();
|
||||
if($document_config->use_vote_up!='N' && $member_srl!=$this->user->member_srl)
|
||||
{
|
||||
// Add a Referral Button
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote','','javascript');
|
||||
if($oDocumentisVoted === false || $oDocumentisVoted < 0)
|
||||
{
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote','','javascript');
|
||||
}
|
||||
elseif($oDocumentisVoted > 0)
|
||||
{
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentVoteUpCancel','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_cancel_vote','','javascript');
|
||||
}
|
||||
}
|
||||
|
||||
if($document_config->use_vote_down!='N' && $member_srl!=$logged_info->member_srl)
|
||||
if($document_config->use_vote_down!='N' && $member_srl!=$this->user->member_srl)
|
||||
{
|
||||
// Add button to negative
|
||||
$url= sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','','javascript');
|
||||
if($oDocumentisVoted === false || $oDocumentisVoted > 0)
|
||||
{
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','','javascript');
|
||||
}
|
||||
else if($oDocumentisVoted < 0)
|
||||
{
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentVoteDownCancel','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_cancel_vote_down','','javascript');
|
||||
}
|
||||
}
|
||||
|
||||
// Adding Report
|
||||
$url = getUrl('', 'act', 'dispDocumentDeclare', 'target_srl', $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_declare','','popup');
|
||||
if($oDocument->getDeclared())
|
||||
{
|
||||
$url = getUrl('', 'act', 'dispDocumentDeclare', 'target_srl', $document_srl, 'type', 'cancel');
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_cancel_declare','','popup');
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = getUrl('', 'act', 'dispDocumentDeclare', 'target_srl', $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_declare','','popup');
|
||||
}
|
||||
|
||||
// Add Bookmark button
|
||||
$url = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl);
|
||||
|
|
@ -487,7 +507,7 @@ class documentModel extends document
|
|||
}
|
||||
|
||||
// If you are managing to find posts by ip
|
||||
if($logged_info->is_admin == 'Y')
|
||||
if($this->user->is_admin == 'Y')
|
||||
{
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl); //before setting document recycle
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ $lang->original_date = 'Original date';
|
|||
$lang->declared_count = 'Report count';
|
||||
$lang->latest_declared_date = 'Last reported date';
|
||||
$lang->declared_message_title = 'A post has been reported.';
|
||||
$lang->declared_cancel_message_title = 'Cancel the reported a post.';
|
||||
$lang->declaring_user = 'Reporter';
|
||||
$lang->improper_document_declare_reason = 'Reason';
|
||||
$lang->improper_document_reasons['advertisement'] = 'Advertisements that do not fit the topics or themes.';
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ $lang->original_date = '작성 날짜';
|
|||
$lang->declared_count = '신고 수';
|
||||
$lang->latest_declared_date = '최근 신고 날짜';
|
||||
$lang->declared_message_title = '신고가 접수되었습니다.';
|
||||
$lang->declared_cancel_message_title = '신고가 취소되었습니다.';
|
||||
$lang->declaring_user = '신고자';
|
||||
$lang->improper_document_declare_reason = '신고 이유';
|
||||
$lang->improper_document_reasons['advertisement'] = '주제나 흐름에 맞지 않는 광고 글입니다.';
|
||||
|
|
|
|||
8
modules/document/queries/deleteDeclaredDocument.xml
Normal file
8
modules/document/queries/deleteDeclaredDocument.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteDeclaredDocument" action="delete">
|
||||
<tables>
|
||||
<table name="document_declared" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
12
modules/document/queries/deleteDeclaredDocumentLog.xml
Normal file
12
modules/document/queries/deleteDeclaredDocumentLog.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="deleteDocumentDeclaredLog" action="delete">
|
||||
<tables>
|
||||
<table name="document_declared_log" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
<group pipe="and">
|
||||
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="ipaddress" var="ipaddress" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
<column name="sum(point)" alias="point" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
|
|
|
|||
11
modules/document/queries/updateDeclaredDocumentCancel.xml
Normal file
11
modules/document/queries/updateDeclaredDocumentCancel.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="updateDeclaredDocumentCancel" action="update">
|
||||
<tables>
|
||||
<table name="document_declared" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="declared_count" default="minus(1)" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -5,10 +5,14 @@
|
|||
window.close();
|
||||
</script>
|
||||
<section class="declare_document">
|
||||
<h1>{$lang->improper_document_declare}</h1>
|
||||
<h1>{$lang->improper_document_declare} <!--@if($type == 'cancel')-->{$lang->cmd_cancel}<!--@end--></h1>
|
||||
<form action="./" method="post" id="fo_component" ruleset="insertDeclare">
|
||||
<input type="hidden" name="module" value="document" />
|
||||
<!--@if($type == 'cancel')-->
|
||||
<input type="hidden" name="act" value="procDocumentDeclareCancel" />
|
||||
<!--@else-->
|
||||
<input type="hidden" name="act" value="procDocumentDeclare" />
|
||||
<!--@end-->
|
||||
<input type="hidden" name="target_srl" value="{$target_srl}" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('', 'act', $act, 'target_srl', $target_srl)}" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/document/tpl/1" />
|
||||
|
|
@ -18,6 +22,7 @@
|
|||
<p>{$target_document->getSummary(200)}</p>
|
||||
</section>
|
||||
</blockquote>
|
||||
<!--@if($type !== 'cancel')-->
|
||||
<label class="x_control-label" for="message_option">{$lang->improper_document_declare_reason}</label>
|
||||
<div class="x_controls">
|
||||
<select name="message_option" id="message_option">
|
||||
|
|
@ -26,9 +31,10 @@
|
|||
<textarea name="declare_message" id="declare_message"></textarea>
|
||||
<p>{$lang->about_improper_document_declare}<p>
|
||||
</div>
|
||||
<!--@end-->
|
||||
<div class="x_clearfix btnArea">
|
||||
<div class="x_pull-right">
|
||||
<button type="submit" class="x_btn x_btn-primary" />{$lang->cmd_submit}</button>
|
||||
<button type="submit" class="x_btn x_btn-primary" /><!--@if($type == 'cancel')-->{$lang->cmd_cancel_declare}<!--@else-->{$lang->cmd_submit}<!--@end--></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -53,4 +59,4 @@
|
|||
msg_area.hide();
|
||||
$(document).load(setFixedPopupSize);
|
||||
})(jQuery);
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
<include target="header.html" />
|
||||
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/document/tpl/document_config/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
|
||||
<form action="./" method="post" class="x_form-horizontal" method="post">
|
||||
<input type="hidden" name="module" value="document" />
|
||||
<input type="hidden" name="act" value="procDocumentAdminInsertConfig" />
|
||||
|
|
@ -37,7 +41,6 @@
|
|||
<p id="micons_help" class="x_help-block">{$lang->about_cmd_mobile_icon_setting}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btnArea x_clearfix">
|
||||
<span class="x_pull-right" style="margin-left:10px;"><input class="btn" type="button" value="{$lang->cmd_delete_all_thumbnail}" onclick="doDeleteAllThumbnail()"/></span>
|
||||
<span class="x_pull-right"><input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_save}" /></span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue