From 9fc4fd3104c89a634f260418e941bbc25a505122 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Mon, 1 Oct 2012 10:58:06 +1300 Subject: [PATCH] Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones This patchset adds a new syspref: BiblioItemtypeInfo If you set BiblioItemtypeInfo to Koha, you will see the Koha record level itemtype info. This info is also shown if item-level_itypes is set to biblio Display of icons are controlled by noItemTypeImages/OpacnoItemTypeImages Material type display is controlled by DisplayIconsXSLT/DisplayOPACIconsXSLT To test: 1 - Apply patch 2 - Update database 3 - Do an opac search and view results 4 - Switch pref to 'Koha' and refresh 5 - Note itemtypes appear 6 - Click in to a record details 7 - Note you see itemtype and icon 8 - Switch the pref 9 - Note you don't see record level itemtype and icon 10 - Repeat in staff interface Signed-off-by: Andrew Fuerste-Henry --- catalogue/detail.pl | 1 - installer/data/mysql/sysprefs.sql | 1 + .../en/modules/admin/preferences/searching.pref | 6 ++++++ .../prog/en/modules/catalogue/detail.tt | 14 +++++++++++++- .../prog/en/modules/catalogue/results.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 22 ++++++++-------------- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 3 +-- .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 1 + .../bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl | 1 - 9 files changed, 31 insertions(+), 20 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index c968e33dc9..e49830f86c 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -523,7 +523,6 @@ if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->p } # Displaying tags - my $tag_quantity; if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) { $template->param( diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index d67a02b367..18b5106944 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -96,6 +96,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('BatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch','Free'), ('BiblioAddsAuthorities','0',NULL,'If ON, adding a new biblio will check for an existing authority record and create one on the fly if one doesn\'t exist','YesNo'), ('BiblioDefaultView','normal','normal|marc|isbd','Choose the default detail view in the catalog; choose between normal, marc or isbd','Choice'), +('BiblioItemtypeInfo','0','0','Control which itemtype info displays for biblio level itemtypes','YesNo'), ('BibtexExportAdditionalFields', '', NULL , 'Define additional BibTex tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'), ('BlockExpiredPatronOpacActions','1',NULL,'Set whether an expired patron can perform opac actions such as placing holds or renew books, can be overridden on a per patron-type basis','YesNo'), ('BlockReturnOfLostItems','0','0','If enabled, items that are marked as lost cannot be returned.','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index 9301c59ce7..34c009fe4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -270,3 +270,9 @@ Searching: - LIBRIS base URL - pref: LibrisURL - "Please only change this if you are sure it needs changing." + - + - pref: BiblioItemtypeInfo + choices: + yes: "Display" + no: "Don't display" + - " Koha record level itemtype info on detail and result pages in the opac. This info also displays if item-level_itypes is set to bibliographic record." diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index efbf34fb5d..326e4c720a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -114,6 +114,18 @@ [% END %] MARC Preview: Show + [% IF !item_level_itypes || Koha.Preference("BiblioItemtypeInfo") %] + Itemtype: + [% IF ( !noItemTypeImages && imageurl ) %] + + [% END %] + [% IF ( description ) %] + [% description | html %] + [% ELSE %] + [% itemtype | html %] + [% END %] + + [% END %] [% IF ( holdcount ) %] @@ -777,7 +789,7 @@ Note that permanent location is a code, and location may be an authval.

Editions

[% FOREACH XISBN IN XISBNS %][% IF ( AmazonCoverImages ) %][% END %] -[% UNLESS ( item_level_itypes ) %][% END %] +[% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %][% END %] - - [% IF ( !item_level_itypes && !Koha.Preference('OpacNoItemTypeImages') ) %] + [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) && !Koha.Preference('OpacNoItemTypeImages') %] [% # Cell 3: Show item type image %]
[% IF ( noItemTypeImages ) %][% XISBN.description | html %][% ELSE %][% XISBN.description | html %][% END %][% IF ( noItemTypeImages ) %][% XISBN.description | html %][% ELSE %][% XISBN.description | html %][% END %][% XISBN.title | html %] by [% XISBN.author | html %] ©[% XISBN.copyrightdate | html %] [% IF ( XISBN.publishercode ) %] [% XISBN.publishercode | html %] [% IF ( XISBN.place ) %]([% XISBN.place | html %])[% END %] [% IF ( XISBN.publicationyear ) %], [% XISBN.publicationyear | html %][% END %] [% IF ( XISBN.editionstatement ) %][% XISBN.editionstatement | html %][% END %] [% IF ( XISBN.editionresponsibility ) %][% XISBN.editionresponsibility | html %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 220d7de5ea..efee494965 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -463,7 +463,7 @@ - [% UNLESS ( item_level_itypes ) %] + [% IF ( !item_level_itypes ) || Koha.Preference('BiblioItemtypeInfo') %]
[% IF !noItemTypeImages && SEARCH_RESULT.imageurl %] [%  SEARCH_RESULT.description | html %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index e18ab3659f..f855897cc4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -133,16 +133,10 @@

[% INCLUDE 'biblio-title.inc' %]

[% IF ( author ) %]
by [% author | html %]
[% END %] - [% UNLESS ( item_level_itypes ) %] - [ - [% IF ( description ) %] - [% description | html %] - [% ELSE %] - [% itemtype | html %] - [% END %] - ] [% END %] - [% IF ( unititle ) %], [% unititle | html %][% END %] - + + [% IF ( unititle ) %], [% unititle | html %][% END %] + + [% IF ( MARCAUTHORS ) %]
@@ -252,11 +246,11 @@ Year: [% copyrightdate | html %] [% END %] - [% UNLESS ( item_level_itypes ) %] - [% IF ( imgeurl && !Koha.Preference('OpacNoItemTypeImages') ) %] - - [% END %] + [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %] Item type: + [% IF ( imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %] + + [% END %] [% IF ( description ) %] [% description | html %] [% ELSE %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index b9d1423378..3609640138 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -261,8 +261,7 @@ [% SEARCH_RESULT.result_number | html %]. [% END %]
[% IF ( SEARCH_RESULT.imageurl ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index 6ef7dad123..cb91f70af2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -662,6 +662,7 @@ + Material type: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl index 5186823762..5b91a5c611 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl @@ -19,7 +19,6 @@ - -- 2.11.0