LP#1673870: process ebook variable in misc_util.tt2
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 14 Jul 2017 18:48:49 +0000 (11:48 -0700)
committerBill Erickson <berickxx@gmail.com>
Fri, 1 Sep 2017 20:06:50 +0000 (16:06 -0400)
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/opac/parts/ebook_api/avail.tt2
Open-ILS/src/templates/opac/parts/misc_util.tt2

index f75a951..9df0465 100644 (file)
@@ -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.
index b1ca125..97cbd1e 100644 (file)
         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