From 6b978c01fb92f67bf155ec74c841e008eb520b5b Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Tue, 29 Apr 2014 13:37:42 -0600 Subject: [PATCH] Bug 10486 - Followup: Give more accurate results and pages count --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-external-search.tt | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-external-search.tt | 4 ++-- koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-external-search.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-external-search.tt index 1f242c4..29f546a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-external-search.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-external-search.tt @@ -172,7 +172,7 @@ function search( offset, reset_search ) { $( '#results tbody' ).empty(); - $( '#pazpar2-status' ).html( '' + _("Found __RESULTS__ results in __TARGETS__ external targets.").replace('__RESULTS__', data.total).replace('__TARGETS__', $( '#targets-facet input:checked' ).length ) ); + $( '#pazpar2-status' ).html( '' + _("Found __RESULTS__ results in __TARGETS__ external targets.").replace('__RESULTS__', data.merged).replace('__TARGETS__', $( '#targets-facet input:checked' ).length ) ); for ( var i = 0; data.hits[i]; i++ ) { var hit = data.hits[i]; @@ -210,7 +210,7 @@ function search( offset, reset_search ) { var pages = []; var cur_page = data.start / results_per_page; - var max_page = Math.floor( data.total / results_per_page ); + var max_page = Math.floor( data.merged / results_per_page ) - 1; if ( cur_page != 0 ) { pages.push( '
  • << ' + _("Previous") + '
  • ' ); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index c4080d0..0c9b322 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -892,7 +892,7 @@ $(document).ready(function(){ } first_succeeded = true; - FinishExternalSearch( 'pazpar2', _("Found __LINK__ in __TARGETS__ external targets").replace( '__TARGETS__', num_targets ), data.total, '/cgi-bin/koha/opac-external-search.pl?q=' + escape( querystring ) ); + FinishExternalSearch( 'pazpar2', _("Found __LINK__ in __TARGETS__ external targets").replace( '__TARGETS__', num_targets ), data.merged, '/cgi-bin/koha/opac-external-search.pl?q=' + escape( querystring ) ); } ); } [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-external-search.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-external-search.tt index 4fac891..de692aa 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-external-search.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-external-search.tt @@ -105,7 +105,7 @@ function search( offset, reset_search ) { $( '#results tbody' ).empty(); - $( '#pazpar2-status' ).html( '' + _("Found __RESULTS__ results in __TARGETS__ external targets.").replace('__RESULTS__', data.total).replace('__TARGETS__', $( '#targets-facet input:checked' ).length ) ); + $( '#pazpar2-status' ).html( '' + _("Found __RESULTS__ results in __TARGETS__ external targets.").replace('__RESULTS__', data.merged).replace('__TARGETS__', $( '#targets-facet input:checked' ).length ) ); for ( var i = 0; data.hits[i]; i++ ) { var hit = data.hits[i]; @@ -145,7 +145,7 @@ function search( offset, reset_search ) { var pages = []; var cur_page = data.start / results_per_page; - var max_page = Math.floor( data.total / results_per_page ); + var max_page = Math.floor( data.merged / results_per_page ) - 1; if ( cur_page != 0 ) { pages.push( '<< ' + _("Previous") + '' ); diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt index dac7211..6f386aa 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -320,7 +320,7 @@ $(document).ready(function(){ } first_succeeded = true; - FinishExternalSearch( 'pazpar2', _("Found __LINK__ in __TARGETS__ external targets").replace( '__TARGETS__', num_targets ), data.total, '/cgi-bin/koha/opac-external-search.pl?q=' + escape( querystring ) ); + FinishExternalSearch( 'pazpar2', _("Found __LINK__ in __TARGETS__ external targets").replace( '__TARGETS__', num_targets ), data.merged, '/cgi-bin/koha/opac-external-search.pl?q=' + escape( querystring ) ); } ); } [% END %] -- 1.9.0