issue 70 data import admin developement.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9019 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-09-05 02:20:54 +00:00
parent 702267086f
commit df61d2913d
6 changed files with 92 additions and 244 deletions

View file

@ -8,15 +8,16 @@
<form action="./" class="form" method="get" onsubmit="return doPreProcessing(this, 'documentForm')" id="documentForm">
<input type="hidden" name="act" value="" />
<input type="hidden" name="type" value="module" />
<input type="hidden" name="unit_count" value="10" />
<h2 class="h2">{$lang->type_module}</h2>
<ul>
<li>
<p class="q">{$lang->xml_path} {$lang->path_info}</p>
<p class="a checkxml">
<input type="text" name="xml_file" value="./" />
<button type="button">경로 확인</button>
<em class="desc error">아이쿠! XML 파일이 설정한 경로에 없네요.</em>
<em class="desc success">성공! XML 파일이 요기잉네?</em>
<button type="button">{$lang->cmd_check_path}</button>
<em class="desc error">{$lang->msg_no_xml_file}</em>
<em class="desc success">{$lang->msg_exist_xml_file}</em>
</p>
</li>
<li class="xml ttxml modulefinder">
@ -66,17 +67,18 @@
<span class="btn"><input type="submit" value="{$lang->importer}" /></span>
</div>
</form>
<form action="./" class="form" method="get" onsubmit="return doPreProcessing(this)" id="fo_import">
<form action="./" class="form" method="get" onsubmit="return doPreProcessing(this, 'memberFrom')" id="memberForm">
<input type="hidden" name="type" value="member" />
<input type="hidden" name="unit_count" value="100" />
<h2 class="h2">{$lang->type_member}</h2>
<ul>
<li>
<p class="q">{$lang->xml_path} {$lang->path_info}</p>
<p class="a checkxml">
<input type="text" name="xml_file" value="./" />
<button type="button">경로 확인</button>
<em class="desc error">아이쿠! XML 파일이 설정한 경로에 없네요.</em>
<em class="desc success">성공! XML 파일이 요기잉네?</em>
<button type="button">{$lang->cmd_check_path}</button>
<em class="desc error">{$lang->msg_no_xml_file}</em>
<em class="desc success">{$lang->msg_exist_xml_file}</em>
</p>
</li>
</ul>
@ -86,15 +88,16 @@
</form>
<form action="./" class="form" method="get" onsubmit="return doPreProcessing(this)" id="fo_import">
<input type="hidden" name="type" value="message" />
<input type="hidden" name="unit_count" value="100" />
<h2 class="h2">{$lang->type_message}</h2>
<ul>
<li>
<p class="q">{$lang->xml_path} {$lang->path_info}</p>
<p class="a checkxml">
<input type="text" name="xml_file" value="./" />
<button type="button">경로 확인</button>
<em class="desc error">아이쿠! XML 파일이 설정한 경로에 없네요.</em>
<em class="desc success">성공! XML 파일이 요기잉네?</em>
<button type="button">{$lang->cmd_check_path}</button>
<em class="desc error">{$lang->msg_no_xml_file}</em>
<em class="desc success">{$lang->msg_exist_xml_file}</em>
</p>
</li>
</ul>
@ -116,21 +119,21 @@
<input type="hidden" name="user_id" value="" />
<p style="text-align:center">
<span class="prgrs prgrsMedium">
<strong>{$lang->import_step_desc[99]}</strong>
<strong id="preProgressMsg">{$lang->preprocessing}</strong>
<strong id="progressMsg" style="display:none;">{$lang->import_step_desc[99]}</strong>
<span class="pBar" style="width:300px;text-align:left">
<span class="pAction" style="width:50%"><!-- Progress status --></span>
<span class="pNum">123/1234</span>
<span class="pAction" id="progressBar" style="width:0%"><!-- Progress status --></span>
<span class="pNum"><span id="completeCount">0</span>/<span id="totalCount">0</span></span>
</span>
<strong>50%</strong>
<strong id="progressPercent">0%</strong>
</span>
</p>
</form>
</div>
<script type="text/javascript">
jQuery(function($){
$('.form input[type=submit]').click(function(){
$('.modalAnchor').click();
});
});
jQuery('a.modalAnchor')
.bind('before-close.mw', function(event){
return false;
});
</script>
<!--// process 진행상황 끝 -->

View file

@ -52,7 +52,6 @@ $('.checkxml')
$ttxml = $ttxml.slice(0,-1).eq(-1).slideUp(100,arguments.callee);
});
if(!$xml.is(':visible')) $xml.slideDown(300);
$form.find('input[name=type]').val('module');
} else if(data.type == 'TTXML') {
$ttxml = $ttxml.not(':visible');
$ttxml.eq(0).slideDown(100, function(){
@ -105,9 +104,10 @@ function doPreProcessing(form, formId) {
if(!xml_file) return false;
//$form = $('#importForm').hide();
//$process = $('#process').show();
//$status = $('#status').empty();
// show modal window
$process = $('#process');
if(!$process.find('.bg').length) $process.prepend('<span class="bg" />').appendTo('body');
$('a[href="#process"].modalAnchor').trigger('open.mw');
exec_xml(
'importer', // module
@ -144,6 +144,8 @@ function doPreProcessing(form, formId) {
}
}
jQuery('#preProgressMsg').hide();
jQuery('#progressMsg').show();
doImport(formId);
}
@ -153,16 +155,12 @@ function doPreProcessing(form, formId) {
/* @brief Start importing */
function doImport(formId) {
var form = get_by_id('fo_process'), elems = form.elements, i, c, params={}, resp;
console.log(elems);
for(i=0,c=elems.length; i < c; i++) {
params[elems[i].name] = elems[i].value;
}
//displayProgress(params.total, params.cur);
function on_complete(ret, response_tags) {
console.log(ret);
var i, c, key;
for(i=0,c=resp.length; i < c; i++) {
@ -173,17 +171,22 @@ function doImport(formId) {
ret.total = parseInt(ret.total, 10) || 0;
ret.cur = parseInt(ret.cur, 10) || 0;
percent = parseInt((ret.cur/ret.total)*100);
jQuery('#totalCount').text(ret.total);
jQuery('#completeCount').text(ret.cur);
jQuery('#progressBar').width(percent+'%');
jQuery('#progressPercent').html(percent + "%");
if(ret.total > ret.cur) {
doImport(formId);
} else {
alert('성공입니까?');
alert(ret.message);
jQuery('a[href="#process"].modalAnchor').unbind('before-close.mw').trigger('close.mw');
try {
form.reset();
get_by_id(formId).reset();
//jQuery('#process').hide();
//jQuery('#importForm').show();
} catch(e){};
}
}
@ -220,3 +223,4 @@ function displayProgress(total, cur) {
.find('div.progress2')
.text(cur+'/'+total);
}