From a96de8283ba41ebff0d8e1a7c491fc5bcff5dc18 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 20 Oct 2020 10:23:25 +0000 Subject: [PATCH] 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 Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt index e3d5dc8386..02186068d4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-overdrive-search.tt @@ -83,7 +83,11 @@ function ( data ) { if ( data.error ) return; - $availability_summary.html( '' + _("Availability:") + ' ' + '' + _("Items available:") + ' ' + data.copiesAvailable + " " + _("out of") + ' ' + data.copiesOwned + '' ); + if( data.availabilityType == 'AlwaysAvailable' ){ + $availability_summary.html( '' + _("Availability:") + ' ' + '' + _("Always available") + '' ); + } else { + $availability_summary.html( '' + _("Availability:") + ' ' + '' + _("Items available:") + ' ' + data.copiesAvailable + " " + _("out of") + ' ' + data.copiesOwned + '' ); + } if ( data.numberOfHolds ) { $availability_summary.find( '.available' ).append( ', ' + _("waiting holds:") + ' ' + data.numberOfHolds + '' ); -- 2.39.5