@@ -, +, @@ of MARC ones WR96747, Bug 8732 Finishing staff side Bug 8732 : Now working for staff side too Bug 8732 - generalising syspref Signed-off-by: Chris Cormack Bug 8732 : Showing the images on the OPAC detail page Bug 8732 : Allowing biblio level itemtypes to display instead of MARC ones If you switch OpacResultsItemtypeImage to Koha, you will see the Koha itemtypes, if it is Control you will get the ones generated from the MARC control fields. --- C4/XSLT.pm | 3 ++- catalogue/detail.pl | 2 +- installer/data/mysql/sysprefs.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 11 ++++++++++ .../en/modules/admin/preferences/searching.pref | 6 ++++++ .../prog/en/modules/catalogue/detail.tt | 25 +++++++++++++++++++--- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 7 ++++-- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 +++- .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 3 +++ .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 9 ++++++-- opac/opac-detail.pl | 1 + opac/opac-search.pl | 2 ++ 12 files changed, 65 insertions(+), 11 deletions(-) --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -170,7 +170,8 @@ sub get_xslt_sysprefs { UseControlNumber IntranetBiblioDefaultView BiblioDefaultView OPACItemLocation DisplayIconsXSLT AlternateHoldingsField AlternateHoldingsSeparator - TrackClicks opacthemes IdRef OpacSuppression / ) + TrackClicks opacthemes IdRef OpacSuppression + BiblioItemtypeImage / ) { my $sp = C4::Context->preference( $syspref ); next unless defined($sp); --- a/catalogue/detail.pl +++ a/catalogue/detail.pl @@ -442,7 +442,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( @@ -506,5 +505,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/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -542,5 +542,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'), ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), -('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') +('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), +('BiblioItemtypeImage','Control','Control which itemtype info displays for biblio level itemtypes','Control|Koha','Choice') ; --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -12774,6 +12774,17 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "XXX"; +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')" + ); + print +"Upgrade to $DBversion done (Add new BiblioItemtypeImage to system preferences)"; + SetVersion($DBversion); +} + + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -228,3 +228,9 @@ Searching: yes: "search" no: "don't search" - on all variations of the ISBN. Note that this preference has no effect if UseQueryParser is on. + - + - "Display " + - pref: BiblioItemtypeImage + choices: + Control: "Itemtype information from the MARC control fields" + Koha: "Itemtype information from the Koha biblio level itemtype" --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -383,7 +383,16 @@ function verify_images() { [% END %] MARC Preview: Show - + [% IF !item_level_itypes || BiblioItemtypeImage == 'Koha' %] + Itemtype: + [% IF ( description ) %] + [% description %] + [% ELSE %] + [% itemtype %] + [% END %] + + [% END %] + [% IF ( AmazonCoverImages || LocalCoverImages ) %]
[% IF ( LocalCoverImages ) %] @@ -540,9 +549,19 @@ function verify_images() { [% END %] [% END %] - [% IF ( holdcount ) %]
  • Holds: [% holdcount %]
  • [% ELSE %][% END %] + [% IF ( holdcount ) %]
  • Holds: [% holdcount %]
  • [% ELSE %][% END %] + [% IF !item_level_itypes || BiblioItemtypeImage == 'Koha' %] +
  • Itemtype: + [% IF ( description ) %] + [% description %] + [% ELSE %] + [% itemtype %] + [% END %] +
  • + [% END %] - [% END %] + [% END %] +
    --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -28,6 +28,7 @@ + { @@ -163,15 +164,17 @@ - + + Material type: /intranet-tmpl/prog/img/famfamfam/.png - + + --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -114,7 +114,8 @@

    [% title |html %][% IF ( subtitle ) %] [% FOREACH subtitl IN subtitle %][% subtitl.subfield |html %] [% END %][% END %]

    [% IF ( author ) %]
    by [% author |html %]
    [% END %] - [% UNLESS ( item_level_itypes ) %] + + [% IF !item_level_itypes || BiblioItemtypeImage == 'Koha' %] [ [% IF ( description ) %] [% description %] @@ -362,6 +363,7 @@ [% END # / IF MARCURLS %] [% END # / IF OPACXSLTDetailsDisplay %] + [% IF ( LibraryThingForLibrariesID ) %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl +++ a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl @@ -32,6 +32,7 @@ + { @@ -182,12 +183,14 @@
    + Material type: /opac-tmpl/lib/famfamfam/.pngmaterialTypeLabelmaterialtype + --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -17,8 +17,8 @@ - - + + @@ -32,6 +32,7 @@ + @@ -606,6 +607,9 @@ + + + Material type: @@ -963,6 +967,7 @@
    + --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -1128,6 +1128,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. # @@ -987,6 +988,7 @@ $template->{VARS}->{DidYouMean} = $template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews'); $template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer'); $template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults'); +$template->{VARS}->{'BiblioItemtypeImage'} = C4::Context->preference('BiblioItemtypeImage'); if ($offset == 0 && IsOverDriveEnabled()) { $template->param(OverDriveEnabled => 1); --