View | Details | Raw Unified | Return to bug 17602
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-10 / +9 lines)
Lines 887-938 $(document).ready(function(){ Link Here
887
        $("#highlight_toggle_off").show().click(function() {highlightOff();});
887
        $("#highlight_toggle_off").show().click(function() {highlightOff();});
888
    [% END %]
888
    [% END %]
889
    [% IF ( OverDriveEnabled ) %]
889
    [% IF ( OverDriveEnabled ) %]
890
        var $overdrive_results = $( '<div id="overdrive-results">' + _( 'Searching OverDrive...' ) + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
890
        var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
891
        $( '#numresults' ) .append( ' ' )
891
        $( '#numresults' ) .append( ' ' )
892
            .append( $overdrive_results );
892
            .append( $overdrive_results );
893
        KOHA.OverDrive.Search( "[% OverDriveLibraryID | html %]", querystring, 1, 0, function( data ) {
893
        KOHA.OverDrive.Search( "[% OverDriveLibraryID | html %]", querystring, 1, 0, function( data ) {
894
            if ( data.error ) {
894
            if ( data.error ) {
895
                $overdrive_results.html( _( 'Error searching OverDrive collection' ) );
895
                $overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') );
896
                return;
896
                return;
897
            }
897
            }
898
898
899
            if ( data.totalItems ) {
899
            if ( data.totalItems ) {
900
                $overdrive_results.html( _( 'Found' ) + ' <a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + data.totalItems + ' ' + _( 'results' ) + '</a> ' + _( 'in OverDrive collection' ) );
900
                $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' );
901
            } else {
901
            } else {
902
                $overdrive_results.remove();
902
                $overdrive_results.remove();
903
            }
903
            }
904
        } );
904
        } );
905
    [% END %]
905
    [% END %]
906
    [% IF ( RecordedBooksEnabled ) %]
906
    [% IF ( RecordedBooksEnabled ) %]
907
        var $recordedbooks_results = $( '<div id="recordedbooks-results">' + _( "Searching RecordedBooks..." ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
907
        var $recordedbooks_results = $( '<div id="recordedbooks-results">' + MSG_SEARCHING.format('RecordedBooks') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
908
        $( '#numresults' ) .append( ' ' )
908
        $( '#numresults' ) .append( ' ' )
909
            .append( $recordedbooks_results );
909
            .append( $recordedbooks_results );
910
        KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" %], null, function( data ) {
910
        KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" %], null, function( data ) {
911
            if ( data.error ) {
911
            if ( data.error ) {
912
                $recordedbooks_results.html( _( "Error searching RecordedBooks collection: %s" ).format(  data.error ) );
912
                $recordedbooks_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('RecordedBooks')  + ': ' + data.error);
913
                return;
913
                return;
914
            }
914
            }
915
915
916
            // data.total can be either 42 or "60+"
916
            // data.total can be either 42 or "60+"
917
            if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) {
917
            if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) {
918
                $recordedbooks_results.html( _( "Found %s results in RecordedBooks collection" ).format('<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + data.total + '</a>') );
918
                $recordedbooks_results.html( '<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.total, 'RecordedBooks') + '</a>' );
919
            } else {
919
            } else {
920
                $recordedbooks_results.remove();
920
                $recordedbooks_results.remove();
921
            }
921
            }
922
        } );
922
        } );
923
    [% END %]
923
    [% END %]
924
    [% IF ( OpenLibrarySearch ) %]
924
    [% IF ( OpenLibrarySearch ) %]
925
        var $openlibrary_results = $( '<div id="openlibrary-results">' + _( 'Searching Open Library...' ) + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
925
        var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
926
        $( '#numresults' ) .append( ' ' )
926
        $( '#numresults' ) .append( ' ' )
927
            .append( $openlibrary_results );
927
            .append( $openlibrary_results );
928
        KOHA.OpenLibrary.search( querystring, null, function( data ) {
928
        KOHA.OpenLibrary.search( querystring, null, function( data ) {
929
            if ( data.error ) {
929
            if ( data.error ) {
930
                $openlibrary_results.html( _( 'Error searching OpenLibrary collection' ) );
930
                $openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') );
931
                return;
931
                return;
932
            }
932
            }
933
933
934
            if ( data.numFound > 0 ) {
934
            if ( data.numFound > 0 ) {
935
                $openlibrary_results.html( _( 'Found' ) + ' <a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + data.numFound + ' ' + _( 'results' ) + '</a> ' + _( 'in OpenLibrary collection' ) );
935
                $openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">'  + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.numFound, 'OpenLibrary') + '</a>' );
936
            } else {
936
            } else {
937
                $openlibrary_results.remove();
937
                $openlibrary_results.remove();
938
            }
938
            }
939
- 

Return to bug 17602