mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
importer module 에서 첨부파일 처리시 오류 생기는 부분 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3340 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
baa91b6532
commit
b6d51b3635
3 changed files with 56 additions and 23 deletions
|
|
@ -14,6 +14,7 @@
|
|||
var $oDocumentController = null;
|
||||
var $oDocumentModel = null;
|
||||
var $oCommentController = null;
|
||||
var $oCommentModel = null;
|
||||
var $oTrackbackController = null;
|
||||
|
||||
/**
|
||||
|
|
@ -258,6 +259,7 @@
|
|||
$this->oDocumentController = &getController('document');
|
||||
$this->oDocumentModel = &getModel('document');
|
||||
$this->oCommentController = &getController('comment');
|
||||
$this->oCommentModel = &getModel('comment');
|
||||
$this->oTrackbackController = &getController('trackback');
|
||||
|
||||
// 타켓 모듈의 유무 체크
|
||||
|
|
@ -464,6 +466,7 @@
|
|||
// binary buffer일 경우 임의의 위치에 파일을 저장시켜 놓고 그 파일의 경로를 return
|
||||
$filename = $this->readFileBuff($fp, 'file');
|
||||
$obj->file = $filename;
|
||||
continue;
|
||||
}
|
||||
|
||||
$buff .= $str;
|
||||
|
|
@ -572,6 +575,7 @@
|
|||
|
||||
// 댓글 등록
|
||||
if(count($comments)) {
|
||||
$last_comment_updator = '';
|
||||
foreach($comments as $key => $val) {
|
||||
// 댓글 내용 정리
|
||||
$comment_args->comment_srl = getNextSequence();
|
||||
|
|
@ -590,6 +594,8 @@
|
|||
$comment_args->regdate = $val->regdate;
|
||||
$comment_args->ipaddress = $val->ipaddress;
|
||||
|
||||
$last_comment_updator = $val->nick_name;
|
||||
|
||||
// 첨부파일 미리 등록
|
||||
if(count($val->attaches)) {
|
||||
foreach($val->attaches as $key => $val) {
|
||||
|
|
@ -611,9 +617,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$this->oCommentController->insertComment($comment_args, true);
|
||||
$comment_output = $this->oCommentController->insertComment($comment_args, true);
|
||||
}
|
||||
|
||||
// 댓글 수 update
|
||||
$comment_count = $this->oCommentModel->getCommentCount($obj->document_srl);
|
||||
$update_output = $this->oDocumentController->updateCommentCount($obj->document_srl, $comment_count, $last_comment_updator, true);
|
||||
}
|
||||
|
||||
// 엮인글 등록
|
||||
|
|
@ -621,7 +630,8 @@
|
|||
foreach($trackbacks as $key => $val) {
|
||||
$val->module_srl = $obj->module_srl;
|
||||
$val->document_srl = $obj->document_srl;
|
||||
$this->oTrackbackController->insertTrackback($val, true);
|
||||
$trackback_output = $this->oTrackbackController->insertTrackback($val, true);
|
||||
debugprint($trackback_output);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,11 +28,6 @@ function doImportMember(fo_obj) {
|
|||
|
||||
var response_tags = new Array("error","message", "total_count", "success_count", "readed_line", "is_finished");
|
||||
|
||||
fo_obj.xml_file.disabled = true;
|
||||
xGetElementById("status").style.display = "block";
|
||||
xGetElementById("status_button_prev").style.display = "none";
|
||||
xGetElementById("status_button").style.display = "block";
|
||||
|
||||
exec_xml('importer','procImporterAdminMemberImport', params, completeImportMember, response_tags);
|
||||
|
||||
return false;
|
||||
|
|
@ -45,15 +40,29 @@ function completeImportMember(ret_obj) {
|
|||
var is_finished = ret_obj['is_finished'];
|
||||
|
||||
if(is_finished == '1') {
|
||||
alert(ret_obj['message']);
|
||||
xInnerHtml("status", ret_obj['message']);
|
||||
} else {
|
||||
xInnerHtml("status", ret_obj['message']);
|
||||
var fo_obj = xGetElementById("fo_import");
|
||||
fo_obj.total_count.value = 0;
|
||||
fo_obj.success_count.value = 0;
|
||||
fo_obj.readed_line.value = 0;
|
||||
fo_obj.xml_file.disabled = false;
|
||||
xGetElementById("status").style.display = "none";
|
||||
xGetElementById("status_button_prev").style.display = "block";
|
||||
xGetElementById("status_button").style.display = "none";
|
||||
|
||||
|
||||
xInnerHtml("status", ret_obj['message']);
|
||||
alert(ret_obj['message']);
|
||||
} else {
|
||||
var fo_obj = xGetElementById("fo_import");
|
||||
fo_obj.total_count.value = total_count;
|
||||
fo_obj.success_count.value = success_count;
|
||||
fo_obj.readed_line.value = readed_line;
|
||||
fo_obj.xml_file.disabled = true;
|
||||
xGetElementById("status").style.display = "block";
|
||||
xGetElementById("status_button_prev").style.display = "none";
|
||||
xGetElementById("status_button").style.display = "block";
|
||||
xInnerHtml("status", ret_obj['message']);
|
||||
|
||||
doImportMember(fo_obj);
|
||||
}
|
||||
}
|
||||
|
|
@ -75,12 +84,6 @@ function doImportModule(fo_obj) {
|
|||
|
||||
var response_tags = new Array("error","message", "total_count", "success_count", "readed_line", "is_finished");
|
||||
|
||||
fo_obj.target_module.disabled = true;
|
||||
fo_obj.xml_file.disabled = true;
|
||||
xGetElementById("status").style.display = "block";
|
||||
xGetElementById("status_button_prev").style.display = "none";
|
||||
xGetElementById("status_button").style.display = "block";
|
||||
|
||||
exec_xml('importer','procImporterAdminModuleImport', params, completeImportModule, response_tags);
|
||||
|
||||
return false;
|
||||
|
|
@ -93,15 +96,35 @@ function completeImportModule(ret_obj, response_tags) {
|
|||
var is_finished = ret_obj['is_finished'];
|
||||
|
||||
if(is_finished == '1') {
|
||||
alert(ret_obj['message']);
|
||||
xInnerHtml("status", ret_obj['message']);
|
||||
} else {
|
||||
var fo_obj = xGetElementById("fo_import");
|
||||
fo_obj.target_module.disabled = false;
|
||||
fo_obj.xml_file.disabled = false;
|
||||
fo_obj.total_count.value = 0;
|
||||
fo_obj.success_count.value = 0;
|
||||
fo_obj.readed_line.value = 0;
|
||||
|
||||
xGetElementById("status").style.display = "none";
|
||||
xGetElementById("status_button_prev").style.display = "block";
|
||||
xGetElementById("status_button").style.display = "none";
|
||||
|
||||
|
||||
xInnerHtml("status", ret_obj['message']);
|
||||
|
||||
alert(ret_obj['message']);
|
||||
} else {
|
||||
var fo_obj = xGetElementById("fo_import");
|
||||
fo_obj.target_module.disabled = true;
|
||||
fo_obj.xml_file.disabled = true;
|
||||
fo_obj.total_count.value = total_count;
|
||||
fo_obj.success_count.value = success_count;
|
||||
fo_obj.readed_line.value = readed_line;
|
||||
|
||||
xGetElementById("status").style.display = "block";
|
||||
xGetElementById("status_button_prev").style.display = "none";
|
||||
xGetElementById("status_button").style.display = "block";
|
||||
|
||||
xInnerHtml("status", ret_obj['message']);
|
||||
|
||||
doImportModule(fo_obj);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@
|
|||
<tr>
|
||||
<td>
|
||||
<input type="text" name="xml_file" value="./" class="inputTypeText w400" />
|
||||
<p>ex1) ../member.xml</p>
|
||||
<p>ex2) http://...../member.xml</p>
|
||||
<p>ex1) ../module.xml</p>
|
||||
<p>ex2) http://...../module.xml</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue