From b6d51b363594e7044c1fe5b6167f8969b996cbd0 Mon Sep 17 00:00:00 2001 From: zero Date: Fri, 14 Dec 2007 05:20:39 +0000 Subject: [PATCH] =?UTF-8?q?importer=20module=20=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC=20=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=EC=8B=9C=20=EC=98=A4=EB=A5=98=20=EC=83=9D=EA=B8=B0=EB=8A=94=20?= =?UTF-8?q?=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3340 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../importer/importer.admin.controller.php | 16 ++++- modules/importer/tpl/js/importer_admin.js | 59 +++++++++++++------ modules/importer/tpl/module.html | 4 +- 3 files changed, 56 insertions(+), 23 deletions(-) diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php index 23c49a6f9..e40d6a89a 100644 --- a/modules/importer/importer.admin.controller.php +++ b/modules/importer/importer.admin.controller.php @@ -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); } } diff --git a/modules/importer/tpl/js/importer_admin.js b/modules/importer/tpl/js/importer_admin.js index 48bbf797f..63d8bb272 100644 --- a/modules/importer/tpl/js/importer_admin.js +++ b/modules/importer/tpl/js/importer_admin.js @@ -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); } } diff --git a/modules/importer/tpl/module.html b/modules/importer/tpl/module.html index b1bb5fe0e..097930a02 100644 --- a/modules/importer/tpl/module.html +++ b/modules/importer/tpl/module.html @@ -32,8 +32,8 @@ -

ex1) ../member.xml

-

ex2) http://...../member.xml

+

ex1) ../module.xml

+

ex2) http://...../module.xml