Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt
Martin Persson 6e82493b65 Bug 8630: Adlibris covers (OPAC templates)
Changes to OPAC templates.
Depends on new CSS clases defined in separate patch.

Test plan:

To test this particular patch (intranet templates) you need:
* The syspref patch applied
* The intranet CSS patch applied

To test:
* Apply this patch

* Enable covers (if not done already)
  * Go to staff interface, log in as a priviliged user.
  * Select "More" -> "Administration" ->
	"Global system preferences" -> "Enhanced content".
  * Set ""AdlibrisCoversEnabled" to "Show" under "Adlibris".
  * Save changes

* Add a book with a known cover/ISBN (if none exists)
  * Set MARC field 020 a,
	"INTERNATIONAL STANDARD BOOK NUMBER" to: 9780451524935
  * Set MARC field 245 a, "Title" to: 1984
  * Save changes

* Test opac-results.tt
  * Search library catalog from OPAC for "1984".
  * You should be sent to:
    http://127.0.1.1/cgi-bin/koha/opac-search.pl?idx=&q=1984
  * Cover image should be shown to the right of each title
    with CSS class: "adlibris-cover"

* Test opac-detail.tt
  (continued from previous test's location)
  * Click on the title with cover (1984, ISBN: 9780451524935)
  * Cover should be displayed to the left in full size.
  * If clicked, should link to the full-size image.

Test opac-results-grouped.tt
  * This template is only used if an external "grouping" server is
    setup and the syspref "OPACGroupResults" is set to "Use".
  * Personally I did not test this, b/c: terminally lazy

* Test opac-showreviews.tt
  * Could not find any links to this location, manually enter it:
    http://127.0.1.1/cgi-bin/koha/opac-showreviews.pl
  * Image should be shown to the right in full size.
  * If clicked it should take you to the detail view with the
    comments tab opened.

* Test opac-showreviews-rss.tt
  * Click on the RSS icon from previous test's start location.
    URL should be:
    http://127.0.1.1/cgi-bin/koha/opac-showreviews.pl?format=rss
  * An image tag linking to the full-size image without any
    styling class should be present.

* Test opac-user.tt
  * Click on your username to open:
    http://127.0.1.1/cgi-bin/koha/opac-user.pl
  * Covers should be shown for checked out items with
    CSS class: adlibris-cover
  * When clicked the destination should be the same as
    clicking the title column entry: opac-details.pl

* Test opac-opensearch.tt
  * Click on "Advanced search" and enter "1984" then press "Search"
  * This search screen uses a different template.
  * Cover image should be shown to the right of each title
    with CSS class: "adlibris-cover"
  * If clicked, should link to the OPAC detail view.

* Test opac-readingrecord.tt
  * Click on your logged-in name to go to your personal page.
  * Click on "Your reading history" tab on the left.
    http://127.0.1.1/cgi-bin/koha/opac-readingrecord.pl
  * Covers should be shown in leftmost column with
    CSS class: adlibris-cover
  * If clicked, should link to the same as the 'Title' link.

Sponsored-By: Halland County Library

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-11-05 14:41:06 +00:00

115 lines
9 KiB
XML

<?xml version='1.0' encoding='utf-8' ?>
[% USE Koha %]
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
[% IF ( opensearchdescription ) %]
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>[% LibraryName | html %] Search</ShortName>
<Description>Search the [% LibraryName | html %]</Description>
<Tags>koha opac [% LibraryName | html %]</Tags>
<Contact>[% KohaAdminEmailAddress | html %]</Contact>
<Url type="application/rss+xml"
template="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?q={searchTerms}&amp;pw={startPage?}&amp;format=rss2"/>
</OpenSearchDescription>
[% ELSE %]
[% IF ( rss2 ) %]
<rss version="2.0"
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><![CDATA[[% LibraryName | html %] Search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]]]></title>
<link>[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]&amp;format=rss2</link>
<atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %]&amp;sort_by=[% sort_by | uri %]&amp;format=rss2"/>
<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>
<opensearch:totalResults>[% total | html %]</opensearch:totalResults>
<opensearch:startIndex>[% offset | html %]</opensearch:startIndex>
[% IF ( results_per_page ) %]
<opensearch:itemsPerPage>[% results_per_page | html %]</opensearch:itemsPerPage>
[% ELSE %]
<opensearch:itemsPerPage>20</opensearch:itemsPerPage>
[% END %]
[% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
<atom:link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL | html %]/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"/>
<opensearch:Query role="request" searchTerms="[% SEARCH_RESULT.query_desc |uri %][% SEARCH_RESULT.limit_desc |uri %]" startPage="[% SEARCH_RESULT.page | html %]" />
<item>
<title>[% SEARCH_RESULT.title | html %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield | html %][% END %]</title>
<dc:identifier>ISBN [% SEARCH_RESULT.isbn | html %]</dc:identifier>
<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>
<description><![CDATA[
[% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %]
<img src="[% AdlibrisURL | html %]?isbn=[% SEARCH_RESULT.normalized_isbn | html %]" alt="Adlibris cover image" />
[% END %]
[% 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 %]
[% 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="" />
[% ELSE %]
<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="" />
[% END %][% END %][% END %]
[% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
[% 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 %]
<p>[% IF ( SEARCH_RESULT.author ) %]By [% SEARCH_RESULT.author | html %]. [% END %]
[% 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 %]
[% ELSE %][% IF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate | html %][% END %][% END %]
[% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages | html %][% END %]
[% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes | html %][% END %]
[% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size | html %]. [% END %]
[% IF ( SEARCH_RESULT.isbn ) %] [% SEARCH_RESULT.isbn | html %][% END %]
</p>
[% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
<p><a href="[% OPACBaseURL | uri %]/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Place Hold on <i>[% SEARCH_RESULT.title | html %]</i></a></p>
[% END %]
]]></description>
<guid>[% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]</guid>
</item>
[% END %]
</channel>
</rss>
[% END %]
[% IF ( atom ) %]
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<id>[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]&amp;format=atom</id>
<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>
<link href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %]&amp;format=rss2"/>
<updated>[% timestamp | html %]</updated>
<author>
<name>[% LibraryName | html %]</name>
</author>
<!-- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> -->
<opensearch:totalResults>[% total | html %]</opensearch:totalResults>
<opensearch:startIndex>[% page | html %]</opensearch:startIndex>
[% IF ( results_per_page ) %]
<opensearch:itemsPerPage>[% results_per_page | html %]</opensearch:itemsPerPage>
[% ELSE %]
<opensearch:itemsPerPage>20</opensearch:itemsPerPage>
[% END %]
<opensearch:Query role="request" searchTerms="[% query_desc | html %] [% limit_desc | html %]" startPage="[% page | html %]" />
<link rel="alternate" href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]pw=[% page | html %]&amp;format=atom" type="application/atom+xml"/>
<link rel="self" href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]&amp;format=atom" type="application/atom+xml"/>
<link rel="first" href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]pw=1&amp;format=atom" type="application/atom+xml"/>
<link rel="previous" href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]pw=2&amp;format=atom" type="application/atom+xml"/>
<link rel="next" href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]pw=4&amp;format=atom" type="application/atom+xml"/>
<link rel="last" href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html %][% limit_cgi | html %]pw=42299&amp;format=atom" type="application/atom+xml"/>
<link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?format=opensearchdescription"/>
[% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
<entry>
<title>[% SEARCH_RESULT.title | html %]</title>
<link href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]"/>
<!-- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> -->
<updated>[% SEARCH_RESULT.timestamp | html %]</updated>
<content type="text"><!-- put content here -->
</content>
<id>[% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]</id>
</entry>
[% END %]
</feed>
[% END %]
[% END %]