LP#1673870: Add ebook transaction links to search results and record details
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 21 Jun 2017 19:05:11 +0000 (12:05 -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_js.tt2
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index f70f115..5a03dc5 100644 (file)
@@ -35,6 +35,11 @@ dojo.addOnLoad(function() {
                                 var status_str = holdings.copies_available + ' of ' + holdings.copies_owned + ' available';
                                 status_node.innerHTML = status_str;
                                 dojo.removeClass(ebook.rec_id + '_ebook_holdings', "hidden");
+                                if (holdings.copies_available > 0) {
+                                    dojo.removeClass(ebook.rec_id + '_ebook_checkout', "hidden");
+                                } else {
+                                    dojo.removeClass(ebook.rec_id + '_ebook_place_hold', "hidden");
+                                }
                             }
                         }
                         // unhide holdings/availability info now that it's populated
index 42835fd..c9b9919 100644 (file)
                 <span class="place_hold">[% l('Place Hold') %]</span></a>
             </div>
             [%- END -%]
+
+            [%- IF ebook_api.enabled == 'true' && args.ebook %]
+            <div id="[%- ctx.bre_id -%]_ebook_checkout" class="rdetail_aux_utils ebook_action hidden">
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/ebook_circs',
+                    {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'checkout'}, stop_parms) %]"
+                class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/green_check.png"
+                    [% img_alt(l('Check Out [_1]', attrs.title)) %]/>
+                <span class="place_hold">[% l('Check Out E-Item') %]</span></a>
+            </div>
+            <div id="[%- ctx.bre_id -%]_ebook_place_hold" class="rdetail_aux_utils ebook_action hidden">
+                <a href="[% mkurl(ctx.opac_root _ '/myopac/ebook_holds',
+                    {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'place_hold'}, stop_parms) %]"
+                class="no-dec" rel="nofollow" vocab=""><img src="[% ctx.media_prefix %]/images/green_check.png"
+                    [% img_alt(l('Place Hold on [_1]', attrs.title)) %]/>
+                <span class="place_hold">[% l('Place Hold on E-Item') %]</span></a>
+            </div>
+            [%- END -%]
+
             <div class="rdetail_aux_utils toggle_list">
         [% IF !ctx.is_staff %]
             [%  IF ctx.user;
index d520f5e..df87911 100644 (file)
@@ -396,6 +396,28 @@ END;
                                                                 alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
                                                         </div>
 [%- END -%]
+
+                                                        [%- IF ebook_api.enabled == 'true' && args.ebook %]
+                                                        <div id="[%- rec.id -%]_ebook_checkout" class="results_aux_utils result_util ebook_action hidden">
+                                                            <a href="[% mkurl(ctx.opac_root _ '/myopac/ebook_circs',
+                                                                {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'checkout'},
+                                                                ['query','tag','subfield','term','_special','sort','page']) %]"
+                                                                [% html_text_attr('title', l('Check Out [_1]', attrs.title)) %]
+                                                                    class="no-dec" rel="nofollow" vocab=""><img
+                                                                src="[% ctx.media_prefix %]/images/green_check.png"
+                                                                alt=""/><span class="result_place_hold">[% l('Check Out E-Item') %]</span></a>
+                                                        </div>
+                                                        <div id="[%- rec.id -%]_ebook_place_hold" class="results_aux_utils result_util ebook_action hidden">
+                                                            <a href="[% mkurl(ctx.opac_root _ '/myopac/ebook_holds',
+                                                                {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'place_hold'},
+                                                                ['query','tag','subfield','term','_special','sort','page']) %]"
+                                                                [% html_text_attr('title', l('Place Hold on [_1]', attrs.title)) %]
+                                                                    class="no-dec" rel="nofollow" vocab=""><img
+                                                                src="[% ctx.media_prefix %]/images/green_check.png"
+                                                                alt=""/><span class="result_place_hold">[% l('Place Hold on E-Item') %]</span></a>
+                                                        </div>
+                                                        [%- END -%]
+
                                                         <div class="results_aux_utils result_util">
                                                         [% IF !ctx.is_staff %]
                                                             [%  IF ctx.user;