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 |
- |
|
|