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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (+23 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");
124
    var MSG_CHECKOUTS = _("Checkouts");
125
    var MSG_NO_CHECKOUTS = _("No checkouts");
126
    var MSG_CHECK_OUT = _("Check out");
127
    var MSG_CHECK_OUT_CONFIRM = _("Are you sure you want to checkout this item?");
128
    var MSG_CHECKED_OUT_UNTIL = _("Checked out until %s");
129
    var MSG_CHECK_IN = _("Check in");
130
    var MSG_CHECK_IN_CONFIRM = _("Are you sure you want to return this item?");
131
    var MSG_NO_CHECKOUTS = _("No checkouts");
132
    var MSG_DOWNLOAD = _("Download");
133
    var MSG_HOLDS = _("Holds");
134
    var MSG_NO_HOLDS = _("No holds");
135
    var MSG_PLACE_HOLD = _("Place hold");
136
    var MSG_CANCEL_HOLD = _("Cancel");
137
    var MSG_CANCEL_HOLD_CONFIRM = _("Are you sure you want to cancel this hold?");
138
    var MSG_ON_HOLD = _("On hold");
116
    [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %]
139
    [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %]
117
        var MSG_BASKET_EMPTY = _("Your cart is currently empty");
140
        var MSG_BASKET_EMPTY = _("Your cart is currently empty");
118
        var MSG_RECORD_IN_BASKET = _("The item is already in your cart");
141
        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 (-9 / +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( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' );
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( '<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.total, 'RecordedBooks') + '</a>' );
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( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">'  + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.numFound, 'OpenLibrary') + '</a>' );
941
            } else {
941
            } else {
942
                $openlibrary_results.remove();
942
                $openlibrary_results.remove();
943
            }
943
            }
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/recordedbooks.js (-15 / +14 lines)
Lines 27-37 KOHA.RecordedBooks = new function() { Link Here
27
        }
27
        }
28
28
29
        if (data.checkouts) {
29
        if (data.checkouts) {
30
            var checkouts_div = $('<div class="recordedbooks-div">').html('<h3>' + _("Checkouts") + '</h3>');
30
            var checkouts_div = $('<div class="recordedbooks-div">').html('<h3>' + MSG_CHECKOUTS + '</h3>');
31
            var items = data.checkouts.items;
31
            var items = data.checkouts.items;
32
            var checkouts_list;
32
            var checkouts_list;
33
            if (items.length == 0) {
33
            if (items.length == 0) {
34
                checkouts_list = _("No checkouts");
34
                checkouts_list = MSG_NO_CHECKOUTS;
35
            } else {
35
            } else {
36
                checkouts_list = $('<ul class="recordedbooks-list">');
36
                checkouts_list = $('<ul class="recordedbooks-list">');
37
                data.checkouts.items.forEach(function(item) {
37
                data.checkouts.items.forEach(function(item) {
Lines 43-53 KOHA.RecordedBooks = new function() { Link Here
43
        }
43
        }
44
44
45
        if (data.holds) {
45
        if (data.holds) {
46
            var holds_div = $('<div class="recordedbooks-div">').html('<h3>' + _("Holds") + '</h3>');
46
            var holds_div = $('<div class="recordedbooks-div">').html('<h3>' + MSG_HOLDS + '</h3>');
47
            var items = data.holds.items;
47
            var items = data.holds.items;
48
            var holds_list;
48
            var holds_list;
49
            if (items.length == 0) {
49
            if (items.length == 0) {
50
                holds_list = _("No holds");
50
                holds_list = MSG_NO_HOLDS;
51
            } else {
51
            } else {
52
                holds_list = $('<ul class="recordedbooks-list">');
52
                holds_list = $('<ul class="recordedbooks-list">');
53
                data.holds.items.forEach(function(item) {
53
                data.holds.items.forEach(function(item) {
Lines 203-220 KOHA.RecordedBooks = new function() { Link Here
203
            if (item) {
203
            if (item) {
204
                var expires = new Date(item.expires);
204
                var expires = new Date(item.expires);
205
                $('<span class="recordedbooks-item-status">')
205
                $('<span class="recordedbooks-item-status">')
206
                    .text(_("Checked out until") + " " + expires.toLocaleString())
206
                    .text(MSG_CHECKED_OUT_UNTIL.format(expires.toLocaleString()))
207
                    .appendTo(el);
207
                    .appendTo(el);
208
                $(el).append(" ");
208
                $(el).append(" ");
209
209
210
                if (item.url) {
210
                if (item.url) {
211
                    var download = $('<a href="'+item.url+'">').appendTo(el);
211
                    var download = $('<a href="'+item.url+'">').appendTo(el);
212
                    decorate_button(download, _("Download"));
212
                    decorate_button(download, MSG_DOWNLOAD);
213
                    $(el).append(" ");
213
                    $(el).append(" ");
214
                }
214
                }
215
215
216
                $(el).append( ajax_button(_("Check in"), function() {
216
                $(el).append( ajax_button(MSG_CHECK_IN, function() {
217
                    if( confirm(_("Are you sure you want to return this item?")) ) {
217
                    if( confirm(MSG_CHECK_IN_CONFIRM) ) {
218
                        item_action({action: "return", isbn: isbn}, el);
218
                        item_action({action: "return", isbn: isbn}, el);
219
                    }
219
                    }
220
                }) );
220
                }) );
Lines 225-238 KOHA.RecordedBooks = new function() { Link Here
225
            item = item_is_on_hold(isbn);
225
            item = item_is_on_hold(isbn);
226
            if (item) {
226
            if (item) {
227
                $('<span class="recordedbooks-status">')
227
                $('<span class="recordedbooks-status">')
228
                    .text(_("On hold"))
228
                    .text(MSG_ON_HOLD)
229
                    .appendTo(el);
229
                    .appendTo(el);
230
                $(el).append(" ");
230
                $(el).append(" ");
231
            }
231
            }
232
232
233
            if(checkout_popup) {
233
            if(checkout_popup) {
234
                $(el).append( ajax_button(_("Check out"), function() {
234
                $(el).append( ajax_button(MSG_CHECK_OUT, function() {
235
                    if( confirm(_("Are you sure you want to checkout this item?")) ) {
235
                    if( confirm(MSG_CHECK_OUT_CONFIRM) ) {
236
                        svc_ajax('post', {action: "checkout", isbn: isbn}, function(data) {
236
                        svc_ajax('post', {action: "checkout", isbn: isbn}, function(data) {
237
                            if (data.checkouts) {
237
                            if (data.checkouts) {
238
                                details.checkouts = data.checkouts;
238
                                details.checkouts = data.checkouts;
Lines 246-259 KOHA.RecordedBooks = new function() { Link Here
246
                }) );
246
                }) );
247
            }
247
            }
248
            if (!item) {
248
            if (!item) {
249
                $(el).append( ajax_button(_("Place hold"), function() {
249
                $(el).append( ajax_button(MSG_PLACE_HOLD, function() {
250
                    item_action({action: "place_hold", isbn: isbn}, el);
250
                    item_action({action: "place_hold", isbn: isbn}, el);
251
                }) );
251
                }) );
252
            }
252
            }
253
253
254
            if (item) {
254
            if (item) {
255
                $(el).append( ajax_button(_("Cancel"), function() {
255
                $(el).append( ajax_button(MSG_CANCEL_HOLD, function() {
256
                    if( confirm(_("Are you sure you want to cancel this hold?")) ) {
256
                    if( confirm(MSG_CANCEL_HOLD_CONFIRM) ) {
257
                        item_action({action: "remove_hold", isbn: isbn}, el);
257
                        item_action({action: "remove_hold", isbn: isbn}, el);
258
                    }
258
                    }
259
                }) );
259
                }) );
260
- 

Return to bug 17602