Merge pull request #1462 from bjrambo/pr/attechfile

게시글과 댓글을  작성 및 수정시 대기된 파일을 공개하는 방식을 변경
This commit is contained in:
BJRambo 2020-11-11 21:28:42 +09:00 committed by GitHub
commit b675813de2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 98 additions and 102 deletions

View file

@ -500,6 +500,8 @@ class documentController extends document
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
unset($obj->manual_member_info);
$obj->uploaded_count = FileModel::getFilesCount($obj->document_srl);
// Call a trigger (before)
$output = ModuleHandler::triggerCall('document.insertDocument', 'before', $obj);
if(!$output->toBool())
@ -647,6 +649,14 @@ class documentController extends document
return $update_output;
}
}
$attachOutput = getController('file')->setFilesValid($obj->document_srl, 'doc');
if(!$attachOutput->toBool())
{
$oDB->rollback();
return $attachOutput;
}
ModuleHandler::triggerCall('document.insertDocument', 'after', $obj);
// commit
@ -708,6 +718,8 @@ class documentController extends document
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
unset($obj->manual_member_info);
$obj->uploaded_count = FileModel::getFilesCount($obj->document_srl);
// Call a trigger (before)
$output = ModuleHandler::triggerCall('document.updateDocument', 'before', $obj);
@ -947,6 +959,14 @@ class documentController extends document
return $update_output;
}
}
$attachOutput = getController('file')->setFilesValid($obj->document_srl, 'doc');
if(!$attachOutput->toBool())
{
$oDB->rollback();
return $attachOutput;
}
ModuleHandler::triggerCall('document.updateDocument', 'after', $obj);
// commit