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

This commit is contained in:
zero 2007-02-26 02:52:48 +00:00
parent 591f780345
commit 3515dc984a
9 changed files with 108 additions and 6 deletions

View file

@ -95,7 +95,9 @@ function XmlJsFilterGetValue(target_name) {
break;
case 'select' :
case 'select-one' :
value = obj.options[obj.selectedIndex].value;
if(obj.options.length>0) {
value = obj.options[obj.selectedIndex].value;
}
break;
default :
value = obj.value;

View file

@ -38,6 +38,7 @@
$lang->column_title = "입력항목 제목";
$lang->default_value = "기본 값";
$lang->is_active = "활성";
$lang->is_required = "필수항목";
$lang->msg_new_member = "회원 추가";
$lang->msg_update_member = "회원 정보 수정";
@ -64,4 +65,5 @@
$lang->about_default_value = "기본으로 입력될 값을 정하실 수 있습니다";
$lang->about_active = "활성 항목에 체크를 하셔야 가입시 정상적으로 노출됩니다";
$lang->about_form_description = "설명란에 입력을 하시면 가입시 표시가 됩니다";
$lang->about_required = "체크하시면 회원가입시 필수항목으로 입력하도록 됩니다";
?>

View file

@ -158,15 +158,31 @@
**/
function procInsertJoinForm() {
$oDB = &DB::getInstance();
$args->member_join_form_srl = Context::get('member_join_form_srl');
$args->column_type = Context::get('column_type');
$args->column_name = Context::get('column_name');
$args->column_title = Context::get('column_title');
$args->default_value = explode('|@|', Context::get('default_value'));
$args->is_active = Context::get('is_active');
if(!in_array(strtoupper($args->is_active), array('Y','N'))) $args->is_active = 'N';
$args->required = Context::get('required');
if(!in_array(strtoupper($args->required), array('Y','N'))) $args->required = 'N';
$args->description = Context::get('description');
$args->list_order = $oDB->getNextSequence();
$output = $oDB->executeQuery('member.insertJoinForm', $args);
// 기본값의 정리
if(in_array($args->column_type, array('checkbox','select')) && count($args->default_value) ) {
$args->default_value = serialize($args->default_value);
} else {
$args->default_value = '';
}
// member_join_form_srl이 있으면 수정, 없으면 추가
if(!$args->member_join_form_srl) $output = $oDB->executeQuery('member.insertJoinForm', $args);
else $output = $oDB->executeQuery('member.updateJoinForm', $args);
if(!$output->toBool()) return $output;
$this->add('act','dispJoinForm');

View file

@ -213,11 +213,44 @@
$join_form_count = count($join_form_list);
for($i=0;$i<$join_form_count;$i++) {
$member_join_form_srl = $join_form_list[$i]->member_join_form_srl;
$column_type = $join_form_list[$i]->column_type;
$default_value = $join_form_list[$i]->default_value;
if(in_array($column_type, array('checkbox','select'))) {
$join_form_list[$i]->default_value = unserialize($default_value);
if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
} else {
$join_form_list[$i]->default_value = '';
}
$list[$member_join_form_srl] = $join_form_list[$i];
}
return $list;
}
/**
* @brief 한개의 가입항목을 가져옴
**/
function getJoinForm($member_join_form_srl) {
// DB 객체 생성
$oDB = &DB::getInstance();
$args->member_join_form_srl = $member_join_form_srl;
$output = $oDB->executeQuery('member.getJoinForm', $args);
$join_form = $output->data;
if(!$join_form) return NULL;
$column_type = $join_form->column_type;
$default_value = $join_form->default_value;
if(in_array($column_type, array('checkbox','select'))) {
$join_form->default_value = unserialize($default_value);
} else {
$join_form->default_value = '';
}
return $join_form;
}
/**
* @brief 금지 아이디 목록 가져오기
**/

View file

@ -111,6 +111,14 @@
* @brief 회원 가입 관리 화면 출력
**/
function dispInsertJoinForm() {
// 수정일 경우 대상 join_form의 값을 구함
$member_join_form_srl = Context::get('member_join_form_srl');
if($member_join_form_srl) {
$oMemberModel = &getModel('member');
$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
if(!$join_form) Context::set('member_join_form_srl','',true);
else Context::set('join_form', $join_form);
}
$this->setTemplateFile('insert_join_form');
}

View file

@ -8,6 +8,7 @@
<column name="column_name" var="column_name" />
<column name="column_title" var="column_title" />
<column name="required" var="required" default="N" />
<column name="default_value" var="default_value" />
<column name="is_active" var="is_active" default="N" />
<column name="description" var="description" />
<column name="regdate" default="curdate()" />

View file

@ -0,0 +1,17 @@
<query id="updateJoinForm" action="update">
<tables>
<table name="member_join_form" />
</tables>
<columns>
<column name="column_type" var="column_type" />
<column name="column_name" var="column_name" />
<column name="column_title" var="column_title" />
<column name="required" var="required" default="N" />
<column name="default_value" var="default_value" />
<column name="is_active" var="is_active" default="N" />
<column name="description" var="description" />
</columns>
<conditions>
<condition operation="equal" column="member_join_form_srl" var="member_join_form_srl" notnull="notnull" filter="number"/>
</conditions>
</query>

View file

@ -5,8 +5,9 @@
{$lang->cmd_manage_form}
</div>
<form action="./" method="get" onsubmit="return procFilter(this, insert_join_form)">
<form id="fo_join_form" action="./" method="get" onsubmit="return procFilter(this, insert_join_form)">
<input type="hidden" name="member_join_form_srl" value="{$join_form->member_join_form_srl}" />
<input type="hidden" name="default_value" value="{implode($join_form->default_value,'|@|')}" />
<table>
<tr id="zone_column_type">
@ -19,7 +20,7 @@
<!--@end-->
</select>
</div>
<div id="zone_default_value" style="display:none">
<div id="zone_default_value" style="<!--@if($join_form->default_value)-->display:block;<!--@else-->display:none<!--@end-->">
<table>
<tr>
<td>{$lang->default_value}</td>
@ -27,7 +28,12 @@
<tr>
<td>
<div>
<select name="default_value" size="8" style="width:200px;" id="default_value_listup">
<select name="default_value_list" size="8" style="width:200px;" id="default_value_listup">
<!--@foreach($join_form->default_value as $value_key => $value_val)-->
<!--@if($value_val)-->
<option value="{$value_val}">{$value_val}</option>
<!--@end-->
<!--@end-->
</select>
</div>
<div>
@ -72,6 +78,13 @@
<tr>
<td>{$lang->about_active}</td>
</tr>
<tr>
<th rowspan="2">{$lang->is_required}</th>
<td><input type="checkbox" name="required" value="Y" <!--@if($join_form->required=='Y')-->checked="true"<!--@end-->/></td>
</tr>
<tr>
<td>{$lang->about_required}</td>
</tr>
<tr>
<th rowspan="2">{$lang->description}</th>
<td><textarea name="description">{$join_form->description}</textarea></td>
@ -80,7 +93,9 @@
<td>{$lang->about_form_description}</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="{$lang->cmd_registration}" />
<td colspan="2">
<input type="submit" value="{$lang->cmd_registration}" />
</td>
</tr>
</table>

View file

@ -172,4 +172,12 @@ function doEditDefaultValue(obj, cmd) {
else listup_obj.selectedIndex = idx-1;
break;
}
var value_list = new Array();
for(var i=0;i<listup_obj.options.length;i++) {
value_list[value_list.length] = listup_obj.options[i].value;
}
xGetElementById('fo_join_form').default_value.value = value_list.join('|@|');
}