]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/result/table.tt2
Block "Place Hold" link in TPAC if item is available
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / result / table.tt2
1 [%  PROCESS "opac/parts/misc_util.tt2";
2
3     USE ResolverResolver;
4
5     ctx.result_start = 1 + ctx.page_size * page;
6     ctx.result_stop = ctx.page_size * (page + 1);
7     IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
8
9     result_count = ctx.result_start;
10
11 %]
12
13 [% PROCESS "opac/parts/result/paginate.tt2" %] 
14 [% ctx.results_count_header = PROCESS results_count_header;
15     ctx.results_count_header %]
16
17 [% IF ctx.bookbag %]
18 <div id="result-bookbag-heading">
19     <div class="result-bookbag-name">[% ctx.bookbag.name | html %]</div>
20     <div class="result-bookbag-description">[% ctx.bookbag.description | html %]</div>
21 </div>
22 [% END %]
23 <div id="result_table_div">
24             <div class="facet_sidebar">
25                 [% INCLUDE "opac/parts/staff_saved_searches.tt2" %]
26                 [% INCLUDE 'opac/parts/result/facets.tt2' %]
27             </div>
28             <div class="result_block">
29                 <table cellpadding="0" cellspacing="0"
30                     border="0" style="margin-top:10px;">
31                     <tbody id="result_table">
32                     [%  FOR rec IN ctx.records;
33                             attrs = {marc_xml => rec.marc_xml};
34                             PROCESS get_marc_attrs args=attrs;
35                             IF CGI.param('detail_record_view');
36                                 attrs.title = attrs.title_extended;
37                             END;
38                     -%]
39                         <tr class="result_table_row">
40                                             <td class="results_row_count" name="results_row_count">[%
41                                                     result_count; result_count = result_count + 1
42                                                 %].</td>
43                                             <td class='result_table_pic_header'>
44                                                 [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
45                                                 <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><img alt="[% l('Image of item') %]"
46                                                         name='item_jacket' class='result_table_pic' width="55"
47                                                         src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]' /></a><br />
48                                                 [% END %]
49                                             </td>
50                                             <td class='result_table_title_cell' name='result_table_title_cell'>
51                                                 <div class="bold">
52                                                     <a name='record_[% rec.id %]' name='item_title'
53                                                         href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
54                                                         [% HTML.attributes(title => l('Display record details for "[_1]"', attrs.title)) %]
55                                                         class='search_link'>[% attrs.title | html %]</a>
56                                                 </div>
57                                                 <div>
58                                                     <div>
59                                                         <em><a title="[% l("Perform an Author Search") %]"
60                                                                 name='item_author'
61                                                                 href="[%- 
62                                                                     authorquery = attrs.author | replace('[,\.:;]', '');
63                                                                     mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page'])
64                                                                     -%]">[% attrs.author | html %]</a></em>
65                                                         &nbsp;&nbsp;
66                                                         [% attrs.pubdate | html %]
67                                                     </div>
68                                                     <table cellpadding="0" cellspacing="0" border="0"
69                                                         class="results_info_table">
70                                                         [% IF args.holdings.size > 0 %]
71                                                         <tr name='bib_cn_list' class='result_table_title_cell'>
72                                                             <td valign='top'>
73                                                                 <strong>[% l('Call number:') %]</strong>
74                                                             </td>
75                                                             <td>[% args.holdings.0.label | html %]</td>
76                                                         </tr>
77                                                         [% END %]
78
79                                                         [% IF CGI.param('detail_record_view') %]
80                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
81
82                                                         [% IF attrs.publisher %]
83                                                             <tr name="results_pub_tr">
84                                                                 <td valign="top">
85                                                                     <strong>[% l('Publisher:') %]</strong>
86                                                                 </td>
87                                                                 <td>[% attrs.publisher | html %]</td>
88                                                             </tr>
89                                                         [% END %]
90                                                         [% IF attrs.isbns.size > 0 %]
91                                                             <tr name="results_isbn_tr">
92                                                                 <td valign="top">
93                                                                     <strong>[% l('ISBN:') %]</strong>
94                                                                 </td>
95                                                                 <td>[% attrs.isbns.0 | html %]</td>
96                                                             </tr>
97                                                         [% END %]
98                                                         [%- IF openurl.enabled == 'true';
99                                                             FOREACH issn IN args.issns;
100                                                                 NEXT IF issn == '';
101                                                                 res_urls = ResolverResolver.resolve_issn(issn, openurl.baseurl);
102                                                                 FOREACH res IN res_urls;
103                                                         %]
104                                                         <tr name="results_issn_tr">
105                                                             <td valign="top">
106                                                                 <strong><a href="[% res.target_url %]">
107                                                                 [% res.public_name | html %]</a></strong>
108                                                             </td>
109                                                             <td>[% res.target_coverage | html %]</td>
110                                                         </tr>
111                                                                 [% END %]
112                                                             [% END %]
113                                                         [% END %]
114
115                                                         [% IF attrs.edition %]
116                                                             <tr name="results_edition_tr">
117                                                                 <td valign="top">
118                                                                     <strong>[% l('Edition:') %]</strong>
119                                                                 </td>
120                                                                 <td>[% attrs.edition | html %]</td>
121                                                             </tr>
122                                                         [% END %]
123                                                         [% IF attrs.phys_desc %]
124                                                             <tr name="results_phys_desc_tr">
125                                                                 <td nowrap="nowrap" valign="top">
126                                                                     <strong>[% l('Phys. Desc.:') %]</strong>
127                                                                 </td>
128                                                                 <td>
129                                                                     [% args.phys_desc | html %]
130                                                                 </td>
131                                                             </tr>
132                                                         [% END %]
133                                                         [% FOR uri IN args.uris %]
134                                                             <tr name='bib_uri_list' class='result_table_title_cell'>
135                                                                 <td valign='top'>
136                                                                     <strong>[% l('Electronic resource') %]</strong>
137                                                                 </td>
138                                                                 <td><a href="[% uri.href %]">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
139                                                             </tr>
140                                                             [% END %]
141                                                             [%- IF args.holdings.size > 0;
142                                                                 FOREACH copy IN args.holdings;
143                                                                     IF copy.part_label != '';
144                                                                         has_parts = 'true';
145                                                                         LAST;
146                                                                     END;
147                                                                 END;
148                                                             %]
149                                                             <tr name='bib_cn_list' class='result_table_title_cell'>
150                                                                 <td colspan='2'>
151                                                                     <table class='result_holdings_table'>
152                                                                         <thead><tr>
153                                                                             <th>[% l('Library') %]</th>
154                                                                             <th>[% l('Shelving location') %]</th>
155                                                                             <th>[% l('Call number') %]</th>
156                                                                             [%- IF has_parts == 'true'; %]
157                                                                             <th>[% l('Part') %]</th>
158                                                                             [%- END %]
159                                                                             <th>[% l('Status') %]</th>
160                                                                         </tr></thead>
161                                                                         <tbody>
162                                                                 [% FOR copy IN args.holdings %]
163                                                                         <tr>
164                                                                             <td>[% copy.library | html %]</td>
165                                                                             <td>[% copy.location | html %]</td>
166                                                                             <td>[% copy.label | html %]</td>
167                                                                             [%- IF has_parts == 'true'; %]
168                                                                             <td>[% copy.part_label %]</td>
169                                                                             [%- END %]
170                                                                             <td>[% copy.status | html %]</td>
171                                                                         </tr>
172                                                                 [% END %]
173                                                                         </tbody>
174                                                                     </table>
175                                                                 </td>
176                                                             </tr>
177                                                             [%- has_parts = 'false';
178                                                                 END;
179                                                              %]
180                                                         [% END %] <!-- END detail_record_view -->
181                                                     </table>
182                                                     [% PROCESS "opac/parts/result/copy_counts.tt2" %]
183                                                     [% IF rec.user_circulated %]
184                                                     <div class="result_item_circulated">
185                                                         <img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('Checked Out Before') %]"/>
186                                                         <span>[% l('I have checked this item out before') %]</span>
187                                                     </div>
188                                                     [% END %]
189                                                     [% IF ctx.bookbag;
190                                                         rec_id = rec.id;
191                                                         FOR note IN ctx.bookbag_items_by_bre_id.$rec_id.notes %]
192                                                     <div class="result-bookbag-item-note">
193                                                         [% note.note | html %]
194                                                     </div>
195                                                         [% END %]
196                                                     [% END %]
197                                                 </div>
198                                             </td>
199
200                                             <td name='result_table_format_cell' class='result_table_format_cell' width="1">
201
202                                                 [% IF attrs.format_icon %]
203                                                 <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
204                                                 [% END %]
205
206                                                 <!-- unAPI link -->
207                                                 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.id %]'></abbr>
208
209                                                 <!-- Empty span used for creating Google Book Search-->
210                                                 <span name="googleBooksLink" class="hide_me">
211                                                     <a style='padding-left: 8px;'
212                                                         class='classic_link hide_me'
213                                                         name="googleBooks-link">[% l("Browse in Google Books Search") %]</a>
214                                                 </span>
215                                             </td>
216                                             <td nowrap='nowrap' width="1" align="right">
217                                                 <div class="result_table_utils_cont">
218                                                     <div class="result_table_utils">
219 [%- search_ou = ctx.search_ou;
220     IF ctx.place_unfillable ||
221         (ctx.holds_block.enabled != 'true' &&
222             attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0
223          ) ||
224         (ctx.holds_block.enable == 'true' && attrs.org_copy_counts.$search_ou.available > 0)
225
226 %]
227                                                         <div class="results_aux_utils place_hold"><a
228                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold', 
229                                                                     {hold_target => rec.id, hold_type => 'T', hold_source_page => mkurl()}) %]" 
230                                                                     name="place_hold_link" class="no-dec"><img
231                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
232                                                                 alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
233                                                         </div>
234 [%- END -%]
235                                                         <div class="results_aux_utils result_util">
236                                                             [%  IF ctx.user;
237                                                                 INCLUDE "opac/parts/bookbag_actions.tt2";
238                                                             %]
239                                                             [%  ELSE;
240                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
241                                                                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
242                                                                 href = mkurl(ctx.opac_root _ '/mylist/' _ operation, 
243                                                                         {record => rec.id, anchor => 'record_' _ rec.id}, 1);
244                                                             %]      
245                                                             <a href="[% href %]" class="no-dec">
246                                                                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
247                                                                 [% label %]
248                                                             </a>
249                                                             [% END %]
250                                                         </div>
251                                                         [% IF ENV.OILS_CONTENT_CAFE_USER %]
252                                                         <div class="results_aux_utils result_util">
253                                                             <a title="[% l('Reviews and More') %]" target='_blank' 
254                                                                 href="[% ctx.proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
255                                                                     ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[%-
256                                                                     ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&Options=Y">
257                                                                 <img src='[% ctx.media_prefix %]/images/starz.png'/> 
258                                                                 <span class="results_reviews">[% l('Reviews &amp; More') %]</span>
259                                                             </a>
260                                                         </div>
261                                                         [% END %]
262                                                     </div>
263                                                 </div>
264                                             </td>
265                                         </tr>
266                                         [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
267                                         <tr>
268                                             <td/>
269                                             <td align='center'> <!-- Chilifresh reviews link --> 
270                                                 <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
271                                             </td>
272                                         </tr>
273                                         <tr>
274                                             <td/>
275                                             <td colspan='5'> <!-- Chilifresh reviews panel -->
276                                                 <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center"></div>
277                                             </td>
278                                         </tr>
279                                         [%- END %]
280                     [% END %]
281                     </tbody>
282                 </table>
283             </div>
284 </div>
285 <div>
286     [% ctx.results_count_header %]
287 </div>