@@ -, +, @@ instead of MARC ones --- C4/XSLT.pm | 2 +- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/opac.pref | 8 +++++++- .../opac-tmpl/prog/en/modules/opac-results.tt | 2 +- .../prog/en/xslt/MARC21slim2OPACResults.xsl | 5 +++++ opac/opac-search.pl | 2 ++ 7 files changed, 24 insertions(+), 3 deletions(-) --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -188,7 +188,7 @@ sub XSLTParse4Display { UseAuthoritiesForTracings TraceSubjectSubdivisions Display856uAsImage OPACDisplay856uAsImage UseControlNumber IntranetBiblioDefaultView BiblioDefaultView - singleBranchMode + singleBranchMode OpacResultsItemtypeImage AlternateHoldingsField AlternateHoldingsSeparator / ) { my $sp = C4::Context->preference( $syspref ); --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -371,3 +371,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SubfieldsToUseWhenPrefill','','Define a list of subfields to use when prefilling items (separated by space)','','Free'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AgeRestrictionMarker','','Markers for age restriction indication, e.g. FSK|PEGI|Age|',NULL,'free'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AgeRestrictionOverride',0,'Allow staff to check out an item with age restriction.',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacResultsItemtypeImage','Control','Control which itemtype info displays on the Opac Results page','Control|Koha','Choice'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -5696,6 +5696,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacResultsItemtypeImage', 'Control','Control which itemtype info displays on the Opac Results page','Control|Koha','Choice')"); + print "Upgrade to $DBversion done (Add new OpacResultsItemtypeImage to system preferences)"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -236,6 +236,12 @@ OPAC: - '
Note: Available options are: BIBTEX (bibtex), Dublin Core (dc),' - 'MARCXML (marcxml), MARC-8 encoded MARC (marc8), Unicode/UTF-8 encoded MARC (utf8),' - 'Unicode/UTF-8 encoded MARC without local use -9xx, x9x, xx9- fields and subfields (marcstd), MODS (mods), RIS (ris)' + - + - 'Display ' + - pref: OpacResultsItemtypeImage + choices: + Control: "Itemtype information from the MARC control fields" + Koha: "Itemtype information from the Koha biblio level itemtype" Features: - - pref: opacuserlogin @@ -498,4 +504,4 @@ OPAC: choices: yes: Use no: "Don't use" - - "the item collection code when finding items for the shelf browser." + - "the item collection code when finding items for the shelf browser." --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -416,7 +416,7 @@ $(document).ready(function(){ [% IF ( RequestOnOpac ) %][% UNLESS ( SEARCH_RESULT.norequests ) %][% IF ( opacuserlogin ) %] [% END %][% END %][% END %][% END %][% END %] [% UNLESS suppress_result_number %][% SEARCH_RESULT.result_number %].[% END %] - [% UNLESS ( item_level_itypes ) %] + [% IF !item_level_itypes || OpacResultsItemtypeImage == 'Koha' %] [% UNLESS ( noItemTypeImages ) %] --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl +++ a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl @@ -28,6 +28,7 @@ + @@ -530,6 +531,9 @@ + + + Type: @@ -870,6 +874,7 @@ + --- a/opac/opac-search.pl +++ a/opac/opac-search.pl @@ -826,5 +826,7 @@ if (C4::Context->preference('GoogleIndicTransliteration')) { $template->param('GoogleIndicTransliteration' => 1); } +$template->{VARS}->{'OpacResultsItemtypeImage'} = C4::Context->preference('OpacResultsItemtypeImage'); + $template->param( borrowernumber => $borrowernumber); output_with_http_headers $cgi, $cookie, $template->output, $content_type; --