@@ -, +, @@ of MARC ones 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 and material types dissappear 6 - Click in to a record details 7 - Note you see itemtype and icon 8 - Switch the pref 9 - Note you now see material type and icon --- C4/XSLT.pm | 3 +- catalogue/detail.pl | 2 +- ..._add_BiblioItemtypeImage_system_preference.perl | 7 +++++ installer/data/mysql/sysprefs.sql | 1 + .../en/modules/admin/preferences/searching.pref | 7 +++++ .../prog/en/modules/catalogue/detail.tt | 12 ++++++++ .../prog/en/modules/catalogue/results.tt | 2 +- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 7 +++-- .../prog/en/xslt/MARC21slim2intranetResults.xsl | 7 +++-- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 36 ++++++++-------------- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 3 +- .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 3 ++ .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 9 ++++-- opac/opac-detail.pl | 1 + opac/opac-search.pl | 2 ++ 15 files changed, 68 insertions(+), 34 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_8732_add_BiblioItemtypeImage_system_preference.perl --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -173,7 +173,8 @@ sub get_xslt_sysprefs { TrackClicks opacthemes IdRef OpacSuppression OPACResultsLibrary OPACShowOpenURL OpenURLResolverURL OpenURLImageLocation - OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / ) + OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts + BiblioItemtypeImage / ) { my $sp = C4::Context->preference( $syspref ); next unless defined($sp); --- a/catalogue/detail.pl +++ a/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( @@ -589,5 +588,6 @@ $template->param (countdeletedorders => $count_deletedorders_using_biblio); $template->param (basketsorders => \@baskets_orders); $template->param (basketsdeletedorders => \@baskets_deletedorders); +$template->{VARS}->{'BiblioItemtypeImage'} = C4::Context->preference('BiblioItemtypeImage'); output_html_with_http_headers $query, $cookie, $template->output; --- a/installer/data/mysql/atomicupdate/bug_8732_add_BiblioItemtypeImage_system_preference.perl +++ a/installer/data/mysql/atomicupdate/bug_8732_add_BiblioItemtypeImage_system_preference.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BiblioItemtypeImage', 'Control','Control what biblio level itemtype image displays','Control|Koha','Choice')" ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 8732: Add new BiblioItemtypeImage to system preferences)\n"; +} --- a/installer/data/mysql/sysprefs.sql +++ a/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'), +('BiblioItemtypeImage','Control','Control which itemtype info displays for biblio level itemtypes','Control|Koha','Choice'), ('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'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -270,3 +270,10 @@ Searching: - LIBRIS base URL - pref: LibrisURL - "Please only change this if you are sure it needs changing." + - + - "Display itemtype information from the " + - pref: BiblioItemtypeImage + choices: + Control: "MARC control fields" + Koha: "Koha biblio level itemtype" + - "This preference only affects MARC21 XSLT views. --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -113,6 +113,18 @@ [% END %] MARC Preview: Show + [% IF !item_level_itypes || BiblioItemtypeImage == 'Koha' %] + Itemtype: + [% IF ( imageurl ) %] + + [% END %] + [% IF ( description ) %] + [% description | html %] + [% ELSE %] + [% itemtype | html %] + [% END %] + + [% END %] [% IF ( holdcount ) %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -463,7 +463,7 @@ - [% UNLESS ( item_level_itypes ) %] + [% IF ( !item_level_itypes ) || Koha.Preference('BiblioItemtypeImage') == 'Koha' %]
[% IF !noItemTypeImages && SEARCH_RESULT.imageurl %] [%  SEARCH_RESULT.description | html %] --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -28,6 +28,7 @@ + { @@ -170,16 +171,18 @@ - + + Material type: materialtype mt_icon_/intranet-tmpl/prog/img/famfamfam/.png - + + --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl +++ a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -26,6 +26,7 @@ + @@ -482,6 +483,7 @@ + Material type: @@ -506,12 +508,13 @@ sound Sound music Music - + ; + - ; Format: + Format: --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -127,16 +127,6 @@

[% 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 ( MARCAUTHORS ) %]
@@ -246,19 +236,6 @@ Year: [% copyrightdate | html %] [% END %] - [% UNLESS ( item_level_itypes ) %] - [% IF ( imgeurl && !Koha.Preference('OpacNoItemTypeImages') ) %] - - [% END %] - Item type: - [% IF ( description ) %] - [% description | html %] - [% ELSE %] - [% itemtype | html %] - [% END %] - - [% END %] - [% IF ( MARCURLS ) %]
Online resources:
    @@ -293,6 +270,19 @@ [% END # / IF MARCURLS %] [% END # / IF OPACXSLTDetailsDisplay %] + [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeImage') == 'Koha' ) && !Koha.Preference('OpacNoItemTypeImages') %] + Item type: + [% IF ( imageurl ) %] + + [% END %] + [% IF ( description ) %] + [% description | html %] + [% ELSE %] + [% itemtype | html %] + [% END %] + + [% END %] + [% IF ( LibraryThingForLibrariesID ) %] [% UNLESS ( LibraryThingForLibrariesTabbedView ) %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -252,8 +252,7 @@ [% SEARCH_RESULT.result_number | html %]. [% END %] - - [% IF ( !item_level_itypes && !Koha.Preference('OpacNoItemTypeImages') ) %] + [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeImage') == 'Koha' ) && !Koha.Preference('OpacNoItemTypeImages') %] [% # Cell 3: Show item type image %] [% IF ( SEARCH_RESULT.imageurl ) %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl +++ a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl @@ -31,6 +31,7 @@ + { @@ -187,6 +188,7 @@ + Material type: @@ -197,6 +199,7 @@ + --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -19,8 +19,8 @@ - - + + @@ -35,6 +35,7 @@ + @@ -659,6 +660,9 @@ + + + Material type: @@ -1018,6 +1022,7 @@ + --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -1189,6 +1189,7 @@ my $defaulttab = @serialcollections > 0 ? 'serialcollection' : 'subscriptions'; $template->param('defaulttab' => $defaulttab); +$template->{VARS}->{'BiblioItemtypeImage'} = C4::Context->preference('BiblioItemtypeImage'); if (C4::Context->preference('OPACLocalCoverImages') == 1) { my @images = ListImagesForBiblio($biblionumber); --- a/opac/opac-search.pl +++ a/opac/opac-search.pl @@ -3,6 +3,7 @@ # Copyright 2008 Garry Collum and the Koha Development team # Copyright 2010 BibLibre # Copyright 2011 KohaAloha, NZ +# Copyright 2012 Catalyst IT, NZ # # This file is part of Koha. # @@ -1023,6 +1024,7 @@ if (C4::Context->preference('GoogleIndicTransliteration')) { $template->{VARS}->{DidYouMean} = ( defined C4::Context->preference('OPACdidyoumean') && C4::Context->preference('OPACdidyoumean') =~ m/enable/ ); +$template->{VARS}->{'BiblioItemtypeImage'} = C4::Context->preference('BiblioItemtypeImage'); if ($offset == 0) { $template->param(firstPage => 1); --