Bug 21526: Use the 'url' filter when needed
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-opensearch.tt
1 <?xml version='1.0' encoding='utf-8'  ?>
2 [% USE Koha %]
3 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
4 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
5
6 [% IF ( opensearchdescription ) %]
7 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
8    <ShortName>[% LibraryName | html %] Search</ShortName>
9    <Description>Search the [% LibraryName | html %]</Description>
10    <Tags>koha opac [% LibraryName | html %]</Tags>
11    <Contact>[% KohaAdminEmailAddress | html %]</Contact>
12    <Url type="application/rss+xml"
13         template="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?q={searchTerms}&amp;pw={startPage?}&amp;format=rss2"/>
14 </OpenSearchDescription>
15
16 [% ELSE %]
17
18 [% IF ( rss2 ) %]
19 <rss version="2.0"
20       xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
21       xmlns:dc="http://purl.org/dc/elements/1.1/"
22       xmlns:atom="http://www.w3.org/2005/Atom">
23    <channel>
24      <title><![CDATA[[% LibraryName | html %] Search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]]]></title>
25      <link>[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]&amp;format=rss2</link>
26      <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %]&amp;sort_by=[% sort_by | uri %]&amp;format=rss2"/>
27      <description><![CDATA[ Search results [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %] at [% LibraryName | html %]]]></description>
28      <opensearch:totalResults>[% total | html %]</opensearch:totalResults>
29      <opensearch:startIndex>[% offset | html %]</opensearch:startIndex>
30      [% IF ( results_per_page ) %]
31        <opensearch:itemsPerPage>[% results_per_page | html %]</opensearch:itemsPerPage>
32      [% ELSE %]
33        <opensearch:itemsPerPage>20</opensearch:itemsPerPage>
34      [% END %]
35          [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
36      <atom:link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% SEARCH_RESULT.query_cgi |uri %][% SEARCH_RESULT.limit_cgi |uri %]&amp;sort_by=[% SEARCH_RESULT.sort_by |uri %]&amp;format=opensearchdescription"/>
37      <opensearch:Query role="request" searchTerms="[% SEARCH_RESULT.query_desc |uri %][% SEARCH_RESULT.limit_desc |uri %]" startPage="[% SEARCH_RESULT.page | html %]" />
38      <item>
39        <title>[% SEARCH_RESULT.title | html %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield | html %][% END %]</title>
40        <dc:identifier>ISBN [% SEARCH_RESULT.isbn | html %]</dc:identifier>
41        <link>[% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %][% OPACBaseURL | html %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% ELSE %][% IF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %][% OPACBaseURL | html %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% ELSE %][% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% END %][% END %]</link>
42        <description><![CDATA[
43 [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %]
44     <img src="[% AdlibrisURL | html %]?isbn=[% SEARCH_RESULT.normalized_isbn | html %]" alt="Adlibris cover image" />
45 [% END %]
46 [% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %]
47 [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %]<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | html %]/SC.GIF&amp;client=[% SEARCH_RESULT.SyndeticsClientCode | html %]&amp;type=xw10[% IF ( SEARCH_RESULT.normalized_upc ) %]&amp;upc=[% SEARCH_RESULT.normalized_upc | html %][% END %][% IF ( SEARCH_RESULT.normalized_oclc ) %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc | html %][% END %]" alt="" />
48
49 [% ELSE %]
50 <img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc | html %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc | html %]" alt="" />
51 [% END %][% END %][% END %]
52
53 [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
54 [% IF ( BakerTaylorEnabled ) %][% IF bt_id %]<a href="https://[% BakerTaylorBookstoreURL |url %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |url %][% bt_id | html %]" /></a>[% END %][% END %]
55            <p>[% IF ( SEARCH_RESULT.author ) %]By [% SEARCH_RESULT.author | html %]. [% END %]
56            [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place | html %] [% END %][% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode | html %][% END %][% IF ( SEARCH_RESULT.publicationyear ) %] [% SEARCH_RESULT.publicationyear | html %]
57                     [% ELSE %][% IF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate | html %][% END %][% END %]
58                         [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages | html %][% END %]
59                         [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes | html %][% END %]
60                         [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size | html %]. [% END %]
61                         [% IF ( SEARCH_RESULT.isbn ) %] [% SEARCH_RESULT.isbn | html %][% END %]
62        </p>
63 [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
64 <p><a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Place Hold on <i>[% SEARCH_RESULT.title | html %]</i></a></p>
65 [% END %]
66                                                 ]]></description>
67        <guid>[% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]</guid>
68      </item>
69          [% END %]
70    </channel>
71 </rss>
72 [% END %]
73
74 [% IF ( atom ) %]
75 <feed xmlns="http://www.w3.org/2005/Atom"
76        xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
77    <id>[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]&amp;format=atom</id>
78    <title>[% LibraryName | html %] Search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]</title>
79     <link href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %]&amp;format=rss2"/>
80    <updated>[% timestamp | html %]</updated>
81    <author>
82      <name>[% LibraryName | html %]</name>
83    </author>
84    <!-- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> -->
85    <opensearch:totalResults>[% total | html %]</opensearch:totalResults>
86    <opensearch:startIndex>[% page | html %]</opensearch:startIndex>
87    [% IF ( results_per_page ) %]
88      <opensearch:itemsPerPage>[% results_per_page | html %]</opensearch:itemsPerPage>
89    [% ELSE %]
90      <opensearch:itemsPerPage>20</opensearch:itemsPerPage>
91    [% END %]
92    <opensearch:Query role="request" searchTerms="[% query_desc | html %] [% limit_desc | html %]" startPage="[% page | html %]" />
93    <link rel="alternate" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | uri %][% limit_cgi | uri %]pw=[% page | uri %]&amp;format=atom" type="application/atom+xml"/>
94    <link rel="self" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | uri %][% limit_cgi | uri %]&amp;format=atom" type="application/atom+xml"/>
95    <link rel="first" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | uri %][% limit_cgi | uri %]pw=1&amp;format=atom" type="application/atom+xml"/>
96    <link rel="previous" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | uri %][% limit_cgi | uri %]pw=2&amp;format=atom" type="application/atom+xml"/>
97    <link rel="next" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | uri %][% limit_cgi | uri %]pw=4&amp;format=atom" type="application/atom+xml"/>
98    <link rel="last" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | uri %][% limit_cgi | uri %]pw=42299&amp;format=atom" type="application/atom+xml"/>
99    <link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?format=opensearchdescription"/>
100
101    [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
102    <entry>
103      <title>[% SEARCH_RESULT.title | html %]</title>
104      <link href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]"/>
105      <!-- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> -->
106      <updated>[% SEARCH_RESULT.timestamp | html %]</updated>
107      <content type="text"><!-- put content here -->
108      </content>
109      <id>[% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]</id>
110    </entry>
111    [% END %]
112  </feed>
113 [% END %]
114
115 [% END %]