Bug 13859: Item search improvements - publication date and title formatting
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Wed, 18 Mar 2015 00:11:24 +0000 (01:11 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 31 Mar 2015 14:49:42 +0000 (11:49 -0300)
In the item search accessible from the advanced search the publication
date would not display for MARC21 and the title always contained 'by'
even if there was no author information to display. Also the by is
not needed by MARC21 as the data includes punctuation.

To test:
- Check publication date always displays (MARC21 and UNIMARC)
- Check that for MARC21 the by has been removed from the title information
- Check that for UNIMARC the by only displays when there is also
  an author to display

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Tested for MARC21

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc

index 605a1bf..4085b94 100644 (file)
@@ -1,11 +1,12 @@
 [%- USE Branches -%]
+[%- USE Koha -%]
 [%- biblio = item.biblio -%]
 [%- biblioitem = item.biblioitem -%]
 [
   "[% FILTER escape_quotes = replace('"', '\"') ~%]
-    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]" title="Go to record detail page">[% biblio.title |html %]</a> by [% biblio.author |html %]
+    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]" title="Go to record detail page">[% biblio.title |html %]</a>[% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %] by[% END %] [% biblio.author |html %]
   [%~ END %]",
-  "[% biblioitem.publicationyear |html %]",
+  "[% (biblioitem.publicationyear || biblio.copyrightdate) |html %]",
   "[% biblioitem.publishercode |html %]",
   "[% biblioitem.collectiontitle |html %]",
   "[% FILTER escape_quotes ~%]