#18354552 휴지통으로 문서를 이동할 때, 첨부파일을 대기상태로 변경.(휴지통에서 나오면 다시 유효 상태로 변경) 관리자가 삭제하지 않도록, 문서 앞에 말머리 달아줌., 주석 중에 오타로 보이는 것 수정.

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7090 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2009-12-31 17:15:55 +00:00
parent 24aab02897
commit 9321a74c67
5 changed files with 39 additions and 13 deletions

View file

@ -492,6 +492,7 @@
function restoreTrash($trash_srl){
$oDB = &DB::getInstance();
$oDocumentModel = &getModel('document');
$trash_args->trash_srl = $trash_srl;
@ -502,6 +503,7 @@
$document_args->document_srl = $output->data->document_srl;
$document_args->module_srl = $output->data->module_srl;
$oDocument = $oDocumentModel->getDocument($document_args->document_srl);
// begin transaction
$oDB->begin();
@ -518,6 +520,13 @@
return $output;
}
// 임시 저장되었던 글이 아닌 경우, 등록된 첨부파일의 상태를 유효로 지정
if($oDocument->hasUploadedFiles() && $output->data->module_srl != $output->data->member_srl) {
$args->upload_target_srl = $oDocument->document_srl;
$args->isvalid = 'Y';
executeQuery('file.updateFileValid', $args);
}
// commit
$oDB->commit();
return $output;

View file

@ -475,12 +475,15 @@
if(!$obj->trash_srl) $trash_args->trash_srl = getNextSequence();
else $trash_args->trash_srl = $obj->trash_srl;
// 해당 document가 속해 는 module_srl을 구한다
// 해당 document가 속해 는 module_srl을 구한다
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($obj->document_srl);
$trash_args->module_srl = $oDocument->get('module_srl');
// 휴지통 문서를 두번 휴지통에 버릴 수 없음.
if($trash_args->module_srl == 0) return false;
// 데이터 설정
$trash_args->document_srl = $obj->document_srl;
$trash_args->description = $obj->description;
@ -517,6 +520,16 @@
// update category
if($oDocument->get('category_srl')) $this->updateCategoryCount($oDocument->get('module_srl'),$oDocument->get('category_srl'));
// remove thumbnails
FileHandler::removeDir(sprintf('files/cache/thumbnails/%s',getNumberingPath($obj->document_srl, 3)));
// 등록된 첨부파일의 상태를 무효로 지정
if($oDocument->hasUploadedFiles()) {
$args->upload_target_srl = $oDocument->document_srl;
$args->isvalid = 'N';
executeQuery('file.updateFileValid', $args);
}
// commit
$oDB->commit();
@ -1469,21 +1482,24 @@
}
if(!$document_srls || !count($document_srls)) return new Object();
// 각 문서들의 모듈 관리자 여부 확인
// 각 문서들의 모듈 관리자 여부 확인, 최고 관리자는 모든 모듈의 문서에 수정 권한 가짐. (임시저장이나 휴지통 문서 포함.)
$oModuleModel = &getModel('module');
$module_srls = array_keys($document_srls);
for($i=0;$i<count($module_srls);$i++) {
$module_srl = $module_srls[$i];
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
$logged_info = Context::get('logged_info');
if($logged_info->is_admin != 'Y') {
if(!$module_info) {
unset($document_srls[$module_srl]);
continue;
}
$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
$grant = $oModuleModel->getGrant($module_info, $logged_info);
if(!$grant->manager) {
unset($document_srls[$module_srl]);
continue;
}
}
}
if(!count($document_srls)) return new Object();
@ -1580,7 +1596,7 @@
for($i=0;$i<$document_srl_count;$i++) {
$args->document_srl = $document_srl_list[$i];
$output = $this->moveDocumentToTrash($args);
if(!$output->toBool()) return new Object(-1, 'fail_to_trash');
if(!$output || !$output->toBool()) return new Object(-1, 'fail_to_trash');
}
$oDB->commit();
$msg_code = 'success_trashed';

View file

@ -14,7 +14,7 @@
}
/**
* @brief 특정 첨부파일 모두 삭제
* @brief 특정 첨부파일 모두 삭제
**/
function deleteModuleFiles($module_srl) {
// 전체 첨부파일 목록을 구함

View file

@ -79,6 +79,7 @@
<!--@if($val->upload_target_type == 'mod')-->[{$lang->module}] <!--@end-->
<!--@if($val->upload_target_type == 'doc' && $document_list[$document_srl] && $document_list[$document_srl]->get('module_srl') == $document_list[$document_srl]->get('member_srl'))-->[{$lang->cmd_temp_save}] <!--@end-->
<!--@if($val->upload_target_type == 'doc' && $document_list[$document_srl] && $document_list[$document_srl]->get('module_srl') == 0)-->[{$lang->cmd_trash}] <!--@end-->
<a href="{getUrl('', 'mid', $module_list[$val->module_srl]->mid)}" onclick="window.open(this.href);return false;">{$module_list[$val->module_srl]->browser_title}</a>
<!--@if($document_list[$document_srl] && ($val->upload_target_type == 'doc' || $val->upload_target_type == 'com'))-->
- <!--@if($document_list[$document_srl]->get('module_srl') != $document_list[$document_srl]->get('member_srl'))--><a href="{$move_uri}" onclick="window.open(this.href);return false;">{$document_list[$document_srl]->getTitle()}</a><!--@else-->{$document_list[$document_srl]->getTitle()}<!--@end-->