]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/result/table.tt2
d53c8f25cb16dd93293ac43ecd8f766110849487
[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                                                                     [%- UNLESS CGI.param('detail_record_view')
66                                                                         OR (show_more_details.default == 'true'
67                                                                         OR show_more_details.default == 'hide')
68                                                                     %] [% attrs.pubdate | html %]
69                                                                     [%- END -%]
70                                                     </div>
71                                                     <table cellpadding="0" cellspacing="0" border="0"
72                                                         class="results_info_table">
73                                                         [% IF args.holdings.size > 0 %]
74                                                         <tr name='bib_cn_list' class='result_table_title_cell'>
75                                                             <td valign='top'>
76                                                                 <strong>[% l('Call number:') %]</strong>
77                                                             </td>
78                                                             <td>[% args.holdings.0.label | html %]</td>
79                                                         </tr>
80                                                         [% END %]
81
82                                                         [% IF CGI.param('detail_record_view') %]
83                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
84
85                                                         [% IF attrs.pubinfo %]
86                                                             <tr name="results_pub_tr">
87                                                                 <td valign="top">
88                                                                     <strong>[% l('Publisher:') %]</strong>
89                                                                 </td>
90                                                                 <td>[% attrs.pubinfo | html %]</td>
91                                                             </tr>
92                                                         [% END %]
93                                                         [% IF attrs.isbns.size > 0 %]
94                                                             <tr name="results_isbn_tr">
95                                                                 <td valign="top">
96                                                                     <strong>[% l('ISBN:') %]</strong>
97                                                                 </td>
98                                                                 <td>[% attrs.isbns.0 | html %]</td>
99                                                             </tr>
100                                                         [% END %]
101                                                         [%- IF attrs.issns.size > 0 %]
102                                                             <tr name="results_issn_tr">
103                                                                 <td valign="top">
104                                                                     <strong>[% l('ISSN:') %]</strong>
105                                                                 </td>
106                                                                 <td>[% attrs.issns.0 | html %]</td>
107                                                             </tr>
108                                                         [%- END %]
109                                                         [%- IF openurl.enabled == 'true';
110                                                             FOREACH issn IN args.issns;
111                                                                 NEXT IF issn == '';
112                                                                 res_urls = ResolverResolver.resolve_issn(issn, openurl.baseurl);
113                                                                 FOREACH res IN res_urls;
114                                                         %]
115                                                         <tr name="results_issn_tr">
116                                                             <td valign="top">
117                                                                 <strong><a href="[% res.target_url %]">
118                                                                 [% res.public_name | html %]</a></strong>
119                                                             </td>
120                                                             <td>[% res.target_coverage | html %]</td>
121                                                         </tr>
122                                                                 [% END %]
123                                                             [% END %]
124                                                         [% END %]
125
126                                                         [% IF attrs.edition %]
127                                                             <tr name="results_edition_tr">
128                                                                 <td valign="top">
129                                                                     <strong>[% l('Edition:') %]</strong>
130                                                                 </td>
131                                                                 <td>[% attrs.edition | html %]</td>
132                                                             </tr>
133                                                         [% END %]
134                                                         [% IF attrs.phys_desc %]
135                                                             <tr name="results_phys_desc_tr">
136                                                                 <td nowrap="nowrap" valign="top">
137                                                                     <strong>[% l('Phys. Desc.:') %]</strong>
138                                                                 </td>
139                                                                 <td>
140                                                                     [% args.phys_desc | html %]
141                                                                 </td>
142                                                             </tr>
143                                                         [% END %]
144                                                         [% FOR uri IN args.uris %]
145                                                             <tr name='bib_uri_list' class='result_table_title_cell'>
146                                                                 <td valign='top'>
147                                                                     <strong>[% l('Electronic resource') %]</strong>
148                                                                 </td>
149                                                                 <td><a href="[% uri.href %]">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
150                                                             </tr>
151                                                             [% END %]
152                                                             [%- IF args.holdings.size > 0;
153                                                                 FOREACH copy IN args.holdings;
154                                                                     IF copy.part_label != '';
155                                                                         has_parts = 'true';
156                                                                         LAST;
157                                                                     END;
158                                                                 END;
159                                                             %]
160                                                             <tr name='bib_cn_list' class='result_table_title_cell'>
161                                                                 <td colspan='2'>
162                                                                     <table class='result_holdings_table'>
163                                                                         <thead><tr>
164                                                                             <th>[% l('Library') %]</th>
165                                                                             <th>[% l('Shelving location') %]</th>
166                                                                             <th>[% l('Call number') %]</th>
167                                                                             [%- IF has_parts == 'true'; %]
168                                                                             <th>[% l('Part') %]</th>
169                                                                             [%- END %]
170                                                                             <th>[% l('Status') %]</th>
171                                                                         </tr></thead>
172                                                                         <tbody>
173                                                                 [% FOR copy IN args.holdings %]
174                                                                         <tr>
175                                                                             <td>[% copy.library | html %]</td>
176                                                                             <td>[% copy.location | html %]</td>
177                                                                             <td>[% copy.label | html %]</td>
178                                                                             [%- IF has_parts == 'true'; %]
179                                                                             <td>[% copy.part_label %]</td>
180                                                                             [%- END %]
181                                                                             <td>[% copy.status | html %]</td>
182                                                                         </tr>
183                                                                 [% END %]
184                                                                         </tbody>
185                                                                     </table>
186                                                                 </td>
187                                                             </tr>
188                                                             [%- has_parts = 'false';
189                                                                 END;
190                                                              %]
191                                                         [% END %] <!-- END detail_record_view -->
192                                                     </table>
193                                                     [% PROCESS "opac/parts/result/copy_counts.tt2" %]
194                                                     [% IF rec.user_circulated %]
195                                                     <div class="result_item_circulated">
196                                                         <img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('Checked Out Before') %]"/>
197                                                         <span>[% l('I have checked this item out before') %]</span>
198                                                     </div>
199                                                     [% END %]
200                                                     [% IF ctx.bookbag;
201                                                         rec_id = rec.id;
202                                                         FOR note IN ctx.bookbag_items_by_bre_id.$rec_id.notes %]
203                                                     <div class="result-bookbag-item-note">
204                                                         [% note.note | html %]
205                                                     </div>
206                                                         [% END %]
207                                                     [% END %]
208                                                 </div>
209                                             </td>
210
211                                             <td name='result_table_format_cell' class='result_table_format_cell' width="1">
212
213                                                 [% IF attrs.format_icon %]
214                                                 <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
215                                                 [% END %]
216
217                                                 <!-- unAPI link -->
218                                                 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% rec.id %]'></abbr>
219
220                                                 <!-- Empty span used for creating Google Book Search-->
221                                                 <span name="googleBooksLink" class="hide_me">
222                                                     <a style='padding-left: 8px;'
223                                                         class='classic_link hide_me'
224                                                         name="googleBooks-link">[% l("Browse in Google Books Search") %]</a>
225                                                 </span>
226                                             </td>
227                                             <td nowrap='nowrap' width="1" align="right">
228                                                 <div class="result_table_utils_cont">
229                                                     <div class="result_table_utils">
230 [%- search_ou = ctx.search_ou;
231     num_holdable_copies = attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size || 0;
232     IF ctx.place_unfillable ||
233         ( num_holdable_copies > 0
234             && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0)
235         )
236 %]
237                                                         <div class="results_aux_utils place_hold"><a
238                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold', 
239                                                                     {hold_target => rec.id, hold_type => 'T', hold_source_page => mkurl()}) %]" 
240                                                                     name="place_hold_link" class="no-dec"><img
241                                                                 src="[% ctx.media_prefix %]/images/green_check.png"
242                                                                 alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
243                                                         </div>
244 [%- END -%]
245                                                         <div class="results_aux_utils result_util">
246                                                             [%  IF ctx.user;
247                                                                 INCLUDE "opac/parts/bookbag_actions.tt2";
248                                                             %]
249                                                             [%  ELSE;
250                                                                 operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
251                                                                 label = (operation == "add") ? l("Add to my list") : l("Remove from my list");
252                                                                 href = mkurl(ctx.opac_root _ '/mylist/' _ operation, 
253                                                                         {record => rec.id, anchor => 'record_' _ rec.id}, 1);
254                                                             %]      
255                                                             <a href="[% href %]" class="no-dec">
256                                                                 <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
257                                                                 [% label %]
258                                                             </a>
259                                                             [% END %]
260                                                         </div>
261                                                         [% IF ENV.OILS_CONTENT_CAFE_USER %]
262                                                         <div class="results_aux_utils result_util">
263                                                             <a title="[% l('Reviews and More') %]" target='_blank' 
264                                                                 href="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
265                                                                     ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[%-
266                                                                     ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&amp;Options=Y">
267                                                                 <img src='[% ctx.media_prefix %]/images/starz.png'/> 
268                                                                 <span class="results_reviews">[% l('Reviews &amp; More') %]</span>
269                                                             </a>
270                                                         </div>
271                                                         [% END %]
272                                                     </div>
273                                                 </div>
274                                             </td>
275                                         </tr>
276                                         [%- IF ENV.OILS_CHILIFRESH_ACCOUNT %]
277                                         <tr>
278                                             <td/>
279                                             <td align='center'> <!-- Chilifresh reviews link --> 
280                                                 <span class="chili_review" id="isbn_[% attrs.isbn_clean | html %]"> </span>
281                                             </td>
282                                         </tr>
283                                         <tr>
284                                             <td/>
285                                             <td colspan='5'> <!-- Chilifresh reviews panel -->
286                                                 <div id="chili_review_[% attrs.isbn_clean | html %]" style="display: none;" align="center"></div>
287                                             </td>
288                                         </tr>
289                                         [%- END %]
290                     [% END %]
291                     </tbody>
292                 </table>
293             </div>
294 </div>
295 <div>
296     [% ctx.results_count_header %]
297 </div>