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 <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Chris Cormack 2012-10-01 10:58:06 +13:00 committed by Jonathan Druart
parent 5d76558875
commit 782688a7cd
9 changed files with 31 additions and 20 deletions

View File

@ -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(

View File

@ -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'),

View File

@ -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."

View File

@ -114,6 +114,18 @@
</span>
[% END %]
<span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber | uri %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
[% IF !item_level_itypes || Koha.Preference("BiblioItemtypeInfo") %]
<span class="results_summary itemtype"><span class="label">Itemtype:</span>
[% IF ( !noItemTypeImages && imageurl ) %]
<img src="[% imageurl | html %]" alt="" />
[% END %]
[% IF ( description ) %]
[% description | html %]
[% ELSE %]
[% itemtype | html %]
[% END %]
</span>
[% END %]
[% IF ( holdcount ) %]
<span class="results_summary">
@ -825,7 +837,7 @@ Note that permanent location is a code, and location may be an authval.
<div id="editions"><h4>Editions</h4>
<table>
[% FOREACH XISBN IN XISBNS %]<tr>[% IF ( AmazonCoverImages ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"><img src="https://images-na.ssl-images-amazon.com/images/P/[% XISBN.normalized_isbn | html %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
[% UNLESS ( item_level_itypes ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description | html %][% ELSE %]<img src="[% XISBN.imageurl | html %]" alt="[% XISBN.description | html %]" title="[% XISBN.description | html %]">[% END %]</td>[% END %]
[% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description | html %][% ELSE %]<img src="[% XISBN.imageurl | html %]" alt="[% XISBN.description | html %]" title="[% XISBN.description | html %]">[% END %]</td>[% END %]
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber | uri %]">[% XISBN.title | html %]</a> by [% XISBN.author | html %] &copy;[% 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 %]

View File

@ -463,7 +463,7 @@
</td>
<td>
[% UNLESS ( item_level_itypes ) %]
[% IF ( !item_level_itypes ) || Koha.Preference('BiblioItemtypeInfo') %]
<div class="result-biblio-itemtype">
[% IF !noItemTypeImages && SEARCH_RESULT.imageurl %]
<img src="[% SEARCH_RESULT.imageurl | html %]" alt="[% SEARCH_RESULT.description | html %]" />

View File

@ -133,16 +133,10 @@
<h2 class="title">[% INCLUDE 'biblio-title.inc' %]</h2>
[% IF ( author ) %]<span class="results_summary author h3">by <a class="contributors" href="/cgi-bin/koha/opac-search.pl?q=au:[% author |url %]">[% author | html %]</a></span>[% END %]
<span class="results_summary">[% UNLESS ( item_level_itypes ) %]
[
[% IF ( description ) %]
[% description | html %]
[% ELSE %]
[% itemtype | html %]
[% END %]
] [% END %]
[% IF ( unititle ) %], [% unititle | html %][% END %]
</span>
<span class="results_summary">
[% IF ( unititle ) %], [% unititle | html %][% END %]
</span>
[% IF ( MARCAUTHORS ) %]
<div class="results_summary">
@ -252,11 +246,11 @@
<span class="results_summary year"><span class="label">Year: </span>[% copyrightdate | html %]</span>
[% END %]
[% UNLESS ( item_level_itypes ) %]
[% IF ( imgeurl && !Koha.Preference('OpacNoItemTypeImages') ) %]
<img src="[% imageurl | html %]" alt="" />
[% END %]
[% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]
<span class="results_summary itemtype"><span class="label">Item type: </span>
[% IF ( imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %]
<img src="[% imageurl | html %]" alt="" />
[% END %]
[% IF ( description ) %]
[% description | html %]
[% ELSE %]

View File

@ -266,8 +266,7 @@
[% SEARCH_RESULT.result_number | html %].
[% END %]
</td>
[% IF ( !item_level_itypes && !Koha.Preference('OpacNoItemTypeImages') ) %]
[% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) && !Koha.Preference('OpacNoItemTypeImages') %]
[% # Cell 3: Show item type image %]
<td class="itypecol">
[% IF ( SEARCH_RESULT.imageurl ) %]

View File

@ -662,6 +662,7 @@
<xsl:if test="$DisplayOPACiconsXSLT!='0'">
<span class="results_summary type">
<xsl:if test="$typeOf008!=''">
<span class="results_material_type">
<span class="label">Material type: </span>

View File

@ -19,7 +19,6 @@
<xsl:variable name="leader6" select="substring($leader,7,1)"/>
<xsl:variable name="leader7" select="substring($leader,8,1)"/>
<xsl:variable name="biblionumber" select="marc:controlfield[@tag=001]"/>
<xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
<xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
<xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>