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 121-126 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
121
    var MSG_CONFIRM_AGAIN = _("Warning: Cannot be undone. Please confirm once again")
121
    var MSG_CONFIRM_AGAIN = _("Warning: Cannot be undone. Please confirm once again")
122
    var MSG_DELETE_SEARCH_HISTORY = _("Are you sure you want to delete your search history?");
122
    var MSG_DELETE_SEARCH_HISTORY = _("Are you sure you want to delete your search history?");
123
    var MSG_NO_SUGGESTION_SELECTED = _("No suggestion was selected");
123
    var MSG_NO_SUGGESTION_SELECTED = _("No suggestion was selected");
124
    var MSG_SEARCHING = _("Searching %s...");
125
    var MSG_ERROR_SEARCHING_COLLECTION = _("Error searching %s collection");
126
    var MSG_NO_RESULTS_FOUND_IN_COLLECTION = _("No results found in the library's %s collection");
127
    var MSG_RESULTS_FOUND_IN_COLLECTION = _("Found %s results in the library's %s collection");
128
    var MSG_BY = _("by");
129
    var MSG_TYPE = _("Type");
130
    var MSG_NEXT = _("Next");
131
    var MSG_PREVIOUS = _("Previous");
132
    var MSG_CHECKOUTS = _("Checkouts");
133
    var MSG_NO_CHECKOUTS = _("No checkouts");
134
    var MSG_CHECK_OUT = _("Check out");
135
    var MSG_CHECK_OUT_CONFIRM = _("Are you sure you want to checkout this item?");
136
    var MSG_CHECKED_OUT_UNTIL = _("Checked out until %s");
137
    var MSG_CHECK_IN = _("Check in");
138
    var MSG_CHECK_IN_CONFIRM = _("Are you sure you want to return this item?");
139
    var MSG_NO_CHECKOUTS = _("No checkouts");
140
    var MSG_DOWNLOAD = _("Download");
141
    var MSG_HOLDS = _("Holds");
142
    var MSG_NO_HOLDS = _("No holds");
143
    var MSG_PLACE_HOLD = _("Place hold");
144
    var MSG_CANCEL_HOLD = _("Cancel");
145
    var MSG_CANCEL_HOLD_CONFIRM = _("Are you sure you want to cancel this hold?");
146
    var MSG_ON_HOLD = _("On hold");
124
    [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %]
147
    [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %]
125
        var MSG_BASKET_EMPTY = _("Your cart is currently empty");
148
        var MSG_BASKET_EMPTY = _("Your cart is currently empty");
126
        var MSG_RECORD_IN_BASKET = _("The item is already in your cart");
149
        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/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