* @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.BlueStyle.php"); /** * Class which outputs the html page for Search result view * * @category DMS * @package LetoDMS * @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 LetoDMS_View_Search extends LetoDMS_Blue_Style { function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $folder = $this->params['folder']; $entries = $this->params['searchhits']; $totalpages = $this->params['totalpages']; $pageNumber = $this->params['pagenumber']; $urlparams = $this->params['urlparams']; $searchin = $this->params['searchin']; $this->htmlStartPage(getMLText("search_results")); $this->globalNavigation($folder); $this->pageNavigation(getFolderPathHTML($folder, true), ""); $this->contentHeading(getMLText("search_results")); $this->contentContainerStart(); $this->pageList($pageNumber, $totalpages, "../op/op.Search.php", $urlparams); print ""; print "\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; //print "\n"; //print "\n"; print "\n\n\n"; $resultsFilteredByAccess = false; $foldercount = $doccount = 0; foreach ($entries as $entry) { if(get_class($entry) == 'LetoDMS_Core_Document') { $document = $entry; $doccount++; $lc = $document->getLatestContent(); print ""; //print ""; if (in_array(2, $searchin)) { $docName = markQuery(htmlspecialchars($document->getName()), "i"); } else { $docName = htmlspecialchars($document->getName()); } print ""; print ""; $attributes = $lc->getAttributes(); print ""; $owner = $document->getOwner(); print ""; $display_status=$lc->getStatus(); print ""; print ""; if (in_array(3, $searchin)) $comment = markQuery(htmlspecialchars($document->getComment())); else $comment = htmlspecialchars($document->getComment()); if (strlen($comment) > 50) $comment = substr($comment, 0, 47) . "..."; print ""; print "\n"; } elseif(get_class($entry) == 'LetoDMS_Core_Folder') { $folder = $entry; $foldercount++; if (in_array(2, $searchin)) { $folderName = markQuery(htmlspecialchars($folder->getName()), "i"); } else { $folderName = htmlspecialchars($folder->getName()); } print ""; print ""; print ""; $owner = $folder->getOwner(); print ""; print ""; print ""; if (in_array(3, $searchin)) $comment = markQuery(htmlspecialchars($folder->getComment())); else $comment = htmlspecialchars($folder->getComment()); if (strlen($comment) > 50) $comment = substr($comment, 0, 47) . "..."; print ""; print "\n"; } } if (0 && $resultsFilteredByAccess) { print ""; } print "
".getMLText("name")."".getMLText("attributes")."".getMLText("owner")."".getMLText("status")."".getMLText("version")."".getMLText("comment")."".getMLText("reviewers")."".getMLText("approvers")."
getID()."\">getMimeIcon($lc->getFileType())."\" title=\"".$lc->getMimeType()."\">getID()."\">/"; $folder = $document->getFolder(); $path = $folder->getPath(); for ($i = 1; $i < count($path); $i++) { print htmlspecialchars($path[$i]->getName())."/"; } print $docName; print ""; print "
    \n"; $attributes = $lc->getAttributes(); if($attributes) { foreach($attributes as $attribute) { $attrdef = $attribute->getAttributeDefinition(); print "
  • ".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars($attribute->getValue())."
  • \n"; } } print "
\n"; print "
".htmlspecialchars($owner->getFullName())."".getOverallStatusText($display_status["status"]). "".$lc->getVersion()."".$comment."
getID()."\">getID()."\">"; $path = $folder->getPath(); print "/"; for ($i = 1; $i < count($path)-1; $i++) { print htmlspecialchars($path[$i]->getName())."/"; } print $folderName; print "".htmlspecialchars($owner->getFullName())."".$comment."
". getMLText("search_results_access_filtered") . "
\n"; $numResults = $doccount + $foldercount; if ($numResults == 0) { print "

".getMLText("search_no_results")."

"; } else { // print "

".getMLText("search_report", array("doccount" => $doccount, "foldercount" => $foldercount, 'searchtime'=>$searchTime))."

"; } $this->pageList($pageNumber, $totalpages, "../op/op.Search.php", $_GET); $this->contentContainerEnd(); $this->htmlEndPage(); } /* }}} */ } ?>