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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-5 lines)
Lines 132-142 Link Here
132
[% END %]
132
[% END %]
133
133
134
<script>
134
<script>
135
    var MSG_SEARCHING = _("Searching %s...");
136
    var MSG_ERROR_SEARCHING_COLLECTION = _("Error searching %s collection");
137
    var MSG_NO_RESULTS_FOUND_IN_COLLECTION = _("No results found in the library's %s collection");
138
    var MSG_RESULTS_FOUND_IN_COLLECTION = _("Found %s results in the library's %s collection");
139
140
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %]
135
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %]
141
        var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
136
        var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
142
        var MSG_TAG_ALL_BAD = _("Error! Your tag was entirely markup code.  It was NOT added.  Please try again with plain text.");
137
        var MSG_TAG_ALL_BAD = _("Error! Your tag was entirely markup code.  It was NOT added.  Please try again with plain text.");
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-7 / +6 lines)
Lines 814-820 Link Here
814
                    });
814
                    });
815
                [% END # /IF OpacHighlightedWords %]
815
                [% END # /IF OpacHighlightedWords %]
816
                [% IF ( OverDriveEnabled ) %]
816
                [% IF ( OverDriveEnabled ) %]
817
                    var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' );
817
                    var $overdrive_results = $( '<div id="overdrive-results">' + _("Searching %s...").format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' );
818
                    $( '#numresults' ) .after( $overdrive_results );
818
                    $( '#numresults' ) .after( $overdrive_results );
819
                    //Clean querystring, first we remove CCL entities, then decode HTML entities, then swap double quotes for single quotes
819
                    //Clean querystring, first we remove CCL entities, then decode HTML entities, then swap double quotes for single quotes
820
                    //as the overdrive API treats double quotes as a search term and returns extra results
820
                    //as the overdrive API treats double quotes as a search term and returns extra results
Lines 823-850 Link Here
823
                    od_querystring = od_querystring.replace(/\"/g,"'");
823
                    od_querystring = od_querystring.replace(/\"/g,"'");
824
                    KOHA.OverDrive.Search( "[% Koha.Preference('OverDriveLibraryID') | html %]", od_querystring, 1, 0, function( data ) {
824
                    KOHA.OverDrive.Search( "[% Koha.Preference('OverDriveLibraryID') | html %]", od_querystring, 1, 0, function( data ) {
825
                        if ( data.error ) {
825
                        if ( data.error ) {
826
                            $overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') );
826
                            $overdrive_results.html( _("Error searching %s collection").format('OverDrive') );
827
                            return;
827
                            return;
828
                        }
828
                        }
829
829
830
                        if ( data.totalItems ) {
830
                        if ( data.totalItems ) {
831
                            $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + encodeURIComponent( od_querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' );
831
                            $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + encodeURIComponent( od_querystring ) + '">' + _("Found %s results in the library's %s collection").format(data.totalItems, 'OverDrive') + '</a>' );
832
                        } else {
832
                        } else {
833
                            $overdrive_results.remove();
833
                            $overdrive_results.remove();
834
                        }
834
                        }
835
                    } );
835
                    } );
836
                [% END # /IF OverDriveEnabled %]
836
                [% END # /IF OverDriveEnabled %]
837
                [% IF ( OpenLibrarySearch ) %]
837
                [% IF ( OpenLibrarySearch ) %]
838
                    var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' );
838
                    var $openlibrary_results = $( '<div id="openlibrary-results">' + _("Searching %s...").format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' );
839
                    $( '#numresults' ) .after( $openlibrary_results );
839
                    $( '#numresults' ) .after( $openlibrary_results );
840
                    KOHA.OpenLibrary.search( querystring, null, function( data ) {
840
                    KOHA.OpenLibrary.search( querystring, null, function( data ) {
841
                        if ( data.error ) {
841
                        if ( data.error ) {
842
                            $openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') );
842
                            $openlibrary_results.html( _("Error searching %s collection").format('OpenLibrary') );
843
                            return;
843
                            return;
844
                        }
844
                        }
845
845
846
                        if ( data.numFound > 0 ) {
846
                        if ( data.numFound > 0 ) {
847
                            $openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">'  + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.numFound, 'OpenLibrary') + '</a>' );
847
                            $openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">'  + _("Found %s results in the library's %s collection").format(data.numFound, 'OpenLibrary') + '</a>' );
848
                        } else {
848
                        } else {
849
                            $openlibrary_results.remove();
849
                            $openlibrary_results.remove();
850
                        }
850
                        }
851
- 

Return to bug 34034