git-svn-id: http://xe-core.googlecode.com/svn/trunk@1459 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-05-18 01:50:52 +00:00
parent 82e629553e
commit 7d23749ee7
14 changed files with 100 additions and 35 deletions

View file

@ -6,5 +6,6 @@
<action name="procImporterAdminStep1" type="controller" standalone="true" />
<action name="procImporterAdminStep12" type="controller" standalone="true" />
<action name="procImporterAdminImport" type="controller" standalone="true" />
<action name="procImporterAdminSync" type="controller" standalone="true" />
</actions>
</module>

View file

@ -340,5 +340,20 @@
$this->imported_count ++;
return '';
}
/**
* @brief 회원정보와 게시물 정보를 싱크
**/
function procImporterAdminSync() {
// 게시물정보 싱크
$output = executeQuery('importer.updateDocumentSync');
if(!$output->toBool()) return $output;
// 댓글정보 싱크
$output = executeQuery('importer.updateCommentSync');
if(!$output->toBool()) return $output;
$this->setMessage('msg_sync_completed');
}
}
?>

View file

@ -39,6 +39,7 @@
$lang->msg_invalid_xml_file = '잘못된 형식의 XML파일입니다';
$lang->msg_importing = '데이터를 입력중입니다. 혹시 아래 숫자가 변하지 않는다면 계속진행 버튼을 클릭해주세요.';
$lang->msg_import_finished = '%d개의 데이터 입력이 완료되었습니다. 상황에 따라 입력되지 못한 데이터가 있을 수 있습니다.';
$lang->msg_sync_completed = '회원과 게시물, 댓글의 동기화가 완료되었습니다.';
// 주절 주절..
$lang->about_type_member = '데이터 이전 대상이 회원정보일 경우 선택해주세요';

View file

@ -0,0 +1,13 @@
<query id="updateCommentSync" action="update">
<tables>
<table name="comments" alias="comments" />
<table name="member" alias="member" />
</tables>
<columns>
<column name="comments.member_srl" default="member.member_srl" filter="number" />
</columns>
<conditions>
<condition operation="equal" column="comments.member_srl" default="-1" notnull="notnull" />
<condition operation="equal" column="comments.user_id" default="member.user_id" pipe="and" />
</conditions>
</query>

View file

@ -0,0 +1,13 @@
<query id="updateDocumentSync" action="update">
<tables>
<table name="documents" alias="documents" />
<table name="member" alias="member" />
</tables>
<columns>
<column name="documents.member_srl" default="member.member_srl" filter="number" />
</columns>
<conditions>
<condition operation="equal" column="documents.member_srl" default="-1" notnull="notnull" />
<condition operation="equal" column="documents.user_id" default="member.user_id" pipe="and" />
</conditions>
</query>

View file

@ -100,14 +100,16 @@
<!-- step 3. 회원 동기화 시작 버튼 -->
<div id="step3" style="display:none">
<div style="font-weight:bold">{$lang->import_step_title[3]}</div>
<div>{$lang->import_step_desc[3]}</div>
<div>
{$lang->msg_sync_member}
</div>
<div>
<input type="button" value="{$lang->cmd_sync_member}" />
</div>
<form action="./" method="get" onsubmit="return doStep3(this)">
<div style="font-weight:bold">{$lang->import_step_title[3]}</div>
<div>{$lang->import_step_desc[3]}</div>
<div>
{$lang->msg_sync_member}
</div>
<div>
<input type="submit" value="{$lang->cmd_sync_member}" />
</div>
</form>
</div>
<!-- final step. 진행 완료 또는 실패 메세지 -->

View file

@ -103,3 +103,14 @@ function doManualProcess() {
var fo_obj = xGetElementById('fo_step2');
procFilter(fo_obj, import_xml);
}
/* 회원정보와 게시물의 싱크 */
function doStep3(fo_obj) {
exec_xml('importer','procImporterAdminSync', new Array(), completeStep3);
return false;
}
function completeStep3(ret_obj) {
alert(ret_obj['message']);
location.href=location.href;
}