게시글과 댓글을 작성 및 수정시 대기된 파일을 공개하는 방식을 변경

파일이 대기모드에서 공개할때 트리거에서 직접 호출 하는 방식으로 변경
This commit is contained in:
BJRambo 2020-11-11 15:06:00 +09:00
parent 234ad09867
commit 2cb477fd55
4 changed files with 44 additions and 100 deletions

View file

@ -394,6 +394,8 @@ class commentController extends comment
$obj->module_srl = intval($obj->module_srl);
$obj->document_srl = intval($obj->document_srl);
$obj->parent_srl = intval($obj->parent_srl);
$obj->uploaded_count = FileModel::getFilesCount($obj->comment_srl);
// call a trigger (before)
$output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj);
@ -596,6 +598,16 @@ class commentController extends comment
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, $update_document);
}
if($obj->uploaded_count)
{
$attachOutput = getController('file')->setFilesValid($obj->comment_srl, 'com');
if(!$attachOutput->toBool())
{
$oDB->rollback();
return $attachOutput;
}
}
// call a trigger(after)
ModuleHandler::triggerCall('comment.insertComment', 'after', $obj);
@ -754,6 +766,8 @@ class commentController extends comment
$obj->module_srl = intval($obj->module_srl);
$obj->document_srl = intval($obj->document_srl);
$obj->parent_srl = intval($obj->parent_srl);
$obj->uploaded_count = FileModel::getFilesCount($obj->comment_srl);
// call a trigger (before)
$output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj);
@ -855,6 +869,16 @@ class commentController extends comment
return $output;
}
if($obj->uploaded_count)
{
$attachOutput = getController('file')->setFilesValid($obj->comment_srl, 'com');
if(!$attachOutput->toBool())
{
$oDB->rollback();
return $attachOutput;
}
}
// call a trigger (after)
ModuleHandler::triggerCall('comment.updateComment', 'after', $obj);