mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-16 17:59:55 +09:00
merge from 1.5.3.2 (~r11225)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@11226 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
54e3a72065
commit
77f5aa2671
313 changed files with 8058 additions and 14251 deletions
|
|
@ -235,7 +235,11 @@ class documentController extends document {
|
|||
$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
|
||||
if(Mobile::isFromMobilePhone())
|
||||
{
|
||||
$obj->content = nl2br(htmlspecialchars($obj->content));
|
||||
if($obj->use_html != 'Y')
|
||||
{
|
||||
$obj->content = htmlspecialchars($obj->content);
|
||||
}
|
||||
$obj->content = nl2br($obj->content);
|
||||
}
|
||||
// Remove iframe and script if not a top adminisrator in the session.
|
||||
if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content);
|
||||
|
|
@ -408,7 +412,10 @@ class documentController extends document {
|
|||
}
|
||||
}
|
||||
// Remove iframe and script if not a top adminisrator in the session.
|
||||
if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content);
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
$obj->content = removeHackTag($obj->content);
|
||||
}
|
||||
// if temporary document, regdate is now setting
|
||||
if($source_obj->get('status') == $this->getConfigStatus('temp')) $obj->regdate = date('YmdHis');
|
||||
|
||||
|
|
@ -882,7 +889,10 @@ class documentController extends document {
|
|||
if($point > 0) $failed_voted = 'failed_voted';
|
||||
else $failed_voted = 'failed_blamed';
|
||||
// Return fail if session already has information about votes
|
||||
if($_SESSION['voted_document'][$document_srl]) return new Object(-1, $failed_voted);
|
||||
if($_SESSION['voted_document'][$document_srl])
|
||||
{
|
||||
return new Object(-1, $failed_voted);
|
||||
}
|
||||
// Get the original document
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
|
|
@ -891,11 +901,13 @@ class documentController extends document {
|
|||
$_SESSION['voted_document'][$document_srl] = true;
|
||||
return new Object(-1, $failed_voted);
|
||||
}
|
||||
|
||||
// Create a member model object
|
||||
$oMemberModel = &getModel('member');
|
||||
$member_srl = $oMemberModel->getLoggedMemberSrl();
|
||||
|
||||
// Check if document's author is a member.
|
||||
if($oDocument->get('member_srl')) {
|
||||
// Create a member model object
|
||||
$oMemberModel = &getModel('member');
|
||||
$member_srl = $oMemberModel->getLoggedMemberSrl();
|
||||
// Pass after registering a session if author's information is same as the currently logged-in user's.
|
||||
if($member_srl && $member_srl == $oDocument->get('member_srl')) {
|
||||
$_SESSION['voted_document'][$document_srl] = true;
|
||||
|
|
@ -915,6 +927,11 @@ class documentController extends document {
|
|||
$_SESSION['voted_document'][$document_srl] = true;
|
||||
return new Object(-1, $failed_voted);
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// Update the voted count
|
||||
if($point < 0)
|
||||
{
|
||||
|
|
@ -931,8 +948,6 @@ class documentController extends document {
|
|||
$args->point = $point;
|
||||
$output = executeQuery('document.insertDocumentVotedLog', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
// Leave in the session information
|
||||
$_SESSION['voted_document'][$document_srl] = true;
|
||||
|
||||
$obj->member_srl = $oDocument->get('member_srl');
|
||||
$obj->module_srl = $oDocument->get('module_srl');
|
||||
|
|
@ -941,8 +956,17 @@ class documentController extends document {
|
|||
$obj->point = $point;
|
||||
$obj->before_point = ($point < 0) ? $oDocument->get('blamed_count') : $oDocument->get('voted_count');
|
||||
$obj->after_point = ($point < 0) ? $args->blamed_count : $args->voted_count;
|
||||
$output = ModuleHandler::triggerCall('document.updateVotedCount', 'after', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
$trigger_output = ModuleHandler::triggerCall('document.updateVotedCount', 'after', $obj);
|
||||
if(!$trigger_output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
// Leave in the session information
|
||||
$_SESSION['voted_document'][$document_srl] = true;
|
||||
|
||||
// Return result
|
||||
if($point > 0)
|
||||
{
|
||||
|
|
@ -959,52 +983,99 @@ class documentController extends document {
|
|||
* @param int $document_srl
|
||||
* @return void|Object
|
||||
*/
|
||||
function declaredDocument($document_srl) {
|
||||
function declaredDocument($document_srl)
|
||||
{
|
||||
// Fail if session information already has a reported document
|
||||
if($_SESSION['declared_document'][$document_srl]) return new Object(-1, 'failed_declared');
|
||||
|
||||
$trigger_obj = new stdClass();
|
||||
$trigger_obj->document_srl = $document_srl;
|
||||
|
||||
// Call a trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('document.declaredDocument', 'before', $trigger_obj);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
// Check if previously reported
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('document.getDeclaredDocument', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$declared_count = $output->data->declared_count;
|
||||
|
||||
// Get the original document
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
|
||||
|
||||
// Pass if the author's IP address is as same as visitor's.
|
||||
/*if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR']) {
|
||||
$_SESSION['declared_document'][$document_srl] = true;
|
||||
return new Object(-1, 'failed_declared');
|
||||
}*/
|
||||
|
||||
// Check if document's author is a member.
|
||||
if($oDocument->get('member_srl')) {
|
||||
if($oDocument->get('member_srl'))
|
||||
{
|
||||
// Create a member model object
|
||||
$oMemberModel = &getModel('member');
|
||||
$member_srl = $oMemberModel->getLoggedMemberSrl();
|
||||
// Pass after registering a session if author's information is same as the currently logged-in user's.
|
||||
if($member_srl && $member_srl == $oDocument->get('member_srl')) {
|
||||
if($member_srl && $member_srl == $oDocument->get('member_srl'))
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = true;
|
||||
return new Object(-1, 'failed_declared');
|
||||
}
|
||||
}
|
||||
|
||||
// Use member_srl for logged-in members and IP address for non-members.
|
||||
if($member_srl) {
|
||||
if($member_srl)
|
||||
{
|
||||
$args->member_srl = $member_srl;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('document.getDocumentDeclaredLogInfo', $args);
|
||||
|
||||
// Pass after registering a sesson if reported/declared documents are in the logs.
|
||||
if($output->data->count) {
|
||||
if($output->data->count)
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = true;
|
||||
return new Object(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// Add the declared document
|
||||
if($declared_count > 0) $output = executeQuery('document.updateDeclaredDocument', $args);
|
||||
else $output = executeQuery('document.insertDeclaredDocument', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
// Leave logs
|
||||
$output = executeQuery('document.insertDocumentDeclaredLog', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Call a trigger (after)
|
||||
$trigger_obj->declared_count = $declared_count + 1;
|
||||
$trigger_output = ModuleHandler::triggerCall('document.declaredDocument', 'after', $trigger_obj);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
// commit
|
||||
$oDB->commit();
|
||||
|
||||
// Leave in the session information
|
||||
$_SESSION['declared_document'][$document_srl] = true;
|
||||
|
||||
|
|
@ -1261,17 +1332,23 @@ class documentController extends document {
|
|||
$js_code = array();
|
||||
$js_code[] = '<script type="text/javascript">//<![CDATA[';
|
||||
$js_code[] = '(function($){';
|
||||
$js_code[] = 'var validator = xe.getApp("validator")[0];';
|
||||
$js_code[] = 'if(!validator) return false;';
|
||||
$js_code[] = 'var validator = xe.getApp("validator")[0];';
|
||||
$js_code[] = 'if(!validator) return false;';
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
foreach($extra_keys as $idx => $val) {
|
||||
$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["extra_vars%s","%s"]);', $val->idx, $val->name);
|
||||
if($val->is_required == 'Y') $js_code[] = sprintf('validator.cast("ADD_EXTRA_FIELD", ["extra_vars%s", { required:true }]);', $val->idx);
|
||||
}
|
||||
foreach($extra_keys as $idx => $val)
|
||||
{
|
||||
$idx = $val->idx;
|
||||
if($val->type == 'kr_zip')
|
||||
{
|
||||
$idx .= '[]';
|
||||
}
|
||||
$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["extra_vars%s","%s"]);', $idx, $val->name);
|
||||
if($val->is_required == 'Y') $js_code[] = sprintf('validator.cast("ADD_EXTRA_FIELD", ["extra_vars%s", { required:true }]);', $idx);
|
||||
}
|
||||
|
||||
$js_code[] = '})(jQuery);';
|
||||
$js_code[] = '})(jQuery);';
|
||||
$js_code[] = '//]]></script>';
|
||||
$js_code = implode("\n", $js_code);
|
||||
|
||||
|
|
|
|||
|
|
@ -193,224 +193,102 @@
|
|||
*/
|
||||
function getDocumentList($obj, $except_notice = false, $load_extra_vars=true, $columnList = array()) {
|
||||
$sort_check = $this->_setSortIndex($obj, $load_extra_vars);
|
||||
$obj->sort_index = $sort_check->sort_index;
|
||||
$obj->sort_index = $sort_check->sort_index;
|
||||
// cache controll
|
||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport()){
|
||||
$object_key = 'object:'.$obj->module_srl.'_category_srl:'.$obj->category_srl.'_list_count:'.$obj->list_count.'_search_target:'.$obj->search_target.'_search_keyword:'.$obj->search_keyword.'_page'.$obj->page.'_sort_index:'.$obj->sort_index.'_order_type:'.$obj->order_type;
|
||||
$cache_key = $oCacheHandler->getGroupKey('documentList', $object_key);
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
|
||||
if($output)
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
if(!$output){
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$sort_check = $this->_setSortIndex($obj, $load_extra_vars);
|
||||
$this->_setSearchOption($obj, $args, $query_id, $use_division);
|
||||
|
||||
$obj->sort_index = $sort_check->sort_index;
|
||||
// Check the target and sequence alignment
|
||||
if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc';
|
||||
// If that came across mid module_srl instead of a direct module_srl guhaejum
|
||||
if($obj->mid) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
|
||||
unset($obj->mid);
|
||||
}
|
||||
// Module_srl passed the array may be a check whether the array
|
||||
if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
|
||||
else $args->module_srl = $obj->module_srl;
|
||||
// Except for the test module_srl
|
||||
if(is_array($obj->exclude_module_srl)) $args->exclude_module_srl = implode(',', $obj->exclude_module_srl);
|
||||
else $args->exclude_module_srl = $obj->exclude_module_srl;
|
||||
// Variable check
|
||||
$args->category_srl = $obj->category_srl?$obj->category_srl:null;
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->order_type = $obj->order_type;
|
||||
$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;
|
||||
$args->start_date = $obj->start_date?$obj->start_date:null;
|
||||
$args->end_date = $obj->end_date?$obj->end_date:null;
|
||||
$args->member_srl = $obj->member_srl;
|
||||
if ($sort_check->isExtraVars)
|
||||
{
|
||||
$output = executeQueryArray($query_id, $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
// document.getDocumentList query execution
|
||||
// Query_id if you have a group by clause getDocumentListWithinTag getDocumentListWithinComment or used again to perform the query because
|
||||
$groupByQuery = array('document.getDocumentListWithinComment' => 1, 'document.getDocumentListWithinTag' => 1);
|
||||
if(isset($groupByQuery[$query_id])) {
|
||||
$group_args = clone($args);
|
||||
$group_args->sort_index = 'documents.'.$args->sort_index;
|
||||
$output = executeQueryArray($query_id, $group_args);
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
// only admin document list, temp document showing
|
||||
if($obj->statusList) $args->statusList = $obj->statusList;
|
||||
else
|
||||
{
|
||||
if($logged_info->is_admin == 'Y' && !$obj->module_srl)
|
||||
$args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public'), $this->getConfigStatus('temp'));
|
||||
else
|
||||
$args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public'));
|
||||
}
|
||||
|
||||
// Category is selected, further sub-categories until all conditions
|
||||
if($args->category_srl) {
|
||||
$category_list = $this->getCategoryList($args->module_srl);
|
||||
$category_info = $category_list[$args->category_srl];
|
||||
$category_info->childs[] = $args->category_srl;
|
||||
$args->category_srl = implode(',',$category_info->childs);
|
||||
}
|
||||
// Used to specify the default query id (based on several search options to query id modified)
|
||||
$query_id = 'document.getDocumentList';
|
||||
// If the search by specifying the document division naeyonggeomsaekil processed for
|
||||
$use_division = false;
|
||||
|
||||
// Search options
|
||||
$searchOpt->search_target = $obj->search_target;
|
||||
$searchOpt->search_keyword = $obj->search_keyword;
|
||||
$this->_setSearchOption($searchOpt, $args, $query_id, $use_division);
|
||||
|
||||
if ($sort_check->isExtraVars)
|
||||
{
|
||||
$query_id = 'document.getDocumentListExtraSort';
|
||||
$output = executeQueryArray($query_id, $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
/**
|
||||
* list_order asc sort of division that can be used only when
|
||||
*/
|
||||
if($args->sort_index != 'list_order' || $args->order_type != 'asc') $use_division = false;
|
||||
|
||||
/**
|
||||
* If it is true, use_division changed to use the document division
|
||||
*/
|
||||
if($use_division) {
|
||||
// Division begins
|
||||
$division = (int)Context::get('division');
|
||||
|
||||
// order by list_order and (module_srl===0 or module_srl many count), therefore case table full scan
|
||||
if($args->sort_index == 'list_order' && ($args->exclude_module_srl === '0' || count(explode(',', $args->module_srl)) > 5))
|
||||
{
|
||||
$listSqlID = 'document.getDocumentListUseIndex';
|
||||
$divisionSqlID = 'document.getDocumentDivisionUseIndex';
|
||||
}
|
||||
else
|
||||
{
|
||||
$listSqlID = 'document.getDocumentList';
|
||||
$divisionSqlID = 'document.getDocumentDivision';
|
||||
}
|
||||
|
||||
// If you do not value the best division top
|
||||
if(!$division) {
|
||||
$division_args->module_srl = $args->module_srl;
|
||||
$division_args->exclude_module_srl = $args->exclude_module_srl;
|
||||
$division_args->list_count = 1;
|
||||
$division_args->sort_index = $args->sort_index;
|
||||
$division_args->order_type = $args->order_type;
|
||||
$division_args->statusList = $args->statusList;
|
||||
$output = executeQuery($listSqlID, $division_args, $columnList);
|
||||
if($output->data) {
|
||||
$item = array_pop($output->data);
|
||||
$division = $item->list_order;
|
||||
}
|
||||
$division_args = null;
|
||||
}
|
||||
// The last division
|
||||
$last_division = (int)Context::get('last_division');
|
||||
// Division after division from the 5000 value of the specified Wanted
|
||||
if(!$last_division) {
|
||||
$last_division_args->module_srl = $args->module_srl;
|
||||
$last_division_args->exclude_module_srl = $args->exclude_module_srl;
|
||||
$last_division_args->list_count = 1;
|
||||
$last_division_args->sort_index = $args->sort_index;
|
||||
$last_division_args->order_type = $args->order_type;
|
||||
$last_division_args->list_order = $division;
|
||||
$last_division_args->page = 5001;
|
||||
$output = executeQuery($divisionSqlID, $last_division_args, $columnList);
|
||||
if($output->data) {
|
||||
$item = array_pop($output->data);
|
||||
$last_division = $item->list_order;
|
||||
}
|
||||
}
|
||||
// Make sure that after last_division article
|
||||
if($last_division) {
|
||||
$last_division_args = null;
|
||||
$last_division_args->module_srl = $args->module_srl;
|
||||
$last_division_args->exclude_module_srl = $args->exclude_module_srl;
|
||||
$last_division_args->list_order = $last_division;
|
||||
$output = executeQuery("document.getDocumentDivisionCount", $last_division_args);
|
||||
if($output->data->count<1) $last_division = null;
|
||||
}
|
||||
|
||||
$args->division = $division;
|
||||
$args->last_division = $last_division;
|
||||
Context::set('division', $division);
|
||||
Context::set('last_division', $last_division);
|
||||
foreach($output->data as $key => $val) {
|
||||
if($val->document_srl) $target_srls[] = $val->document_srl;
|
||||
}
|
||||
// document.getDocumentList query execution
|
||||
// Query_id if you have a group by clause getDocumentListWithinTag getDocumentListWithinComment or used again to perform the query because
|
||||
if(in_array($query_id, array('document.getDocumentListWithinComment', 'document.getDocumentListWithinTag'))) {
|
||||
$group_args = clone($args);
|
||||
$group_args->sort_index = 'documents.'.$args->sort_index;
|
||||
$output = executeQueryArray($query_id, $group_args);
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
foreach($output->data as $key => $val) {
|
||||
if($val->document_srl) $target_srls[] = $val->document_srl;
|
||||
}
|
||||
|
||||
$page_navigation = $output->page_navigation;
|
||||
$keys = array_keys($output->data);
|
||||
$virtual_number = $keys[0];
|
||||
|
||||
$target_args->document_srls = implode(',',$target_srls);
|
||||
$target_args->list_order = $args->sort_index;
|
||||
$target_args->order_type = $args->order_type;
|
||||
$target_args->list_count = $args->list_count;
|
||||
$target_args->page = 1;
|
||||
$output = executeQueryArray('document.getDocuments', $target_args);
|
||||
$output->page_navigation = $page_navigation;
|
||||
$output->total_count = $page_navigation->total_count;
|
||||
$output->total_page = $page_navigation->total_page;
|
||||
$output->page = $page_navigation->cur_page;
|
||||
} else {
|
||||
$output = executeQueryArray($query_id, $args, $columnList);
|
||||
}
|
||||
}
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
$idx = 0;
|
||||
$data = $output->data;
|
||||
unset($output->data);
|
||||
|
||||
if(!isset($virtual_number))
|
||||
{
|
||||
$keys = array_keys($data);
|
||||
$page_navigation = $output->page_navigation;
|
||||
$keys = array_keys($output->data);
|
||||
$virtual_number = $keys[0];
|
||||
|
||||
$target_args->document_srls = implode(',',$target_srls);
|
||||
$target_args->list_order = $args->sort_index;
|
||||
$target_args->order_type = $args->order_type;
|
||||
$target_args->list_count = $args->list_count;
|
||||
$target_args->page = 1;
|
||||
$output = executeQueryArray('document.getDocuments', $target_args);
|
||||
$output->page_navigation = $page_navigation;
|
||||
$output->total_count = $page_navigation->total_count;
|
||||
$output->total_page = $page_navigation->total_page;
|
||||
$output->page = $page_navigation->cur_page;
|
||||
} else {
|
||||
$output = executeQueryArray($query_id, $args, $columnList);
|
||||
}
|
||||
|
||||
if($except_notice) {
|
||||
foreach($data as $key => $attribute) {
|
||||
if($attribute->is_notice == 'Y') $virtual_number --;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($data as $key => $attribute) {
|
||||
if($except_notice && $attribute->is_notice == 'Y') continue;
|
||||
$document_srl = $attribute->document_srl;
|
||||
if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) {
|
||||
$oDocument = null;
|
||||
$oDocument = new documentItem();
|
||||
$oDocument->setAttribute($attribute, false);
|
||||
if($is_admin) $oDocument->setGrant();
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument;
|
||||
}
|
||||
|
||||
$output->data[$virtual_number] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
$virtual_number --;
|
||||
|
||||
}
|
||||
|
||||
if($load_extra_vars) $this->setToAllDocumentExtraVars();
|
||||
|
||||
if(count($output->data)) {
|
||||
foreach($output->data as $number => $document) {
|
||||
$output->data[$number] = $GLOBALS['XE_DOCUMENT_LIST'][$document->document_srl];
|
||||
}
|
||||
}
|
||||
//insert in cache
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
||||
}
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
$idx = 0;
|
||||
$data = $output->data;
|
||||
unset($output->data);
|
||||
|
||||
if(!isset($virtual_number))
|
||||
{
|
||||
$keys = array_keys($data);
|
||||
$virtual_number = $keys[0];
|
||||
}
|
||||
|
||||
if($except_notice) {
|
||||
foreach($data as $key => $attribute) {
|
||||
if($attribute->is_notice == 'Y') $virtual_number --;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($data as $key => $attribute) {
|
||||
if($except_notice && $attribute->is_notice == 'Y') continue;
|
||||
$document_srl = $attribute->document_srl;
|
||||
if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) {
|
||||
$oDocument = null;
|
||||
$oDocument = new documentItem();
|
||||
$oDocument->setAttribute($attribute, false);
|
||||
if($is_admin) $oDocument->setGrant();
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument;
|
||||
}
|
||||
|
||||
$output->data[$virtual_number] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
$virtual_number --;
|
||||
|
||||
}
|
||||
|
||||
if($load_extra_vars) $this->setToAllDocumentExtraVars();
|
||||
|
||||
if(count($output->data)) {
|
||||
foreach($output->data as $number => $document) {
|
||||
$output->data[$number] = $GLOBALS['XE_DOCUMENT_LIST'][$document->document_srl];
|
||||
}
|
||||
}
|
||||
//insert in cache
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -596,7 +474,7 @@
|
|||
$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->getIpAddress());
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress');
|
||||
|
||||
$url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oDocument->getIpAddress());
|
||||
$url = sprintf("var params = new Array(); params['ipaddress_list']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oDocument->getIpAddress());
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_add_ip_to_spamfilter','','javascript');
|
||||
}
|
||||
}
|
||||
|
|
@ -654,6 +532,23 @@
|
|||
|
||||
return $output->data;
|
||||
}
|
||||
|
||||
function getDocumentExtraVarsCount($module_srl, $search_obj = NULL)
|
||||
{
|
||||
// Additional search options
|
||||
$args->module_srl = $module_srl;
|
||||
|
||||
$args->category_srl = $search_obj->category_srl;
|
||||
$args->var_idx = $search_obj->s_var_idx;
|
||||
$args->var_eid = $search_obj->s_var_eid;
|
||||
$args->var_value = $search_obj->s_var_value;
|
||||
|
||||
$output = executeQuery('document.getDocumentExtraVarsCount', $args);
|
||||
// Return total number of
|
||||
$total_count = $output->data->count;
|
||||
return (int)$total_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import page of the document, module_srl Without throughout ..
|
||||
* @param documentItem $oDocument
|
||||
|
|
@ -661,62 +556,34 @@
|
|||
* @return int
|
||||
*/
|
||||
function getDocumentPage($oDocument, $opt) {
|
||||
// Sort type changes depending on the query args
|
||||
switch($opt->sort_index) {
|
||||
case 'update_order' :
|
||||
if($opt->order_type == 'desc') $args->rev_update_order = $oDocument->get('update_order');
|
||||
else $args->update_order = $oDocument->get('update_order');
|
||||
break;
|
||||
case 'regdate' :
|
||||
if($opt->order_type == 'asc') $args->rev_regdate = $oDocument->get('regdate');
|
||||
else $args->regdate = $oDocument->get('regdate');
|
||||
break;
|
||||
case 'voted_count' :
|
||||
case 'blamed_count' :
|
||||
case 'readed_count' :
|
||||
case 'comment_count' :
|
||||
case 'title' :
|
||||
return 1;
|
||||
break;
|
||||
default :
|
||||
if($opt->order_type == 'desc') $args->rev_list_order = $oDocument->get('list_order');
|
||||
else $args->list_order = $oDocument->get('list_order');
|
||||
break;
|
||||
}
|
||||
$args->module_srl = $oDocument->get('module_srl');
|
||||
$args->sort_index = $opt->sort_index;
|
||||
$args->order_type = $opt->order_type;
|
||||
$this->_setSearchOption($opt, $args, $query_id, $use_division);
|
||||
$sort_check = $this->_setSortIndex($args, TRUE);
|
||||
|
||||
if($opt->statusList) $args->statusList = $opt->statusList;
|
||||
if($sort_check->isExtraVars)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y' && !$args->module_srl)
|
||||
if($sort_check->sort_index === 'list_order' || $sort_check->sort_index === 'update_order')
|
||||
{
|
||||
$args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public'), $this->getConfigStatus('temp'));
|
||||
if($args->order_type === 'desc')
|
||||
{
|
||||
$args->{'rev_' . $sort_check->sort_index} = $oDocument->get($sort_check->sort_index);
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->{$sort_check->sort_index} = $oDocument->get($sort_check->sort_index);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public'));
|
||||
}
|
||||
}
|
||||
|
||||
// Category is selected, further sub-categories until all conditions
|
||||
if($opt->category_srl)
|
||||
{
|
||||
$categoryList = $this->getCategoryList($opt->module_srl);
|
||||
|
||||
if(array_key_exists($opt->category_srl, $categoryList))
|
||||
{
|
||||
$categoryInfo = $categoryList[$opt->category_srl];
|
||||
|
||||
$args->categorySrlList = $categoryInfo->childs;
|
||||
array_push($args->categorySrlList, $opt->category_srl);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Guhanhu total number of the article search page
|
||||
$output = executeQuery('document.getDocumentPage', $args);
|
||||
$output = executeQuery($query_id . 'Page', $args);
|
||||
$count = $output->data->count;
|
||||
$page = (int)(($count-1)/$opt->list_count)+1;
|
||||
return $page;
|
||||
|
|
@ -1081,8 +948,8 @@
|
|||
if(is_array($output->data)) return $output->data[0]->document_srl;
|
||||
return $output->data->document_srl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Return docuent's alias
|
||||
* @param int $document_srl
|
||||
|
|
@ -1299,9 +1166,9 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* 게시물 목록의 검색 옵션을 Setting함(2011.03.08 - cherryfilter)
|
||||
* page변수가 없는 상태에서 page 값을 알아오는 method(getDocumentPage)는 검색하지 않은 값을 return해서 검색한 값을 가져오도록 검색옵션이 추가 됨.
|
||||
* 검색옵션의 중복으로 인해 private method로 별도 분리
|
||||
* 게시ë¬?목ë¡<EFBFBD>??ê²€???µì…˜??Setting??2011.03.08 - cherryfilter)
|
||||
* pageë³€?˜ê? ?†ëŠ” ?<EFBFBD>태?<EFBFBD>서 page ê°’ì<EFBFBD>„ ?Œì•„?¤ëŠ” method(getDocumentPage)??ê²€?‰í•˜ì§€ ?Šì? ê°’ì<EFBFBD>„ return?´ì„œ ê²€?‰í•œ ê°’ì<EFBFBD>„ ê°€?¸ì˜¤?„ë¡<EFBFBD> ê²€?‰ì˜µ?˜ì<EFBFBD>´ ì¶”ê? ??
|
||||
* ê²€?‰ì˜µ?˜ì<EFBFBD>˜ 중복?¼ë¡œ ?¸í•´ private methodë¡?별ë<EFBFBD>„ 분리
|
||||
* @param object $searchOpt
|
||||
* @param object $args
|
||||
* @param string $query_id
|
||||
|
|
@ -1310,6 +1177,66 @@
|
|||
*/
|
||||
function _setSearchOption($searchOpt, &$args, &$query_id, &$use_division)
|
||||
{
|
||||
// Variable check
|
||||
$args->category_srl = $searchOpt->category_srl?$searchOpt->category_srl:null;
|
||||
$args->order_type = $searchOpt->order_type;
|
||||
$args->page = $searchOpt->page?$searchOpt->page:1;
|
||||
$args->list_count = $searchOpt->list_count?$searchOpt->list_count:20;
|
||||
$args->page_count = $searchOpt->page_count?$searchOpt->page_count:10;
|
||||
$args->start_date = $searchOpt->start_date?$searchOpt->start_date:null;
|
||||
$args->end_date = $searchOpt->end_date?$searchOpt->end_date:null;
|
||||
$args->member_srl = $searchOpt->member_srl;
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$sort_check = $this->_setSortIndex($searchOpt, $load_extra_vars);
|
||||
|
||||
$args->sort_index = $sort_check->sort_index;
|
||||
|
||||
// Check the target and sequence alignment
|
||||
$orderType = array('desc' => 1, 'asc' => 1);
|
||||
if(!isset($orderType[$args->order_type])) $args->order_type = 'asc';
|
||||
|
||||
// If that came across mid module_srl instead of a direct module_srl guhaejum
|
||||
if($searchOpt->mid) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$args->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
|
||||
unset($searchOpt->mid);
|
||||
}
|
||||
|
||||
// Module_srl passed the array may be a check whether the array
|
||||
if(is_array($searchOpt->module_srl)) $args->module_srl = implode(',', $searchOpt->module_srl);
|
||||
else $args->module_srl = $searchOpt->module_srl;
|
||||
|
||||
// Except for the test module_srl
|
||||
if(is_array($searchOpt->exclude_module_srl)) $args->exclude_module_srl = implode(',', $searchOpt->exclude_module_srl);
|
||||
else $args->exclude_module_srl = $searchOpt->exclude_module_srl;
|
||||
|
||||
|
||||
// only admin document list, temp document showing
|
||||
if($searchOpt->statusList) $args->statusList = $searchOpt->statusList;
|
||||
else
|
||||
{
|
||||
if($logged_info->is_admin == 'Y' && !$searchOpt->module_srl)
|
||||
$args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public'), $this->getConfigStatus('temp'));
|
||||
else
|
||||
$args->statusList = array($this->getConfigStatus('secret'), $this->getConfigStatus('public'));
|
||||
}
|
||||
|
||||
// Category is selected, further sub-categories until all conditions
|
||||
if($args->category_srl) {
|
||||
$category_list = $this->getCategoryList($args->module_srl);
|
||||
$category_info = $category_list[$args->category_srl];
|
||||
$category_info->childs[] = $args->category_srl;
|
||||
$args->category_srl = implode(',',$category_info->childs);
|
||||
}
|
||||
|
||||
// Used to specify the default query id (based on several search options to query id modified)
|
||||
$query_id = 'document.getDocumentList';
|
||||
|
||||
// If the search by specifying the document division naeyonggeomsaekil processed for
|
||||
$use_division = false;
|
||||
|
||||
// Search options
|
||||
$search_target = $searchOpt->search_target;
|
||||
$search_keyword = $searchOpt->search_keyword;
|
||||
|
||||
|
|
@ -1380,6 +1307,93 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($sort_check->isExtraVars)
|
||||
{
|
||||
$query_id = 'document.getDocumentListExtraSort';
|
||||
}
|
||||
else
|
||||
{
|
||||
/**
|
||||
* list_order asc sort of division that can be used only when
|
||||
*/
|
||||
if($args->sort_index != 'list_order' || $args->order_type != 'asc') $use_division = false;
|
||||
|
||||
/**
|
||||
* If it is true, use_division changed to use the document division
|
||||
*/
|
||||
if($use_division) {
|
||||
// Division begins
|
||||
$division = (int)Context::get('division');
|
||||
|
||||
// order by list_order and (module_srl===0 or module_srl may count), therefore case table full scan
|
||||
if($args->sort_index == 'list_order' && ($args->exclude_module_srl === '0' || count(explode(',', $args->module_srl)) > 5))
|
||||
{
|
||||
$listSqlID = 'document.getDocumentListUseIndex';
|
||||
$divisionSqlID = 'document.getDocumentDivisionUseIndex';
|
||||
}
|
||||
else
|
||||
{
|
||||
$listSqlID = 'document.getDocumentList';
|
||||
$divisionSqlID = 'document.getDocumentDivision';
|
||||
}
|
||||
|
||||
// If you do not value the best division top
|
||||
if(!$division)
|
||||
{
|
||||
$division_args->module_srl = $args->module_srl;
|
||||
$division_args->exclude_module_srl = $args->exclude_module_srl;
|
||||
$division_args->list_count = 1;
|
||||
$division_args->sort_index = $args->sort_index;
|
||||
$division_args->order_type = $args->order_type;
|
||||
$division_args->statusList = $args->statusList;
|
||||
|
||||
$output = executeQuery($divisionSqlID, $division_args, array('list_order'));
|
||||
if($output->data)
|
||||
{
|
||||
$item = array_pop($output->data);
|
||||
$division = $item->list_order;
|
||||
}
|
||||
$division_args = null;
|
||||
}
|
||||
|
||||
// The last division
|
||||
$last_division = (int)Context::get('last_division');
|
||||
|
||||
// Division after division from the 5000 value of the specified Wanted
|
||||
if(!$last_division) {
|
||||
$last_division_args->module_srl = $args->module_srl;
|
||||
$last_division_args->exclude_module_srl = $args->exclude_module_srl;
|
||||
$last_division_args->list_count = 1;
|
||||
$last_division_args->sort_index = $args->sort_index;
|
||||
$last_division_args->order_type = $args->order_type;
|
||||
$last_division_args->list_order = $division;
|
||||
$last_division_args->page = 5001;
|
||||
|
||||
$output = executeQuery($divisionSqlID, $last_division_args, array('list_order'));
|
||||
if($output->data) {
|
||||
$item = array_pop($output->data);
|
||||
$last_division = $item->list_order;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure that after last_division article
|
||||
if($last_division)
|
||||
{
|
||||
$last_division_args = new stdClass();
|
||||
$last_division_args->module_srl = $args->module_srl;
|
||||
$last_division_args->exclude_module_srl = $args->exclude_module_srl;
|
||||
$last_division_args->list_order = $last_division;
|
||||
$output = executeQuery('document.getDocumentDivisionCount', $last_division_args);
|
||||
if($output->data->count<1) $last_division = null;
|
||||
}
|
||||
|
||||
$args->division = $division;
|
||||
$args->last_division = $last_division;
|
||||
Context::set('division', $division);
|
||||
Context::set('last_division', $last_division);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
29
modules/document/queries/getDocumentExtraVarsCount.xml
Normal file
29
modules/document/queries/getDocumentExtraVarsCount.xml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<query id="getDocumentExtraVarsCount" action="select">
|
||||
<tables>
|
||||
<table query="true" alias="A">
|
||||
<tables>
|
||||
<table name="documents" />
|
||||
<table name="document_extra_vars" alias="extra_vars" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="in" column="documents.category_srl" var="category_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="extra_vars.module_srl" default="documents.module_srl" pipe="and" />
|
||||
<condition operation="equal" column="extra_vars.document_srl" default="documents.document_srl" pipe="and" />
|
||||
<condition operation="equal" column="extra_vars.var_idx" var="var_idx" pipe="and" />
|
||||
<condition operation="equal" column="extra_vars.eid" var="var_eid" pipe="and" />
|
||||
<condition operation="in" column="documents.status" var="statusList" pipe="and" />
|
||||
<condition operation="like" column="extra_vars.value" var="var_value" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="extra_vars.document_srl" />
|
||||
</groups>
|
||||
</table>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(A.count)" alias="count" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
@ -1,30 +1,21 @@
|
|||
<query id="getDocumentPage" action="select">
|
||||
<query id="getDocumentListPage" action="select">
|
||||
<tables>
|
||||
<table name="documents" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
<column name="count(document_srl)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="module_srl" />
|
||||
<condition operation="in" column="category_srl" var="categorySrlList" pipe="and" />
|
||||
<condition operation="more" column="comment_count" var="comment_count" filter="number" pipe="and" />
|
||||
<condition operation="less" column="comment_count" var="rev_comment_count" filter="number" pipe="and" />
|
||||
<condition operation="more" column="voted_count" var="voted_count" filter="number" pipe="and" />
|
||||
<condition operation="less" column="voted_count" var="rev_voted_count" filter="number" pipe="and" />
|
||||
<condition operation="less" column="blamed_count" var="blamed_count" filter="number" pipe="and" />
|
||||
<condition operation="more" column="blamed_count" var="rev_blamed_count" filter="number" pipe="and" />
|
||||
<condition operation="more" column="readed_count" var="readed_count" filter="number" pipe="and" />
|
||||
<condition operation="less" column="readed_count" var="rev_readed_count" filter="number" pipe="and" />
|
||||
<condition operation="less" column="list_order" var="list_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="list_order" var="rev_list_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="title" var="title" filter="number" pipe="and" />
|
||||
<condition operation="less" column="title" var="rev_title" filter="number" pipe="and" />
|
||||
<condition operation="more" column="regdate" var="regdate" filter="number" pipe="and" />
|
||||
<condition operation="less" column="regdate" var="rev_regdate" filter="number" pipe="and" />
|
||||
<condition operation="less" column="update_order" var="update_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="update_order" var="rev_update_order" filter="number" pipe="and" />
|
||||
<condition operation="in" column="module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="notin" column="module_srl" var="exclude_module_srl" filter="number" pipe="and" />
|
||||
<condition operation="in" column="category_srl" var="category_srl" pipe="and" />
|
||||
<condition operation="equal" column="is_notice" var="s_is_notice" pipe="and" />
|
||||
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
|
||||
<condition operation="in" column="status" var="statusList" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="more" column="list_order" var="division" pipe="and" />
|
||||
<condition operation="below" column="list_order" var="last_division" pipe="and" />
|
||||
</group>
|
||||
<group pipe="and">
|
||||
<condition operation="like" column="title" var="s_title" />
|
||||
<condition operation="like" column="content" var="s_content" pipe="or" />
|
||||
|
|
@ -45,5 +36,15 @@
|
|||
<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>
|
||||
<group pipe="and">
|
||||
<condition operation="more" column="last_update" var="start_date" pipe="and" />
|
||||
<condition operation="less" column="last_update" var="end_date" pipe="and" />
|
||||
</group>
|
||||
<group pipe="and">
|
||||
<condition operation="less" column="list_order" var="list_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="list_order" var="rev_list_order" filter="number" pipe="and" />
|
||||
<condition operation="less" column="update_order" var="update_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="update_order" var="rev_update_order" filter="number" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<query id="getDocumentListWithExtraVarsPage" action="select">
|
||||
<tables>
|
||||
<table name="documents" />
|
||||
<table name="document_extra_vars" alias="extra_vars" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(distinct documents.document_srl)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="in" column="documents.category_srl" var="category_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="extra_vars.module_srl" default="documents.module_srl" pipe="and" />
|
||||
<condition operation="equal" column="extra_vars.document_srl" default="documents.document_srl" pipe="and" />
|
||||
<condition operation="equal" column="extra_vars.var_idx" var="var_idx" notnull="notnull" pipe="and" />
|
||||
<condition operation="in" column="documents.status" var="statusList" pipe="and" />
|
||||
<condition operation="like" column="extra_vars.value" var="var_value" notnull="notnull" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="less" column="documents.list_order" var="list_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="documents.list_order" var="rev_list_order" filter="number" pipe="and" />
|
||||
<condition operation="less" column="documents.update_order" var="update_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="documents.update_order" var="rev_update_order" filter="number" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<query id="getDocumentListWithinCommentPage" action="select">
|
||||
<tables>
|
||||
<table name="documents" alias="documents" />
|
||||
<table name="comments" alias="comments" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(distinct documents.document_srl)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="notin" column="documents.module_srl" var="exclude_module_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="documents.category_srl" var="category_srl" pipe="and" />
|
||||
<condition operation="equal" column="documents.document_srl" default="comments.document_srl" notnull="notnull" pipe="and" />
|
||||
<condition operation="equal" column="documents.member_srl" var="member_srl" filter="number" pipe="and" />
|
||||
<condition operation="in" column="documents.status" var="statusList" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="more" column="documents.list_order" var="division" pipe="and" />
|
||||
<condition operation="below" column="documents.list_order" var="last_division" pipe="and" />
|
||||
</group>
|
||||
<condition operation="like" column="comments.content" var="s_comment" notnull="notnull" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="less" column="documents.list_order" var="list_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="documents.list_order" var="rev_list_order" filter="number" pipe="and" />
|
||||
<condition operation="less" column="documents.update_order" var="update_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="documents.update_order" var="rev_update_order" filter="number" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -21,4 +21,7 @@
|
|||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
<groups>
|
||||
<group column="documents.document_srl" />
|
||||
</groups>
|
||||
</query>
|
||||
|
|
|
|||
23
modules/document/queries/getDocumentListWithinTagPage.xml
Normal file
23
modules/document/queries/getDocumentListWithinTagPage.xml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<query id="getDocumentListWithinTagPage" action="select">
|
||||
<tables>
|
||||
<table name="documents" alias="documents" />
|
||||
<table name="tags" alias="tags" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(distinct documents.document_srl)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="notin" column="documents.module_srl" var="exclude_module_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="documents.document_srl" default="tags.document_srl" notnull="notnull" pipe="and" />
|
||||
<condition operation="in" column="documents.category_srl" var="category_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="documents.member_srl" var="member_srl" filter="number" pipe="and" />
|
||||
<condition operation="like" column="tags.tag" var="s_tags" notnull="notnull" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="less" column="documents.list_order" var="list_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="documents.list_order" var="rev_list_order" filter="number" pipe="and" />
|
||||
<condition operation="less" column="documents.update_order" var="update_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="documents.update_order" var="rev_update_order" filter="number" pipe="and" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -48,7 +48,7 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<!--@foreach($document_list as $no => $oDocument)-->
|
||||
<!--@foreach($document_list as $no => $oDocument)-->
|
||||
<tr>
|
||||
<td class="title"><a href="{getUrl('','document_srl',$oDocument->document_srl)}" target="_blank">{$oDocument->getTitle()}</a></td>
|
||||
<td class="nowr"><a href="#popup_menu_area" class="member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</a></td>
|
||||
|
|
@ -122,14 +122,14 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
</div>
|
||||
<div class="search">
|
||||
|
||||
<form action="" class="pagination">
|
||||
<form action="./" class="pagination">
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
|
||||
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
|
||||
|
||||
<a href="{getUrl('page', '')}" class="direction">« FIRST</a>
|
||||
<a href="{getUrl('page', '')}" class="direction">« {$lang->first_page}</a>
|
||||
<block cond="$page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page && $page_navigation->page_count != $page_navigation->total_page">
|
||||
{@$isGoTo = true}
|
||||
<a href="{getUrl('page', '')}">1</a>
|
||||
|
|
@ -145,7 +145,7 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
|
||||
</block>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">LAST »</a>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">{$lang->last_page} »</a>
|
||||
<span cond="$isGoTo" id="goTo" class="tgContent">
|
||||
<input name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit">Go</button>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<!--@foreach($document_list as $no => $oDocument)-->
|
||||
<!--@foreach($document_list as $no => $oDocument)-->
|
||||
<tr>
|
||||
<td class="title"><a href="{getUrl('','document_srl',$oDocument->document_srl)}" target="_blank"><!--@if(trim($oDocument->getTitle()))-->{$oDocument->getTitle()}<!--@else--><em>{$lang->no_title_document}</em><!--@end--></a></td>
|
||||
<td class="nowr"><a href="#popup_menu_area" class="member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</a></td>
|
||||
|
|
@ -133,14 +133,14 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
</div>
|
||||
<div class="search">
|
||||
|
||||
<form action="" class="pagination">
|
||||
<form action="./" class="pagination">
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
|
||||
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
|
||||
|
||||
<a href="{getUrl('page', '')}" class="direction">« FIRST</a>
|
||||
<a href="{getUrl('page', '')}" class="direction">« {$lang->first_page}</a>
|
||||
<block cond="$page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page && $page_navigation->page_count != $page_navigation->total_page">
|
||||
{@$isGoTo = true}
|
||||
<a href="{getUrl('page', '')}">1</a>
|
||||
|
|
@ -156,7 +156,7 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
|
||||
</block>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">LAST »</a>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">{$lang->last_page} »</a>
|
||||
<span cond="$isGoTo" id="goTo" class="tgContent">
|
||||
<input name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit">Go</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue