From 346994bd5daaa3c6060431dd41b335f022372b39 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Fri, 14 Jul 2017 11:48:49 -0700 Subject: [PATCH] LP#1673870: process ebook variable in misc_util.tt2 Signed-off-by: Jeff Davis Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson --- Open-ILS/src/templates/opac/parts/ebook_api/avail.tt2 | 16 ++++------------ Open-ILS/src/templates/opac/parts/misc_util.tt2 | 11 +++++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/ebook_api/avail.tt2 b/Open-ILS/src/templates/opac/parts/ebook_api/avail.tt2 index f75a951459..9df0465cc4 100644 --- a/Open-ILS/src/templates/opac/parts/ebook_api/avail.tt2 +++ b/Open-ILS/src/templates/opac/parts/ebook_api/avail.tt2 @@ -6,18 +6,7 @@ # - ebook_id: external ID for title (ISBN for OneClickdigital, unique identifier for OverDrive) # - vendor (oneclickdigital, overdrive) -IF args.ebook_test_id; - ebook.ebook_id = args.ebook_test_id; - ebook.vendor = 'ebook_test'; -ELSIF args.oneclickdigital_id; - ebook.ebook_id = args.oneclickdigital_id; - ebook.vendor = 'oneclickdigital'; -ELSIF args.overdrive_id; - ebook.ebook_id = args.overdrive_id; - ebook.vendor = 'overdrive'; -END; - -IF ebook.ebook_id; +IF args.ebook; IF ctx.page == 'rresult'; ebook.rec_id = rec.id; @@ -25,6 +14,9 @@ IF ebook.ebook_id; ebook.rec_id = ctx.bre_id; END; + ebook.ebook_id = args.ebook.ebook_id; + ebook.vendor = args.ebook.vendor; + # This div is hidden by default. The JS layer will unhide it, use the ebook_id # to retrieve holdings/availability info via the appropriate vendor API, and # overwrite the div's contents with that information. diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index b1ca12541e..97cbd1e7c8 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -732,6 +732,17 @@ END; args.bibid = args.bibid.0; + IF args.ebook_test_id; + args.ebook.ebook_id = args.ebook_test_id; + args.ebook.vendor = 'ebook_test'; + ELSIF args.oneclickdigital_id; + args.ebook.ebook_id = args.oneclickdigital_id; + args.ebook.vendor = 'oneclickdigital'; + ELSIF args.overdrive_id; + args.ebook.ebook_id = args.overdrive_id; + args.ebook.vendor = 'overdrive'; + END; + END; # Get the library or location group -- 2.11.0