diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index 7729ec1af..3e350d531 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -58,7 +58,15 @@ class LetoDMS_View_Search extends LetoDMS_Bootstrap_Style { $this->contentStart(); $this->pageNavigation(getMLText("search_results"), ""); + $foldercount = $doccount = 0; if($entries) { + foreach ($entries as $entry) { + if(get_class($entry) == 'LetoDMS_Core_Document') { + $doccount++; + } elseif(get_class($entry) == 'LetoDMS_Core_Folder') { + $foldercount++; + } + } print "
".getMLText("search_report", array("doccount" => $doccount, "foldercount" => $foldercount, 'searchtime'=>$searchTime))."
"; $this->pageList($pageNumber, $totalpages, "../op/op.Search.php", $urlparams); $this->contentContainerStart(); @@ -77,70 +85,67 @@ class LetoDMS_View_Search extends LetoDMS_Bootstrap_Style { print "\n\n\n"; $previewer = new LetoDMS_Preview_Previewer($cachedir, 40); - $foldercount = $doccount = 0; foreach ($entries as $entry) { if(get_class($entry) == 'LetoDMS_Core_Document') { $document = $entry; - $doccount++; - $lc = $document->getLatestContent(); - $previewer->createPreview($lc); + $lc = $document->getLatestContent(); + $previewer->createPreview($lc); - if (in_array(3, $searchin)) - $comment = $this->markQuery(htmlspecialchars($document->getComment())); - else - $comment = htmlspecialchars($document->getComment()); - if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "..."; - print ""; - //print ""; - if (in_array(2, $searchin)) { - $docName = $this->markQuery(htmlspecialchars($document->getName()), "i"); - } else { - $docName = htmlspecialchars($document->getName()); - } - print "getID()."\">"; - if($previewer->hasPreview($lc)) { - print "getID()."&version=".$lc->getVersion()."&width=40\" title=\"".htmlspecialchars($lc->getMimeType())."\">"; - } else { - print "getMimeIcon($lc->getFileType())."\" title=\"".htmlspecialchars($lc->getMimeType())."\">"; - } - print ""; - print "getID()."\">/"; - $folder = $document->getFolder(); - $path = $folder->getPath(); - for ($i = 1; $i < count($path); $i++) { - print htmlspecialchars($path[$i]->getName())."/"; - } - print $docName; - print ""; - if($comment) { - print "
".htmlspecialchars($comment).""; - } - print ""; + if (in_array(3, $searchin)) + $comment = $this->markQuery(htmlspecialchars($document->getComment())); + else + $comment = htmlspecialchars($document->getComment()); + if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "..."; + print ""; + //print ""; + if (in_array(2, $searchin)) { + $docName = $this->markQuery(htmlspecialchars($document->getName()), "i"); + } else { + $docName = htmlspecialchars($document->getName()); + } + print "getID()."\">"; + if($previewer->hasPreview($lc)) { + print "getID()."&version=".$lc->getVersion()."&width=40\" title=\"".htmlspecialchars($lc->getMimeType())."\">"; + } else { + print "getMimeIcon($lc->getFileType())."\" title=\"".htmlspecialchars($lc->getMimeType())."\">"; + } + print ""; + print "getID()."\">/"; + $folder = $document->getFolder(); + $path = $folder->getPath(); + for ($i = 1; $i < count($path); $i++) { + print htmlspecialchars($path[$i]->getName())."/"; + } + print $docName; + print ""; + if($comment) { + print "
".htmlspecialchars($comment).""; + } + print ""; - $attributes = $lc->getAttributes(); - print ""; - print "\n"; + print ""; - $owner = $document->getOwner(); - print "".htmlspecialchars($owner->getFullName()).""; - $display_status=$lc->getStatus(); - print "".getOverallStatusText($display_status["status"]). ""; + $owner = $document->getOwner(); + print "".htmlspecialchars($owner->getFullName()).""; + $display_status=$lc->getStatus(); + print "".getOverallStatusText($display_status["status"]). ""; - print "".$lc->getVersion().""; + print "".$lc->getVersion().""; // print "".$comment.""; - print "\n"; + print "\n"; } elseif(get_class($entry) == 'LetoDMS_Core_Folder') { $folder = $entry; - $foldercount++; if (in_array(2, $searchin)) { $folderName = $this->markQuery(htmlspecialchars($folder->getName()), "i"); } else {