keep paginator even if all hits are shown

This commit is contained in:
Uwe Steinmann 2022-09-13 20:03:56 +02:00
parent 4b69739b51
commit f2c8718586
2 changed files with 7 additions and 6 deletions

View File

@ -97,7 +97,7 @@ if($fullsearch) {
if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) { if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) {
$pageNumber = (integer)$_GET["pg"]; $pageNumber = (integer)$_GET["pg"];
} }
else if (!strcasecmp($_GET["pg"], "all")) { elseif (!strcasecmp($_GET["pg"], "all")) {
$pageNumber = "all"; $pageNumber = "all";
} }
} }
@ -218,7 +218,7 @@ if($fullsearch) {
$dcount = isset($facets['record_type']['document']) ? $facets['record_type']['document'] : 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);
if($searchresult['count']%$limit) if($searchresult['count']%$limit)
$totalPages++; $totalPages++;
@ -527,11 +527,12 @@ if($fullsearch) {
} }
} }
$totalPages = 1; $totalPages = 1;
if ((!isset($_GET['action']) || $_GET['action'] != 'export') && (!isset($_GET["pg"]) || strcasecmp($_GET["pg"], "all"))) { if ((!isset($_GET['action']) || $_GET['action'] != 'export') /*&& (!isset($_GET["pg"]) || strcasecmp($_GET["pg"], "all"))*/) {
$totalPages = (int) (count($entries)/$limit); $totalPages = (int) (count($entries)/$limit);
if(count($entries)%$limit) if(count($entries)%$limit)
$totalPages++; $totalPages++;
$entries = array_slice($entries, ($pageNumber-1)*$limit, $limit); if($pageNumber != 'all')
$entries = array_slice($entries, ($pageNumber-1)*$limit, $limit);
} else } else
$totalPages = 1; $totalPages = 1;
$facets = array(); $facets = array();

View File

@ -936,7 +936,7 @@ function typeahead() { /* {{{ */
} }
*/ */
echo $this->infoMsg(getMLText("search_report", array("count"=>$total, "doccount" => $totaldocs, "foldercount" => $totalfolders, 'searchtime'=>$searchTime))); echo $this->infoMsg(getMLText("search_report", array("count"=>$total, "doccount" => $totaldocs, "foldercount" => $totalfolders, 'searchtime'=>$searchTime)));
$this->pageList($pageNumber, $totalpages, "../out/out.Search.php", $urlparams); $this->pageList((int) $pageNumber, $totalpages, "../out/out.Search.php", $urlparams);
// $this->contentContainerStart(); // $this->contentContainerStart();
$txt = $this->callHook('searchListHeader', $orderby, 'asc'); $txt = $this->callHook('searchListHeader', $orderby, 'asc');
@ -1048,7 +1048,7 @@ function typeahead() { /* {{{ */
} }
print "</tbody></table>\n"; print "</tbody></table>\n";
// $this->contentContainerEnd(); // $this->contentContainerEnd();
$this->pageList($pageNumber, $totalpages, "../out/out.Search.php", $_GET); $this->pageList((int) $pageNumber, $totalpages, "../out/out.Search.php", $_GET);
} else { } else {
$numResults = $totaldocs + $totalfolders; $numResults = $totaldocs + $totalfolders;
if ($numResults == 0) { if ($numResults == 0) {