diff --git a/op/op.SearchFulltext.php b/op/op.SearchFulltext.php deleted file mode 100644 index da8874f33..000000000 --- a/op/op.SearchFulltext.php +++ /dev/null @@ -1,241 +0,0 @@ -_rootFolderID; -} else { - $folderid = $_GET["folderid"]; -} - -$folder = $dms->getFolder($folderid); -if (!is_object($folder)) { - UI::exitError(getMLText("search_results"),getMLText("invalid_folder_id")); -} - -// Create the keyword search string. This search spans up to three columns -// in the database: keywords, name and comment. - -if (isset($_GET["query"]) && is_string($_GET["query"])) { - $query = $_GET["query"]; -} -else { - $query = ""; -} - -// category -$categories = array(); -if(isset($_GET['categoryids']) && $_GET['categoryids']) { - foreach($_GET['categoryids'] as $catid) { - if($catid > 0) { - $category = $dms->getDocumentCategory($catid); - $categories[] = $category->getName(); - } - } -} - -// -// Get the page number to display. If the result set contains more than -// 25 entries, it is displayed across multiple pages. -// -// This requires that a page number variable be used to track which page the -// user is interested in, and an extra clause on the select statement. -// -// Default page to display is always one. -$pageNumber=1; -if (isset($_GET["pg"])) { - if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) { - $pageNumber = (integer)$_GET["pg"]; - } - else if (!strcasecmp($_GET["pg"], "all")) { - $pageNumber = "all"; - } -} - - -// --------------- Suche starten -------------------------------------------- - -// Check to see if the search has been restricted to a particular -// document owner. -$owner = null; -if (isset($_GET["ownerid"]) && is_numeric($_GET["ownerid"]) && $_GET["ownerid"]!=-1) { - $owner = $dms->getUser($_GET["ownerid"]); - if (!is_object($owner)) { - UI::exitError(getMLText("search_results"),getMLText("unknown_owner")); - } -} - -$pageNumber=1; -if (isset($_GET["pg"])) { - if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) { - $pageNumber = (integer)$_GET["pg"]; - } - else if (!strcasecmp($_GET["pg"], "all")) { - $pageNumber = "all"; - } -} - -$startTime = getTime(); -if($settings->_enableFullSearch) { - if(!empty($settings->_luceneClassDir)) - require_once($settings->_luceneClassDir.'/Lucene.php'); - else - require_once('SeedDMS/Lucene.php'); -} - -Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('utf-8'); -$index = Zend_Search_Lucene::open($settings->_luceneDir); -$lucenesearch = new SeedDMS_Lucene_Search($index); -$hits = $lucenesearch->search($query, $owner ? $owner->getLogin() : '', '', $categories); -$totalDocs = count($hits); -$limit = 20; -$resArr = array(); -if($pageNumber != 'all' && count($hits) > $limit) { - $resArr['totalPages'] = (int) (count($hits) / $limit); - if ((count($hits)%$limit) > 0) - $resArr['totalPages']++; - $hits = array_slice($hits, ($pageNumber-1)*$limit, $limit); -} else { - $resArr['totalPages'] = 1; -} - -$resArr['docs'] = array(); -if($hits) { - foreach($hits as $hit) { - if($tmp = $dms->getDocument($hit['document_id'])) { - $resArr['docs'][] = $tmp; - } - } -} -$searchTime = getTime() - $startTime; -$searchTime = round($searchTime, 2); - -// -------------- Output results -------------------------------------------- - -$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'searchhits'=>$resArr['docs'], 'totalpages'=>$resArr['totalPages'], 'totaldocs'=>$totalDocs, 'pagenumber'=>$pageNumber, 'searchtime'=>$searchTime, 'urlparams'=>$_GET)); -if($view) { - $view->show(); - exit; -} - -UI::htmlStartPage(getMLText("search_results")); -UI::globalNavigation($folder); -UI::pageNavigation(getFolderPathHTML($folder, true), "", $folder); -UI::contentHeading(getMLText("search_results")); - -UI::contentContainerStart(); -?> - - - - - -
- $totalDocs)); -} -?> - $searchTime));?>
- -"; -print "\n\n"; -//print "\n"; -print "".getMLText("name")."\n"; -print "".getMLText("owner")."\n"; -print "".getMLText("status")."\n"; -print "".getMLText("version")."\n"; -print "".getMLText("comment")."\n"; -//print "".getMLText("reviewers")."\n"; -//print "".getMLText("approvers")."\n"; -print "\n\n\n"; - -$resultsFilteredByAccess = false; -foreach ($resArr['docs'] as $document) { - if ($document->getAccessMode($user) < M_READ) { - $resultsFilteredByAccess = true; - } - else { - $lc = $document->getLatestContent(); - print ""; - $docName = htmlspecialchars($document->getName()); - print "getID()."\">/"; - $folder = $document->getFolder(); - $path = $folder->getPath(); - for ($i = 1; $i < count($path); $i++) { - print htmlspecialchars($path[$i]->getName())."/"; - } - print $docName; - print ""; - - $owner = $document->getOwner(); - print "".htmlspecialchars($owner->getFullName()).""; - $display_status=$lc->getStatus(); - print "".getOverallStatusText($display_status["status"]). ""; - - print "".$lc->getVersion().""; - - $comment = htmlspecialchars($document->getComment()); - if (strlen($comment) > 50) $comment = substr($comment, 0, 47) . "..."; - print "".$comment.""; - print "\n"; - } -} -if ($resultsFilteredByAccess) { - print "". getMLText("search_results_access_filtered") . ""; -} -print "\n"; - -UI::pageList($pageNumber, $resArr['totalPages'], "../op/op.Search.php", $_GET); - -UI::contentContainerEnd(); -UI::htmlEndPage(); -?> diff --git a/out/out.Search.php b/out/out.Search.php index f694589f0..98ea6d2a3 100644 --- a/out/out.Search.php +++ b/out/out.Search.php @@ -47,15 +47,6 @@ if (isset($_GET["navBar"])) { } else { $folderid = $_GET["folderid"]; } - /* - if(strlen($_GET["query"])==0) { - header("Location: ../out/out.SearchForm.php?folderid=".$folderid); - } else { - if(isset($_GET["fullsearch"]) && $_GET["fullsearch"]) { - header("Location: ../op/op.SearchFulltext.php?folderid=".$folderid."&query=".$_GET["query"]); - } - } - */ } $accessop = new SeedDMS_AccessOperation($dms, null, $user, $settings); diff --git a/out/out.SearchForm.php b/out/out.SearchForm.php deleted file mode 100644 index fd18d9dca..000000000 --- a/out/out.SearchForm.php +++ /dev/null @@ -1,59 +0,0 @@ -_rootFolderID; - $folder = $dms->getFolder($folderid); -} -else { - $folderid = $_GET["folderid"]; - $folder = $dms->getFolder($folderid); -} -if (!is_object($folder)) { - UI::exitError(getMLText("search"),getMLText("invalid_folder_id")); -} - -$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_documentcontent/*, SeedDMS_Core_AttributeDefinition::objtype_all*/)); -$allCats = $dms->getDocumentCategories(); -$allUsers = $dms->getAllUsers($settings->_sortUsersInList); - -$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user)); -if($view) { - $view->setParam('folder', $folder); - $view->setParam('attrdefs', $attrdefs); - $view->setParam('allcategories', $allCats); - $view->setParam('allusers', $allUsers); - $view->setParam('enablefullsearch', $settings->_enableFullSearch); - $view($_GET); - exit; -} diff --git a/views/bootstrap/class.SearchForm.php b/views/bootstrap/class.SearchForm.php deleted file mode 100644 index 1e89729f6..000000000 --- a/views/bootstrap/class.SearchForm.php +++ /dev/null @@ -1,291 +0,0 @@ - - * @copyright Copyright (C) 2002-2005 Markus Westphal, - * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010-2012 Uwe Steinmann - * @version Release: @package_version@ - */ - -/** - * Include parent class - */ -require_once("class.Bootstrap.php"); - -/** - * Class which outputs the html page for SearchForm view - * - * @category DMS - * @package SeedDMS - * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann - * @copyright Copyright (C) 2002-2005 Markus Westphal, - * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010-2012 Uwe Steinmann - * @version Release: @package_version@ - */ -class SeedDMS_View_SearchForm extends SeedDMS_Bootstrap_Style { - - function js() { /* {{{ */ - header('Content-Type: application/javascript; charset=UTF-8'); -?> -function checkForm() -{ - msg = new Array() - if (document.form1.query.value == "") - { - if (!document.form1.creationdate.checked && !document.form1.lastupdate.checked && - !document.form1.pendingReview.checked && !document.form1.pendingApproval.checked) - msg.push(""); - } - - if (msg != "") { - noty({ - text: msg.join('
'), - type: 'error', - dismissQueue: true, - layout: 'topRight', - theme: 'defaultTheme', - _timeout: 1500, - }); - return false; - } - else - return true; -} - -$(document).ready(function() { - $('body').on('submit', '#form1', function(ev){ - if(checkForm()) return; - ev.preventDefault(); - }); -}); -printFolderChooserJs("form1"); - } /* }}} */ - - function show() { /* {{{ */ - $dms = $this->params['dms']; - $user = $this->params['user']; - $folder = $this->params['folder']; - $attrdefs = $this->params['attrdefs']; - $allCats = $this->params['allcategories']; - $allUsers = $this->params['allusers']; - $enablefullsearch = $this->params['enablefullsearch']; - $workflowmode = $this->params['workflowmode']; - - $this->htmlStartPage(getMLText("search")); - $this->globalNavigation($folder); - $this->contentStart(); - $this->pageNavigation(getMLText("search"), ""); -?> - - -
-
-contentContainerStart(); -?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
: - - -
: - - - - -
getName()); ?>printAttributeEditField($attrdef, '') ?>
:
()
- -
:
()
- - - - - - - - - - -
: - -
:printFolderChooserHtml("form1", M_READ, -1, $folder);?>
: - - - - -   - - - - - -
:
()
- - - - -   - - - - - -
-
-contentContainerEnd(); -?> -
- -
-contentContainerStart(); -?> -
- - - - - - - - - - - - - - - - -
: - - -
: - -
: - -
- -
-contentContainerEnd(); - } -?> -
-
- -contentEnd(); - $this->htmlEndPage(); - } /* }}} */ -} -?> diff --git a/views/bootstrap/class.SearchFulltext.php b/views/bootstrap/class.SearchFulltext.php deleted file mode 100644 index e80145e6e..000000000 --- a/views/bootstrap/class.SearchFulltext.php +++ /dev/null @@ -1,130 +0,0 @@ - - * @copyright Copyright (C) 2002-2005 Markus Westphal, - * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010-2012 Uwe Steinmann - * @version Release: @package_version@ - */ - -/** - * Include parent class - */ -require_once("class.Bootstrap.php"); - -/** - * Class which outputs the html page for Search result view - * - * @category DMS - * @package SeedDMS - * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann - * @copyright Copyright (C) 2002-2005 Markus Westphal, - * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, - * 2010-2012 Uwe Steinmann - * @version Release: @package_version@ - */ -class SeedDMS_View_SearchFulltext extends SeedDMS_Bootstrap_Style { - - function show() { /* {{{ */ - $dms = $this->params['dms']; - $user = $this->params['user']; - $folder = $this->params['folder']; - $entries = $this->params['searchhits']; - $totalpages = $this->params['totalpages']; - $totaldocs = $this->params['totaldocs']; - $pageNumber = $this->params['pagenumber']; - $urlparams = $this->params['urlparams']; - $searchTime = $this->params['searchtime']; - - $this->htmlStartPage(getMLText("search_results")); - $this->globalNavigation($folder); - $this->contentStart(); - $this->pageNavigation(getMLText("search_results"), ""); -?> -
- $totaldocs)); - } - echo ". "; - printMLText("search_time", array("time" => $searchTime)); -?> -
- -pageList($pageNumber, $totalpages, "../op/op.SearchFulltext.php", $_GET); - $this->contentContainerStart(); - if ($numResults == 0) { - $this->contentContainerEnd(); - $this->contentEnd(); - $this->htmlEndPage(); - exit; - } - - - print ""; - print "\n\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - //print "\n"; - //print "\n"; - print "\n\n\n"; - - $resultsFilteredByAccess = false; - foreach ($entries as $document) { - if ($document->getAccessMode($user) < M_READ) { - $resultsFilteredByAccess = true; - } - else { - $lc = $document->getLatestContent(); - print ""; - print ""; - $docName = htmlspecialchars($document->getName()); - print ""; - - $owner = $document->getOwner(); - print ""; - $display_status=$lc->getStatus(); - print ""; - - print ""; - - $comment = htmlspecialchars($document->getComment()); - if (strlen($comment) > 50) $comment = substr($comment, 0, 47) . "..."; - print ""; - print "\n"; - } - } - if ($resultsFilteredByAccess) { - print ""; - } - print "
".getMLText("name")."".getMLText("owner")."".getMLText("status")."".getMLText("version")."".getMLText("comment")."".getMLText("reviewers")."".getMLText("approvers")."
getID()."&version=".$lc->getVersion()."\">getMimeIcon($lc->getFileType())."\" title=\"".htmlspecialchars($lc->getMimeType())."\">getID()."\">/"; - $folder = $document->getFolder(); - $path = $folder->getPath(); - for ($i = 1; $i < count($path); $i++) { - print htmlspecialchars($path[$i]->getName())."/"; - } - print $docName; - print "".htmlspecialchars($owner->getFullName())."".getOverallStatusText($display_status["status"]). "".$lc->getVersion()."".$comment."
". getMLText("search_results_access_filtered") . "
\n"; - - $this->contentContainerEnd(); - $this->pageList($pageNumber, $totalpages, "../op/op.Search.php", $_GET); - $this->contentEnd(); - $this->htmlEndPage(); - } /* }}} */ -} -?>