|
Lines 291-330
KOHA.OverDriveCirculation = new function() {
Link Here
|
| 291 |
.appendTo(el); |
291 |
.appendTo(el); |
| 292 |
$(el).append(" "); |
292 |
$(el).append(" "); |
| 293 |
|
293 |
|
| 294 |
if (item.format) { |
294 |
var access = $('<a target="_blank">').appendTo(el); |
| 295 |
var download = $('<a href="#">').appendTo(el); |
295 |
decorate_button(access, __("Get item") ); |
| 296 |
decorate_button(download, __("Download") + " " + item.format); |
296 |
svc_ajax('get', {action: "download-url", id: id}, function(data) { |
| 297 |
svc_ajax('get', {action: "download-url", id: id, format: item.format}, function(data) { |
297 |
access.attr("href", data.action.redirect); |
| 298 |
download.attr("href", data.action); |
298 |
}); |
| 299 |
}); |
299 |
$(el).append(" "); |
| 300 |
$(el).append(" "); |
|
|
| 301 |
} |
| 302 |
|
| 303 |
if (item.formats) { |
| 304 |
var lockable_formats = []; |
| 305 |
for (var f in item.formats) { |
| 306 |
if (f == item.format) continue; |
| 307 |
|
| 308 |
if (item.formats[f]) { |
| 309 |
var access = $('<a target="_blank">').appendTo(el); |
| 310 |
decorate_button(access, __("Access online") + " " + f); |
| 311 |
svc_ajax('get', {action: "download-url", id: id, format: f}, function(data) { |
| 312 |
access.attr("href", data.action); |
| 313 |
}); |
| 314 |
$(el).append(" "); |
| 315 |
} |
| 316 |
else { |
| 317 |
lockable_formats.push(f); |
| 318 |
} |
| 319 |
} |
| 320 |
if (lockable_formats.length > 0 && checkout_popup) { |
| 321 |
$(el).append( ajax_button( __("Download as:"), function() { |
| 322 |
checkout_format(el, id, lockable_formats, copies_available); |
| 323 |
}) ).append(" "); |
| 324 |
} |
| 325 |
} |
| 326 |
|
| 327 |
if (item.format) return item; |
| 328 |
|
300 |
|
| 329 |
$(el).append( ajax_button( __("Check in"), function() { |
301 |
$(el).append( ajax_button( __("Check in"), function() { |
| 330 |
if( confirm( __("Are you sure you want to return this item?") ) ) { |
302 |
if( confirm( __("Are you sure you want to return this item?") ) ) { |