mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@390 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7c8f6326a1
commit
084620476a
7 changed files with 175 additions and 69 deletions
|
|
@ -115,48 +115,100 @@
|
|||
**/
|
||||
function getDocumentList($obj) {
|
||||
|
||||
// 검색 키워드가 있으면 공백을 % 로 변경하여 키워드 or 연산이 되도록 수정
|
||||
if($obj->search_keyword) $obj->search_keyword = str_replace(' ','%',$obj->search_keyword);
|
||||
|
||||
|
||||
if($obj->search_target && $obj->search_keyword) {
|
||||
switch($obj->search_target) {
|
||||
case 'title' :
|
||||
$search_obj->s_title = $obj->search_keyword;
|
||||
break;
|
||||
case 'content' :
|
||||
$search_obj->s_content = $obj->search_keyword;
|
||||
break;
|
||||
case 'title_content' :
|
||||
$search_obj->s_title = $obj->search_keyword;
|
||||
$search_obj->s_content = $obj->search_keyword;
|
||||
break;
|
||||
case 'user_name' :
|
||||
$search_obj->s_user_name = $obj->search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
if(!in_array($obj->sort_index, array('list_order', 'update_order'))) $obj->sort_index = 'list_order';
|
||||
|
||||
// 변수 설정
|
||||
$args->module_srl = $obj->module_srl;
|
||||
$args->s_title = $obj->search_target=='title'?$obj->search_keyword:'';
|
||||
$args->s_content = $obj->search_target=='content'?$obj->search_keyword:'';
|
||||
$args->s_user_name = $obj->search_target=='user_name'?$obj->search_keyword:'';
|
||||
$args->s_member_srl = $obj->search_target=='member'?$obj->search_keyword:'';
|
||||
$args->s_ipaddress = $obj->search_target=='ipaddress'?$obj->search_keyword:'';
|
||||
$args->s_regdate = $obj->search_target=='regdate'?$obj->search_keyword:'';
|
||||
$args->category_srl = $obj->category_srl?$obj->category_srl:'';
|
||||
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->page = $obj->page?$obj->page:1;
|
||||
$args->list_count = $obj->list_count?$obj->list_count:20;
|
||||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
||||
$query_id = 'document.getDocumentList';
|
||||
|
||||
// 검색 옵션 정리
|
||||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
case 'title' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_title = $search_keyword;
|
||||
break;
|
||||
case 'content' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_content = $search_keyword;
|
||||
break;
|
||||
case 'user_id' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_id = $search_keyword;
|
||||
$query_id = 'document.getDocumentListWithinMember';
|
||||
$args->sort_index = 'documents.'.$args->sort_index;
|
||||
break;
|
||||
case 'member_srl' :
|
||||
$args->s_member_srl = (int)$search_keyword;
|
||||
break;
|
||||
case 'user_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_name = $search_keyword;
|
||||
break;
|
||||
case 'nick_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_nick_name = $search_keyword;
|
||||
break;
|
||||
case 'email_address' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_email_address = $search_keyword;
|
||||
break;
|
||||
case 'homepage' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_homepage = $search_keyword;
|
||||
break;
|
||||
case 'is_notice' :
|
||||
if($search_keyword=='Y') $args->s_is_notice = 'Y';
|
||||
else $args->s_is_notice = '';
|
||||
break;
|
||||
case 'is_secret' :
|
||||
if($search_keyword=='Y') $args->s_is_secret = 'Y';
|
||||
else $args->s_is_secret = '';
|
||||
break;
|
||||
case 'tags' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_tags = $search_keyword;
|
||||
break;
|
||||
case 'readed_count' :
|
||||
$args->s_readed_count = (int)$search_keyword;
|
||||
break;
|
||||
case 'voted_count' :
|
||||
$args->s_voted_count = (int)$search_keyword;
|
||||
break;
|
||||
case 'comment_count' :
|
||||
$args->s_comment_count = (int)$search_keyword;
|
||||
break;
|
||||
case 'trackback_count' :
|
||||
$args->s_trackback_count = (int)$search_keyword;
|
||||
break;
|
||||
case 'uploaded_count' :
|
||||
$args->s_uploaded_count = (int)$search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
$args->s_regdate = $search_keyword;
|
||||
break;
|
||||
case 'last_update' :
|
||||
$args->s_last_upate = $search_keyword;
|
||||
break;
|
||||
case 'ipaddress' :
|
||||
$args->s_ipaddress= $search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// document.getDocumentList 쿼리 실행
|
||||
$output = $oDB->executeQuery('document.getDocumentList', $args);
|
||||
$output = $oDB->executeQuery($query_id, $args);
|
||||
|
||||
// 결과가 없거나 오류 발생시 그냥 return
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
|
|
|||
|
|
@ -13,4 +13,28 @@
|
|||
$lang->msg_category_not_moved = '이동할 수가 없습니다';
|
||||
$lang->msg_is_secret = '비밀글입니다';
|
||||
$lang->msg_checked_document_is_deleted = '%d개의 글이 삭제되었습니다';
|
||||
|
||||
// 관리자 페이지에서 검색할 대상
|
||||
$lang->search_target_list = array(
|
||||
'title' => '제목',
|
||||
'content' => '내용',
|
||||
'user_id' => '아이디',
|
||||
'member_srl' => '회원번호',
|
||||
'user_name' => '내용',
|
||||
'nick_name' => '내용',
|
||||
'email_address' => '이메일',
|
||||
'homepage' => '홈페이지',
|
||||
'is_notice' => '공지사항',
|
||||
'is_secret' => '비밀글',
|
||||
'tags' => '태그',
|
||||
'readed_count' => '조회수 (이상)',
|
||||
'voted_count' => '추천수 (이상)',
|
||||
'comment_count ' => '코멘트수 (이상)',
|
||||
'trackback_count ' => '트랙백수 (이상)',
|
||||
'uploaded_count ' => '첨부파일수 (이상)',
|
||||
'regdate' => '등록일',
|
||||
'last_update' => '최근수정일',
|
||||
'ipaddress' => 'IP 주소',
|
||||
);
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -7,14 +7,26 @@
|
|||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="equal" column="category_srl" var="category_srl" />
|
||||
<condition operation="equal" column="category_srl" var="category_srl" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="like" column="title" var="s_title" />
|
||||
<condition operation="like" column="content" var="s_content" pipe="or" />
|
||||
<condition operation="like" column="user_name" var="s_user_name" pipe="or" />
|
||||
<condition operation="like" column="nick_name" var="s_nick_name" pipe="or" />
|
||||
<condition operation="like" column="email_address" var="s_email_addres" pipe="or" />
|
||||
<condition operation="like" column="homepage" var="s_homepage" pipe="or" />
|
||||
<condition operation="like" column="tags" var="s_tags" pipe="or" />
|
||||
<condition operation="equal" column="is_notice" var="s_is_notice" pipe="or" />
|
||||
<condition operation="equal" column="is_secret" var="s_is_secret" pipe="or" />
|
||||
<condition operation="equal" column="member_srl" var="s_member_srl" pipe="or" />
|
||||
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
|
||||
<condition operation="more" column="readed_count" var="s_readed_count" pipe="or" />
|
||||
<condition operation="more" column="voted_count" var="s_voted_count" pipe="or" />
|
||||
<condition operation="more" column="comment_count" var="s_comment_count" pipe="or" />
|
||||
<condition operation="more" column="trackback_count" var="s_trackback_count" pipe="or" />
|
||||
<condition operation="more" column="uploaded_count" var="s_uploaded_count" pipe="or" />
|
||||
<condition operation="like_prefix" column="regdate" var="s_regdate" pipe="or" />
|
||||
<condition operation="like_prefix" column="last_update" var="s_last_update" pipe="or" />
|
||||
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
<navigation>
|
||||
|
|
|
|||
39
modules/document/queries/getDocumentListWithinMember.xml
Normal file
39
modules/document/queries/getDocumentListWithinMember.xml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<query id="getDocumentListWithinMember" action="select">
|
||||
<tables>
|
||||
<table name="documents" alias="documents" />
|
||||
<table name="member" alias="member"/>
|
||||
</tables>
|
||||
<columns />
|
||||
<conditions>
|
||||
<condition operation="like" column="member.user_id" var="s_user_id" notnull="notnull" pipe="and" />
|
||||
<condition operation="equal" column="documents.member_srl" var="member.member_srl" notnull="notnull" pipe="and" />
|
||||
<condition operation="equal" column="documents.module_srl" var="module_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="documents.category_srl" var="category_srl" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="like" column="documents.title" var="s_title" />
|
||||
<condition operation="like" column="documents.content" var="s_content" pipe="or" />
|
||||
<condition operation="like" column="documents.user_name" var="s_user_name" pipe="or" />
|
||||
<condition operation="like" column="documents.nick_name" var="s_nick_name" pipe="or" />
|
||||
<condition operation="like" column="documents.email_address" var="s_email_addres" pipe="or" />
|
||||
<condition operation="like" column="documents.homepage" var="s_homepage" pipe="or" />
|
||||
<condition operation="like" column="documents.tags" var="s_tags" pipe="or" />
|
||||
<condition operation="equal" column="documents.is_notice" var="s_is_notice" pipe="or" />
|
||||
<condition operation="equal" column="documents.is_secret" var="s_is_secret" pipe="or" />
|
||||
<condition operation="equal" column="documents.member_srl" var="s_member_srl" pipe="or" />
|
||||
<condition operation="more" column="documents.readed_count" var="s_readed_count" pipe="or" />
|
||||
<condition operation="more" column="documents.voted_count" var="s_voted_count" pipe="or" />
|
||||
<condition operation="more" column="documents.comment_count" var="s_comment_count" pipe="or" />
|
||||
<condition operation="more" column="documents.trackback_count" var="s_trackback_count" pipe="or" />
|
||||
<condition operation="more" column="documents.uploaded_count" var="s_uploaded_count" pipe="or" />
|
||||
<condition operation="like_prefix" column="documents.regdate" var="s_regdate" pipe="or" />
|
||||
<condition operation="like_prefix" column="documents.last_update" var="s_last_update" pipe="or" />
|
||||
<condition operation="like_prefix" column="documents.ipaddress" var="s_ipaddress" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" order="asc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
<!--%import("filter/search.xml")-->
|
||||
<!--%import("filter/delete_checked.xml")-->
|
||||
<!--%import("js/document.js")-->
|
||||
|
||||
<!-- 게시판 정보 -->
|
||||
<div>
|
||||
|
|
@ -55,21 +53,26 @@
|
|||
|
||||
<!-- 검색 -->
|
||||
<div>
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, search)">
|
||||
<input type="hidden" name="module" value="admin" />
|
||||
<input type="hidden" name="mo" value="document" />
|
||||
<input type="hidden" name="act" value="dispList" />
|
||||
<select name="search_target">
|
||||
<!--@foreach($search_option as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="true"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
|
||||
<input type="submit" value="{$lang->cmd_search}" />
|
||||
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('search_target','','search_keyword','','page','1','document_srl','')}'"/>
|
||||
<form action="./" method="get">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="mo" value="{$mo}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
|
||||
<div>
|
||||
<select name="search_target">
|
||||
<option value="">{$lang->search_target}</option>
|
||||
<!--@foreach($lang->search_target_list as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="true"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
|
||||
<input type="submit" value="{$lang->cmd_search}" />
|
||||
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('','module',$module,'mo',$mo,'act',$act)}'"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 페이지 네비게이션 -->
|
||||
<div>
|
||||
<a href="{getUrl('page','','document_srl','')}">[{$lang->first_page}]</a>
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
<filter name="search" module="document">
|
||||
<form>
|
||||
<node target="search_target" required="true" />
|
||||
<node target="search_keyword" minlegnth="2" maxlength="40" required="true" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param name="search_target" target="search_target" />
|
||||
<param name="search_keyword" target="search_keyword" />
|
||||
</parameter>
|
||||
<response callback_func="completeSearch">
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* @file modules/document/tpl.admin/js/board.js
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @biref board 모듈의 javascript
|
||||
**/
|
||||
|
||||
/* 검색 실행 */
|
||||
function completeSearch(fo_obj) {
|
||||
fo_obj.submit();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue