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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (+8 lines)
Lines 113-118 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
113
    var MSG_CONFIRM_AGAIN = _("Warning: Cannot be undone. Please confirm once again")
113
    var MSG_CONFIRM_AGAIN = _("Warning: Cannot be undone. Please confirm once again")
114
    var MSG_DELETE_SEARCH_HISTORY = _("Are you sure you want to delete your search history?");
114
    var MSG_DELETE_SEARCH_HISTORY = _("Are you sure you want to delete your search history?");
115
    var MSG_NO_SUGGESTION_SELECTED = _("No suggestion was selected");
115
    var MSG_NO_SUGGESTION_SELECTED = _("No suggestion was selected");
116
    var MSG_SEARCHING = _("Searching %s...");
117
    var MSG_ERROR_SEARCHING_COLLECTION = _("Error searching %s collection");
118
    var MSG_NO_RESULTS_FOUND_IN_COLLECTION = _("No results found in the library's %s collection");
119
    var MSG_RESULTS_FOUND_IN_COLLECTION = _("Found %s results in the library's %s collection");
120
    var MSG_BY = _("by");
121
    var MSG_TYPE = _("Type");
122
    var MSG_NEXT = _("Next");
123
    var MSG_PREVIOUS = _("Previous");
116
    [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %]
124
    [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %]
117
        var MSG_BASKET_EMPTY = _("Your cart is currently empty");
125
        var MSG_BASKET_EMPTY = _("Your cart is currently empty");
118
        var MSG_RECORD_IN_BASKET = _("The item is already in your cart");
126
        var MSG_RECORD_IN_BASKET = _("The item is already in your cart");
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt (-8 / +8 lines)
Lines 66-87 var querystring = "[% q |replace( "'", "\'" ) |replace( '\n', '\\n' ) |replace( Link Here
66
var results_per_page = [% OPACnumSearchResults || 20 %];
66
var results_per_page = [% OPACnumSearchResults || 20 %];
67
67
68
function search( page ) {
68
function search( page ) {
69
    $( '#recordedbooks-status' ).html( _("Searching RecordedBooks...") + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></span>' );
69
    $( '#recordedbooks-status' ).html( MSG_SEARCHING.format("RecordedBooks") + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></span>' );
70
70
71
    KOHA.RecordedBooks.search( querystring, results_per_page, page, function( data ) {
71
    KOHA.RecordedBooks.search( querystring, results_per_page, page, function( data ) {
72
        if ( data.error ) {
72
        if ( data.error ) {
73
            $( '#recordedbooks-status' ).html( '<strong class="unavailable">' + _("Error searching RecordedBooks collection") + ': ' + data.error + '</strong>' );
73
            $( '#recordedbooks-status' ).html( '<strong class="unavailable">' + MSG_ERROR_SEARCHING_COLLECTION.format("RecordedBooks") + ': ' + data.error + '</strong>' );
74
            return;
74
            return;
75
        }
75
        }
76
76
77
        if ( !data.total ) {
77
        if ( !data.total ) {
78
            $( '#recordedbooks-status' ).html( '<strong>' + _("No results found in the library's RecordedBooks collection.") + '</strong>' );
78
            $( '#recordedbooks-status' ).html( '<strong>' + MSG_NO_RESULTS_FOUND_IN_COLLECTION.format("RecordedBooks") + '</strong>' );
79
            return;
79
            return;
80
        }
80
        }
81
81
82
        $( '#recordedbooks-results-list tbody' ).empty();
82
        $( '#recordedbooks-results-list tbody' ).empty();
83
83
84
        $( '#recordedbooks-status' ).html( '<strong>' + _("Found") + ' ' + data.total + ' ' + _("results in the library's RecordedBooks collection.") + '</strong>' );
84
        $( '#recordedbooks-status' ).html( '<strong>' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.total, "RecordedBooks") + '</strong>' );
85
85
86
        for ( var i = 0; data.items[i]; i++ ) {
86
        for ( var i = 0; data.items[i]; i++ ) {
87
            var prod = data.items[i];
87
            var prod = data.items[i];
Lines 94-102 function search( page ) { Link Here
94
            results.push( prod.title );
94
            results.push( prod.title );
95
            if (prod.url) results.push( '</a>' );
95
            if (prod.url) results.push( '</a>' );
96
            results.push( '</span>' );
96
            results.push( '</span>' );
97
            results.push( '<p>' + _("by") + ' ', prod.author, '</p>' );
97
            results.push( '<p>' + MSG_BY + ' ', prod.author, '</p>' );
98
            if (prod.description) results.push( '<p>' + prod.description, '</p>' );
98
            if (prod.description) results.push( '<p>' + prod.description, '</p>' );
99
            results.push( '<span class="results_summary mediatype"><span class="label">' + _("Type:") + ' </span>', prod.media, '</span>' );
99
            results.push( '<span class="results_summary mediatype"><span class="label">' + MSG_TYPE + ': </span>', prod.media, '</span>' );
100
100
101
            results.push( '</td>' );
101
            results.push( '</td>' );
102
102
Lines 125-131 function search( page ) { Link Here
125
        if (data.total == page*results_per_page) max_page++;
125
        if (data.total == page*results_per_page) max_page++;
126
126
127
        if ( page != 1 ) {
127
        if ( page != 1 ) {
128
            pages.push( '<li><a class="od-nav" href="#" data-page="' + (page - 1) + '">&laquo; ' + _("Previous") + '</a></li>' );
128
            pages.push( '<li><a class="od-nav" href="#" data-page="' + (page - 1) + '">&laquo; ' + MSG_PREVIOUS + '</a></li>' );
129
        }
129
        }
130
130
131
        for ( var p = Math.max( 0, page - 9 ); p <= Math.min( max_page, p + 9 ); p++ ) {
131
        for ( var p = Math.max( 0, page - 9 ); p <= Math.min( max_page, p + 9 ); p++ ) {
Lines 137-143 function search( page ) { Link Here
137
        }
137
        }
138
138
139
        if ( page < max_page ) {
139
        if ( page < max_page ) {
140
            pages.push( ' <li><a class="od-nav" href="#" data-page="' + (page + 1) + '">' + _("Next") + ' &raquo;</a></li>' );
140
            pages.push( ' <li><a class="od-nav" href="#" data-page="' + (page + 1) + '">' + MSG_NEXT + ' &raquo;</a></li>' );
141
        }
141
        }
142
142
143
        if ( pages.length > 1 ) $( '#top-pages, #bottom-pages' ).find( '.pagination' ).html( '<ul>' + pages.join( '' ) + '</ul>');
143
        if ( pages.length > 1 ) $( '#top-pages, #bottom-pages' ).find( '.pagination' ).html( '<ul>' + pages.join( '' ) + '</ul>');
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-10 / +9 lines)
Lines 892-943 $(document).ready(function(){ Link Here
892
        $("#highlight_toggle_off").show().click(function() {highlightOff();});
892
        $("#highlight_toggle_off").show().click(function() {highlightOff();});
893
    [% END %]
893
    [% END %]
894
    [% IF ( OverDriveEnabled ) %]
894
    [% IF ( OverDriveEnabled ) %]
895
        var $overdrive_results = $( '<div id="overdrive-results">' + _( 'Searching OverDrive...' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
895
        var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
896
        $( '#numresults' ) .append( ' ' )
896
        $( '#numresults' ) .append( ' ' )
897
            .append( $overdrive_results );
897
            .append( $overdrive_results );
898
        KOHA.OverDrive.Search( "[% OverDriveLibraryID %]", querystring, 1, 0, function( data ) {
898
        KOHA.OverDrive.Search( "[% OverDriveLibraryID %]", querystring, 1, 0, function( data ) {
899
            if ( data.error ) {
899
            if ( data.error ) {
900
                $overdrive_results.html( _( 'Error searching OverDrive collection' ) );
900
                $overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') );
901
                return;
901
                return;
902
            }
902
            }
903
903
904
            if ( data.totalItems ) {
904
            if ( data.totalItems ) {
905
                $overdrive_results.html( _( 'Found' ) + ' <a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + data.totalItems + ' ' + _( 'results' ) + '</a> ' + _( 'in OverDrive collection' ) );
905
                $overdrive_results.html( MSG_RESULTS_FOUND_IN_COLLECTION.format('<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + data.totalItems + '</a>', 'OverDrive') );
906
            } else {
906
            } else {
907
                $overdrive_results.remove();
907
                $overdrive_results.remove();
908
            }
908
            }
909
        } );
909
        } );
910
    [% END %]
910
    [% END %]
911
    [% IF ( RecordedBooksEnabled ) %]
911
    [% IF ( RecordedBooksEnabled ) %]
912
        var $recordedbooks_results = $( '<div id="recordedbooks-results">' + _( "Searching RecordedBooks..." ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
912
        var $recordedbooks_results = $( '<div id="recordedbooks-results">' + MSG_SEARCHING.format('RecordedBooks') + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
913
        $( '#numresults' ) .append( ' ' )
913
        $( '#numresults' ) .append( ' ' )
914
            .append( $recordedbooks_results );
914
            .append( $recordedbooks_results );
915
        KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" %], null, function( data ) {
915
        KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" %], null, function( data ) {
916
            if ( data.error ) {
916
            if ( data.error ) {
917
                $recordedbooks_results.html( _( "Error searching RecordedBooks collection: %s" ).format(  data.error ) );
917
                $recordedbooks_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('RecordedBooks')  + ': ' + data.error);
918
                return;
918
                return;
919
            }
919
            }
920
920
921
            // data.total can be either 42 or "60+"
921
            // data.total can be either 42 or "60+"
922
            if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) {
922
            if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) {
923
                $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>') );
923
                $recordedbooks_results.html( MSG_RESULTS_FOUND_IN_COLLECTION.format('<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + data.total + '</a>', 'RecordedBooks') );
924
            } else {
924
            } else {
925
                $recordedbooks_results.remove();
925
                $recordedbooks_results.remove();
926
            }
926
            }
927
        } );
927
        } );
928
    [% END %]
928
    [% END %]
929
    [% IF ( OpenLibrarySearch ) %]
929
    [% IF ( OpenLibrarySearch ) %]
930
        var $openlibrary_results = $( '<div id="openlibrary-results">' + _( 'Searching Open Library...' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
930
        var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
931
        $( '#numresults' ) .append( ' ' )
931
        $( '#numresults' ) .append( ' ' )
932
            .append( $openlibrary_results );
932
            .append( $openlibrary_results );
933
        KOHA.OpenLibrary.search( querystring, null, function( data ) {
933
        KOHA.OpenLibrary.search( querystring, null, function( data ) {
934
            if ( data.error ) {
934
            if ( data.error ) {
935
                $openlibrary_results.html( _( 'Error searching OpenLibrary collection' ) );
935
                $openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') );
936
                return;
936
                return;
937
            }
937
            }
938
938
939
            if ( data.numFound > 0 ) {
939
            if ( data.numFound > 0 ) {
940
                $openlibrary_results.html( _( 'Found' ) + ' <a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + data.numFound + ' ' + _( 'results' ) + '</a> ' + _( 'in OpenLibrary collection' ) );
940
                $openlibrary_results.html( MSG_RESULTS_FOUND_IN_COLLECTION.format('<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + data.numFound + '</a>', 'OpenLibrary') );
941
            } else {
941
            } else {
942
                $openlibrary_results.remove();
942
                $openlibrary_results.remove();
943
            }
943
            }
944
- 

Return to bug 17602