LP#1772680: Fixed the logic display Download link for checkedout item even if they...
authorJaswinder Singh <Jaswinder.Singh0011@gmail.com>
Fri, 26 Oct 2018 20:02:05 +0000 (16:02 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 16 Nov 2018 19:38:18 +0000 (14:38 -0500)
Signed-off-by: Jaswinder Singh <jaswinder.singh0011@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/opac/ebook_api/rbdigital/parts/result/table.tt2

index 2db9037..ce0db93 100644 (file)
@@ -1,7 +1,7 @@
 [%  PROCESS "opac/parts/misc_util.tt2";
     PROCESS "opac/ebook_api/rbdigital/parts/file_formats.tt2";
     USE ResolverResolver;
-    
+
     ctx.result_start = 1 + ctx.page_size * page;
     ctx.result_stop = ctx.page_size * (page + 1);
     IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
@@ -13,7 +13,6 @@
    ctx.results_count_header;
 %]
 
-
 [% IF ctx.bookbag %]
 <div id="result-bookbag-heading">
     <div class="result-bookbag-name">[% ctx.bookbag.name | html %]</div>
@@ -316,18 +315,20 @@ END;
                                                 </div>
                                                 <div class="result_table_utils_cont">
                                                     <div class="result_table_utils">
-                                                        [% IF ebook_item.isAvailable == 1; %]
+                                                        [% IF (ctx.checkouts.$ebook_isbn != "") %]
                                                             <div id="[%- rec.item.isbn -%]_ebook_checkout" class="results_aux_utils result_util ebook_action">
-                                                                [% IF ctx.checkouts.$ebook_isbn != ""; %]
-                                                                    <a id="[% ebook_item.isbn %]_ebook_checkout_download_link" 
-                                                                        href="#"
-                                                                        data-downloadurl="[% ctx.checkouts.$ebook_isbn; %]"
-                                                                        class="no-dec ebook_checkout_download_link" 
-                                                                        rel="nofollow" vocab="" 
-                                                                        data-isbn="[% ebook_item.isbn %]">
-                                                                        <img src="[% ctx.media_prefix %]/images/minus_sign.png[% ctx.cache_key %]" alt="" />&nbsp;[% l("Download") %]</a>
-                                                                    &nbsp;<a data-isbn="[% ebook_item.isbn %]" class="lnk_ebook_checkin" href="#" ><span class="glyphicon glyphicon-circle-arrow-up"></span> [% l("Return") %]</a>
-                                                                [% ELSE; %]
+                                                                <a id="[% ebook_item.isbn %]_ebook_checkout_download_link" 
+                                                                    href="#"
+                                                                    data-downloadurl="[% ctx.checkouts.$ebook_isbn; %]"
+                                                                    class="no-dec ebook_checkout_download_link" 
+                                                                    rel="nofollow" vocab="" 
+                                                                    data-isbn="[% ebook_item.isbn %]">
+                                                                    <img src="[% ctx.media_prefix %]/images/minus_sign.png[% ctx.cache_key %]" alt="" />&nbsp;[% l("Download") %]</a>&nbsp;
+                                                                <a data-isbn="[% ebook_item.isbn %]" class="lnk_ebook_checkin" href="#" ><span class="glyphicon glyphicon-circle-arrow-up"></span> [% l("Return") %]</a>
+                                                            </div>
+                                                        [% ELSE; %]
+                                                            [% IF ebook_item.isAvailable == 1; %]
+                                                                <div id="[%- rec.item.isbn -%]_ebook_checkout" class="results_aux_utils result_util ebook_action">
                                                                     <a href="[% mkurl(ctx.opac_root _ '/myopac/ebook_checkout',
                                                                         {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'checkout'},
                                                                         ['query','tag','subfield','term','_special','sort','page']) %]"
@@ -335,25 +336,26 @@ END;
                                                                         data-isbn="[% ebook_item.isbn %]" 
                                                                         class="no-dec ebook_checkout_link" rel="nofollow" vocab="">
                                                                     <img src="[% ctx.media_prefix %]/images/green_check.png[% ctx.cache_key %]"
-                                                                        alt=""/><span class="result_place_hold">[% l('Check Out E-Item') %]</span></a>                                                            
-                                                                [% END; %]
-                                                            </div>
-                                                        [% ELSE; %]
-                                                            <div id="[% ebook_item.isbn %]_ebook_hold" class="rdetail_aux_utils result_util ebook_action">
-                                                                <a id="[% ebook_item.isbn %]_ebook_place_hold" 
-                                                                    href="#" data-isbn="[% ebook_item.isbn %]"
-                                                                    class="no-dec ebook_place_hold [% IF ctx.holds.$ebook_isbn == "1"; %] hidden [% END; %]" rel="nofollow" vocab="">
-                                                                    <img src="[% ctx.media_prefix %]/images/green_check.png[% ctx.cache_key %]"
-                                                                    [% img_alt(l('Place Hold on [_1]', ebook_item.title)) %]/>
-                                                                <span class="result_place_hold">[% l('Place Hold on E-Item') %]</span></a>
+                                                                        alt=""/><span class="result_place_hold">[% l('Check Out E-Item') %]</span></a>
+                                                                </div>
+                                                            
+                                                            [% ELSE; %]
+                                                                <div id="[% ebook_item.isbn %]_ebook_hold" class="rdetail_aux_utils result_util ebook_action">
+                                                                    <a id="[% ebook_item.isbn %]_ebook_place_hold" 
+                                                                        href="#" data-isbn="[% ebook_item.isbn %]"
+                                                                        class="no-dec ebook_place_hold [% IF ctx.holds.$ebook_isbn == "1"; %] hidden [% END; %]" rel="nofollow" vocab="">
+                                                                        <img src="[% ctx.media_prefix %]/images/green_check.png[% ctx.cache_key %]"
+                                                                        [% img_alt(l('Place Hold on [_1]', ebook_item.title)) %]/>
+                                                                    <span class="result_place_hold">[% l('Place Hold on E-Item') %]</span></a>
 
-                                                                <a id="[% ebook_item.isbn %]_ebook_cancel_hold"
-                                                                    href="#" data-isbn="[% ebook_item.isbn %]"
-                                                                    class="no-dec ebook_cancel_hold [% IF ctx.holds.$ebook_isbn != "1"; %] hidden [% END; %]" rel="nofollow" vocab="">
-                                                                    <img src="[% ctx.media_prefix %]/images/minus_sign.png[% ctx.cache_key %]"
-                                                                    [% img_alt(l('Cancel Hold on [_1]', ebook_item.title)) %]/>
-                                                                <span class="result_place_hold">[% l('Cancel Hold on E-Item') %]</span></a>
-                                                            </div>
+                                                                    <a id="[% ebook_item.isbn %]_ebook_cancel_hold"
+                                                                        href="#" data-isbn="[% ebook_item.isbn %]"
+                                                                        class="no-dec ebook_cancel_hold [% IF ctx.holds.$ebook_isbn != "1"; %] hidden [% END; %]" rel="nofollow" vocab="">
+                                                                        <img src="[% ctx.media_prefix %]/images/minus_sign.png[% ctx.cache_key %]"
+                                                                        [% img_alt(l('Cancel Hold on [_1]', ebook_item.title)) %]/>
+                                                                    <span class="result_place_hold">[% l('Cancel Hold on E-Item') %]</span></a>
+                                                                </div>
+                                                            [% END; %]
                                                         [% END; %]
                                                     [% IF !ctx.is_meta %]
                                                         <div class="results_aux_utils result_util ebook_action">