LP#1711128 - Account for Limited Availability Titles user/driscoll/lp1711128_add_limited_availability
authorMartha Driscoll <driscoll@noblenet.org>
Wed, 17 Mar 2021 14:01:43 +0000 (10:01 -0400)
committerMartha Driscoll <driscoll@noblenet.org>
Wed, 17 Mar 2021 14:01:43 +0000 (10:01 -0400)
This commit differentiates between simultaneous use and
cost per circ titles and displays "Always available" or
"Limited availability" in the catalog. Simultaneous use
titles return 999,999 copies available or more if there
were copies owned before switching to simultaneous use.
CPC copies return 500,000 copies available.  Also this
fixes a mismatch in i18n_strings.tt2 and adds a new string
for limited availability.

Open-ILS/src/templates/opac/i18n_strings.tt2
Open-ILS/web/js/ui/default/opac/ebook_api/avail.js

index a9b7974..5283c03 100644 (file)
@@ -24,6 +24,8 @@ to js source files, via js blob.
     // For Read More functionality
     eg_opac_i18n.EG_READ_MORE = "[% l('Read More') %]";
     eg_opac_i18n.EG_READ_LESS = "[% l('Read Less') %]";
-    // For display of Always available titles in OverDrive.
-    eg_opac_i18n.EG_ALWAYS_AVAILABLE = "[% l('Always available') %]";
+    // For display of Simultaneous Use titles in OverDrive.
+    eg_opac_i18n.EG_OVERDRIVE_ALWAYS_AVAILABLE = "[% l('Always available') %]";
+    // For display of Cost per Circ titles in OverDrive.
+    eg_opac_i18n.EG_OVERDRIVE_LIMITED_AVAILABILITY = "[% l('Limited availability') %]";
 </script>
index 3762971..1a56d69 100644 (file)
@@ -33,11 +33,12 @@ dojo.addOnLoad(function() {
                                     dojo.create("li", { innerHTML: f.name }, formats_ul);
                                 });
                                 var status_node = dojo.byId(ebook.rec_id + '_status');
-                                if ( holdings.copies_owned > 9000)  {
-                                   var status_str = eg_opac_i18n.EG_OVERDRIVE_ALWAYS_AVAILABLE;
-                                }
-                                else {
-                                   var status_str = holdings.copies_available + ' of ' + holdings.copies_owned + ' available';
+                                if (holdings.copies_owned >= 999999) {
+                                    var status_str = eg_opac_i18n.EG_OVERDRIVE_ALWAYS_AVAILABLE;
+                                } else if (holdings.copies_owned == 500000) {
+                                    var status_str = eg_opac_i18n.EG_OVERDRIVE_LIMITED_AVAILABILITY;
+                                } else {
+                                    var status_str = holdings.copies_available + ' of ' + holdings.copies_owned + ' available';
                                 }
                                 status_node.innerHTML = status_str;
                                 dojo.removeClass(ebook.rec_id + '_ebook_holdings', "hidden");