Hide Place Hold for, show link to ezproxy uris
authorJeff Godin <jgodin@tadl.org>
Wed, 25 Jul 2012 19:23:26 +0000 (15:23 -0400)
committerJeff Godin <jgodin@tadl.org>
Wed, 25 Jul 2012 19:23:26 +0000 (15:23 -0400)
For records with uris that match TADL's ezproxy host:

In the search results page:
 - Hide the Place Hold link
 - Show a link to the first uri on the bib

In the record summary page:
 - Hide the Place Hold link

More styling would be good, and potentially putting something where
the "Place Hold" div was in the search results, so that those rows
don't become tiny when the record has no cover art available.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
templates_tadlskin/opac/parts/misc_util.tt2
templates_tadlskin/opac/parts/record/summary.tt2
templates_tadlskin/opac/parts/result/table.tt2

index 2a9a8ea..2c25de9 100644 (file)
                     res.link = uri.getAttribute('label');
                     res.note = uri.getAttribute('use_restriction');
                     args.uris.push(res);
+                    IF res.href.match('^http://via.tadl.org/');
+                        args.ezproxy = 1;
+                    END;
                 END;
                 NEXT;
             ELSE;
index 840cae2..eb41726 100644 (file)
     </div>
 
     <div id="rdetail_actions_div">
+       [% IF !args.ezproxy %]
         <div class="rdetail_aux_utils place_hold">
             <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
                 {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]" 
             class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span 
             class="place_hold">[% l('Place Hold') %]</span></a>
         </div>
+       [% END %]
         <div class="rdetail_aux_utils toggle_list">
         [%-  
             operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
index 2ef8848..c473758 100644 (file)
                                                             <td>[% args.holdings.0.label | html %]</td>
                                                         </tr>
                                                         [% END %]
+                                                        [% IF args.ezproxy %]
+                                                        <tr name='bib_uri_list' class='result_table_title_cell'>
+                                                                <td valign='top'>
+                                                                        <a href="[% args.uris.0.href %]">[% args.uris.0.link %]</a>
+                                                                </td>
+                                                        </tr>
+                                                        [% END %]
 
                                                         [% IF CGI.param('detail_record_view') %]
                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
                                             <td nowrap='nowrap' width="1" align="right">
                                                 <div class="result_table_utils_cont">
                                                     <div class="result_table_utils">
+                                                        [% IF !args.ezproxy %]
                                                         <div class="results_aux_utils place_hold"><a
                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold', 
                                                                     {hold_target => rec.id, hold_type => 'T', hold_source_page => mkurl()}) %]" 
                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
                                                                 alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
                                                         </div>
+                                                        [% END %]
                                                         <div class="results_aux_utils result_util">
                                                             [%  
                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";