From 782688a7cd36ef5597570cd62e6e89275d7ffa47 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 Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- catalogue/detail.pl | 1 - installer/data/mysql/sysprefs.sql | 1 + .../modules/admin/preferences/searching.pref | 6 +++++ .../prog/en/modules/catalogue/detail.tt | 14 +++++++++++- .../prog/en/modules/catalogue/results.tt | 2 +- .../bootstrap/en/modules/opac-detail.tt | 22 +++++++------------ .../bootstrap/en/modules/opac-results.tt | 3 +-- .../en/xslt/MARC21slim2OPACResults.xsl | 1 + .../en/xslt/UNIMARCslim2OPACDetail.xsl | 1 - 9 files changed, 31 insertions(+), 20 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 4a2aa3afa7..276f33c270 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -512,7 +512,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 09564db692..449ad36199 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -97,6 +97,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 0c7576a8d5..db2462723b 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 ) %] @@ -825,7 +837,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 b8b45d61a3..912e3c8d35 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 f8dce1e0a1..4cd737c575 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 8f8aa642bc..6403e67e7f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -266,8 +266,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 a0879f65d4..30ae2bae4a 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.39.5