Bug 26747: Show 'Always available' if title always available in overdrive

To test:
1 - Have a developer account for overdrive, or library credentials
    https://developer.overdrive.com/
2 - Enter info into 'Overdrive' sysprefs and enable overdrive
3 - Search for 'house' in the opac
4 - Click the overdrive link
5 - Note some titles in the collection show 999999 copies available
6 - Apply patch
7 - Note they now say 'Always available'

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2020-10-20 10:23:25 +00:00 committed by Jonathan Druart
parent 3a5d5367f1
commit a96de8283b
1 changed files with 5 additions and 1 deletions

View File

@ -83,7 +83,11 @@
function ( data ) {
if ( data.error ) return;
$availability_summary.html( '<span class="label">' + _("Availability:") + ' </span> ' + '<span class="available"><b>' + _("Items available:") + ' </b>' + data.copiesAvailable + " " + _("out of") + ' ' + data.copiesOwned + '</span>' );
if( data.availabilityType == 'AlwaysAvailable' ){
$availability_summary.html( '<span class="label">' + _("Availability:") + ' </span> ' + '<span class="available"><b>' + _("Always available") + '</b></span>' );
} else {
$availability_summary.html( '<span class="label">' + _("Availability:") + ' </span> ' + '<span class="available"><b>' + _("Items available:") + ' </b>' + data.copiesAvailable + " " + _("out of") + ' ' + data.copiesOwned + '</span>' );
}
if ( data.numberOfHolds ) {
$availability_summary.find( '.available' ).append( ', ' + _("waiting holds:") + ' <strong>' + data.numberOfHolds + '</strong>' );