mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
pass record_type to view, some code formating
This commit is contained in:
parent
582a85947f
commit
f2dbe4c18b
|
@ -64,7 +64,9 @@ if($fullsearch) {
|
||||||
// category
|
// category
|
||||||
$categories = array();
|
$categories = array();
|
||||||
$categorynames = array();
|
$categorynames = array();
|
||||||
|
$category = array();
|
||||||
if(isset($_GET['category']) && $_GET['category']) {
|
if(isset($_GET['category']) && $_GET['category']) {
|
||||||
|
$category = $_GET['category'];
|
||||||
foreach($_GET['category'] as $catid) {
|
foreach($_GET['category'] as $catid) {
|
||||||
if($catid) {
|
if($catid) {
|
||||||
$cat = $dms->getDocumentCategory($catid);
|
$cat = $dms->getDocumentCategory($catid);
|
||||||
|
@ -112,7 +114,6 @@ if($fullsearch) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if the search has been restricted to a particular
|
// Check to see if the search has been restricted to a particular
|
||||||
// mimetype.
|
// mimetype.
|
||||||
$mimetype = [];
|
$mimetype = [];
|
||||||
|
@ -134,6 +135,12 @@ if($fullsearch) {
|
||||||
else
|
else
|
||||||
$status = array();
|
$status = array();
|
||||||
|
|
||||||
|
// record_type
|
||||||
|
if(isset($_GET['record_type']))
|
||||||
|
$record_type = $_GET['record_type'];
|
||||||
|
else
|
||||||
|
$record_type = array();
|
||||||
|
|
||||||
// Check to see if the search has been restricted to a particular sub-tree in
|
// Check to see if the search has been restricted to a particular sub-tree in
|
||||||
// the folder hierarchy.
|
// the folder hierarchy.
|
||||||
$startFolder = null;
|
$startFolder = null;
|
||||||
|
@ -165,7 +172,7 @@ if($fullsearch) {
|
||||||
$index = $fulltextservice->Indexer();
|
$index = $fulltextservice->Indexer();
|
||||||
if($index) {
|
if($index) {
|
||||||
$lucenesearch = $fulltextservice->Search();
|
$lucenesearch = $fulltextservice->Search();
|
||||||
$searchresult = $lucenesearch->search($query, array('owner'=>$ownernames, 'status'=>$status, 'category'=>$categorynames, 'user'=>$user->isAdmin() ? [] : [$user->getLogin()], 'mimetype'=>$mimetype, 'startFolder'=>$startFolder, 'rootFolder'=>$rootFolder), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1))));
|
$searchresult = $lucenesearch->search($query, array('record_type'=>$record_type, 'owner'=>$ownernames, 'status'=>$status, 'category'=>$categorynames, 'user'=>$user->isAdmin() ? [] : [$user->getLogin()], 'mimetype'=>$mimetype, 'startFolder'=>$startFolder, 'rootFolder'=>$rootFolder), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1))));
|
||||||
if($searchresult === false) {
|
if($searchresult === false) {
|
||||||
$session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('splash_invalid_searchterm')));
|
$session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('splash_invalid_searchterm')));
|
||||||
$dcount = 0;
|
$dcount = 0;
|
||||||
|
@ -198,6 +205,10 @@ if($fullsearch) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(isset($facets['record_type'])) {
|
||||||
|
$fcount = isset($facets['record_type']['folder']) ? $facets['record_type']['folder'] : 0;
|
||||||
|
$dcount = isset($facets['record_type']['document']) ? $facets['record_type']['document'] : 0 ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if($pageNumber != 'all' && $searchresult['count'] > $limit) {
|
if($pageNumber != 'all' && $searchresult['count'] > $limit) {
|
||||||
$totalPages = (int) ($searchresult['count']/$limit);
|
$totalPages = (int) ($searchresult['count']/$limit);
|
||||||
|
@ -400,7 +411,9 @@ if($fullsearch) {
|
||||||
|
|
||||||
// category
|
// category
|
||||||
$categories = array();
|
$categories = array();
|
||||||
|
$category = [];
|
||||||
if(isset($_GET['category']) && $_GET['category']) {
|
if(isset($_GET['category']) && $_GET['category']) {
|
||||||
|
$category = $_GET['category'];
|
||||||
foreach($_GET['category'] as $catid) {
|
foreach($_GET['category'] as $catid) {
|
||||||
if($cat = $dms->getDocumentCategory($catid)) {
|
if($cat = $dms->getDocumentCategory($catid)) {
|
||||||
$categories[] = $cat;
|
$categories[] = $cat;
|
||||||
|
@ -553,8 +566,10 @@ if($settings->_showSingleSearchHit && count($entries) == 1) {
|
||||||
$view->setParam('creationdate', isset($creationdate) ? $creationdate : '');
|
$view->setParam('creationdate', isset($creationdate) ? $creationdate : '');
|
||||||
$view->setParam('expirationdate', isset($expirationdate) ? $expirationdate: '');
|
$view->setParam('expirationdate', isset($expirationdate) ? $expirationdate: '');
|
||||||
$view->setParam('statusdate', isset($statusdate) ? $statusdate: '');
|
$view->setParam('statusdate', isset($statusdate) ? $statusdate: '');
|
||||||
$view->setParam('status', isset($status) ? $status : array());
|
$view->setParam('status', $status);
|
||||||
|
$view->setParam('recordtype', $record_type);
|
||||||
$view->setParam('categories', isset($categories) ? $categories : '');
|
$view->setParam('categories', isset($categories) ? $categories : '');
|
||||||
|
$view->setParam('category', $category);
|
||||||
$view->setParam('mimetype', isset($mimetype) ? $mimetype : '');
|
$view->setParam('mimetype', isset($mimetype) ? $mimetype : '');
|
||||||
$view->setParam('attributes', isset($attributes) ? $attributes : '');
|
$view->setParam('attributes', isset($attributes) ? $attributes : '');
|
||||||
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all));
|
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user