diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index e66dd12f4..676483a58 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -106,6 +106,12 @@ $oEditorController = &getController('editor'); $oEditorController->deleteSavedDoc(); + // 첨부 파일이 있었을 경우 해당 첨부파일들의 valid값을 Y로 변경 + if($obj->uploaded_count) { + $oFileController = &getController('file'); + $oFileController->setFilesValid($obj->document_srl); + } + // return $this->addGrant($obj->document_srl); $output->add('document_srl',$obj->document_srl); @@ -188,6 +194,12 @@ if($obj->category_srl) $this->updateCategoryCount($obj->category_srl); } + // 첨부 파일이 있었을 경우 해당 첨부파일들의 valid값을 Y로 변경 + if($obj->uploaded_count) { + $oFileController = &getController('file'); + $oFileController->setFilesValid($obj->document_srl); + } + // 자동 저장 문서 삭제 $oEditorController = &getController('editor'); $oEditorController->deleteSavedDoc(); diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 7f29dd35d..c6b4f5fa0 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -106,6 +106,15 @@ return $output; } + /** + * @brief 특정 upload_target_srl의 첨부파일들의 상태를 유효로 변경 + * 글이 등록될때 글에 첨부된 파일들의 상태를 유효상태로 변경함으로서 관리시 불필요 파일로 인식되지 않도록 함 + **/ + function setFilesValid($upload_target_srl) { + $args->upload_target_srl = $upload_target_srl; + return executeQuery('file.updateFileValid', $args); + } + /** * @brief 첨부파일 삭제 **/ diff --git a/modules/file/queries/updateFileValid.xml b/modules/file/queries/updateFileValid.xml new file mode 100644 index 000000000..86bcddff6 --- /dev/null +++ b/modules/file/queries/updateFileValid.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/modules/file/schemas/files.xml b/modules/file/schemas/files.xml index 363b80cfb..00764e32b 100644 --- a/modules/file/schemas/files.xml +++ b/modules/file/schemas/files.xml @@ -11,6 +11,7 @@ +