From 71af07b263b4038b5c7fc2d1f081a19519f0d80c Mon Sep 17 00:00:00 2001 From: ovclas Date: Fri, 24 Feb 2012 06:31:22 +0000 Subject: [PATCH] issue 1150 if category_srl setted, show error in paging fixed it. git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10184 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/document/document.model.php | 28 ++++++++++++++++++++ modules/document/queries/getDocumentPage.xml | 1 + 2 files changed, 29 insertions(+) diff --git a/modules/document/document.model.php b/modules/document/document.model.php index 370b8014a..c3b3ff6f3 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -586,6 +586,34 @@ $args->sort_index = $opt->sort_index; $args->order_type = $opt->order_type; + if($opt->statusList) $args->statusList = $opt->statusList; + else + { + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin == 'Y' && !$args->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($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); + } + } + // Guhanhu total number of the article search page $output = executeQuery('document.getDocumentPage', $args); $count = $output->data->count; diff --git a/modules/document/queries/getDocumentPage.xml b/modules/document/queries/getDocumentPage.xml index 3c8ec5aea..b0ea92d08 100644 --- a/modules/document/queries/getDocumentPage.xml +++ b/modules/document/queries/getDocumentPage.xml @@ -7,6 +7,7 @@ +