Bug 8630: Adlibris covers (intranet templates)
authorMartin Persson <xarragon@gmail.com>
Thu, 8 Oct 2015 07:12:27 +0000 (09:12 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 5 Nov 2018 14:41:05 +0000 (14:41 +0000)
Changes to staff interface (intranet) 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 results.tt
  * From the main intranet page, select "Search the catalog" and
    enter the title we added, "1984" and press "Search".
  * You should end up with the url:
    http://127.0.1.1:8080/cgi-bin/koha/catalogue/search.pl?q=1984
  * The cover image should be shown in the leftmost column.
  * If cover is clicked, the full cover image should be shown.

* Test detail.tt
  (continue from the search results used in prev. test)
  * Click on the title text, you should be sent to:
    http://127.0.1.1:8080/cgi-bin/koha/catalogue/detail.pl?biblionumber=2
  * The cover image should be shown on the right.
  * If clicked, the full cover should be shown.

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>
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt

index d3f499f..b23e24b 100644 (file)
@@ -6,6 +6,8 @@
 [% USE Branches %]
 [% USE Biblio %]
 [% USE ColumnsSettings %]
+[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
+[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
 
 [% IF Koha.Preference('AmazonAssocTag') %]
     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
             </span>
         [% END %]
 
-        [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
+        [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled ) %]
         </div><div class="yui-u" id="bookcoverimg">
         [% IF ( LocalCoverImages ) %]
             <div title="[% biblionumber |url %]" class="[% biblionumber | html %]" id="local-thumbnail-preview"></div>
         [% END %]
+        [% IF ( AdlibrisEnabled && normalized_isbn ) %]
+            <a href="[% AdlibrisURL | html %]?isbn=[% normalized_isbn | html %]"><img src="[% AdlibrisURL | html %]?isbn=[% normalized_isbn | html %]" class="adlibris-cover-big" alt="Adlibris cover image" /></a>
+        [% END %]
         [% IF ( AmazonCoverImages ) %]
             <div id="amazon-bookcoverimg">
             <a href="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link">
index ac8000d..bef4e25 100644 (file)
@@ -5,6 +5,9 @@
 [% USE KohaDates %]
 [% SET footerjs = 1 %]
 [% USE AuthorisedValues %]
+[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
+[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
+[% INCLUDE 'browser-strings.inc' %]
 [% IF BiblioDefaultViewmarc %]
     [% SET DetailPage="MARCdetail.pl" %]
 [% ELSIF BiblioDefaultViewlabeled_marc %]
                     <!-- TABLE RESULTS START -->
                 <table>
                     <tr>
-                        [% IF ( AmazonCoverImages || LocalCoverImages ) %]<th>&nbsp;</th>[% END %]
+                        [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled ) %]<th>&nbsp;</th>[% END %]
                         <th colspan="2">Results</th>
                         <th>Location</th>
                     </tr>
                         <!-- Actual Search Results -->
                         [% SET MaxSearchResultsItemsPerRecordStatusCheck = Koha.Preference('MaxSearchResultsItemsPerRecordStatusCheck') %]
                         [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
-                            <tr>
-                            [% IF ( AmazonCoverImages || LocalCoverImages ) %]
+                         [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
+                            [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled ) %]
                                 <td>
                                     [% IF ( LocalCoverImages) %]
                                         <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
                                         <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span>
                                         </a>
                                     [% END %]
+                                    [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %]
+                                        <a href="[% AdlibrisURL | html %]?isbn=[% SEARCH_RESULT.normalized_isbn | html %]"><img src="[% AdlibrisURL | html %]?isbn=[% SEARCH_RESULT.normalized_isbn | html %]" class="adlibris-cover" alt="Adlibris cover image" /></a>
+                                    [% END %]
                                     [% IF ( AmazonCoverImages ) %]
                                         [% IF ( SEARCH_RESULT.normalized_isbn ) %]
                                             <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">