Bugzilla – Attachment 53470 Details for
Bug 8732
Add a system preference to allow users to choose to display an icon based on the Koha bibliographic level itemtype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones
Bug-8732-Allowing-biblio-level-itemtypes-to-displa.patch (text/plain), 16.70 KB, created by
Chris Cormack
on 2016-07-18 10:48:29 UTC
(
hide
)
Description:
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2016-07-18 10:48:29 UTC
Size:
16.70 KB
patch
obsolete
>From 16553a334383698d69e239cb3eea77dc96d34987 Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Mon, 1 Oct 2012 10:58:06 +1300 >Subject: [PATCH] Bug 8732: Allowing biblio level itemtypes to display instead > of MARC ones > >If you switch BiblioItemtypeImage to Koha, you will see the Koha >itemtypes, if it is Control you will get the ones generated from >the MARC control fields. > >Squashed commit of the following: > >commit a36d5fdbfc484639ae7939f14e0363fda79b9323 >Author: Chris Cormack <chrisc@catalyst.net.nz> >Date: Mon Oct 1 10:56:47 2012 +1300 > > WR96747, Bug 8732 Finishing staff side > >commit feff903c77ffc0fcec9459ecffab6c2ee5b1349d >Author: Chris Cormack <chrisc@catalyst.net.nz> >Date: Mon Oct 1 09:47:07 2012 +1300 > > Bug 8732 : Now working for staff side too > >commit 641be286401cf1be54fddb3cc58a53566d80dcca >Author: Chris Cormack <chrisc@catalyst.net.nz> >Date: Mon Oct 1 09:10:27 2012 +1300 > > Bug 8732 - generalising syspref > > Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> > >commit c4ce95c12a773d84e6f8d0b05664649e170799d8 >Author: Chris Cormack <chrisc@catalyst.net.nz> >Date: Wed Sep 12 09:19:31 2012 +1200 > > Bug 8732 : Showing the images on the OPAC detail page > >commit 105acad0f76628536840577fa96fb0839f9f3e2f >Author: Chris Cormack <chrisc@catalyst.net.nz> >Date: Thu Sep 6 14:19:37 2012 +1200 > > 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(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index f5cd4ee..b494c41 100644 >--- a/C4/XSLT.pm >+++ b/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); >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 4917673..b27b1d3 100755 >--- a/catalogue/detail.pl >+++ b/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; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 4e947fd..f7333d4 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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') > ; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index c84fc3b..091864e 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/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. >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 f996ad6..cdf760f 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 >@@ -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" >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 e8de754..f30ac92 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -383,7 +383,16 @@ function verify_images() { > </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 %]&viewas=html" title="MARC" class="previewMARC">Show</a></span> >- >+ [% IF !item_level_itypes || BiblioItemtypeImage == 'Koha' %] >+ <span class="results_summary itemtype">Itemtype: >+ [% IF ( description ) %] >+ [% description %] >+ [% ELSE %] >+ [% itemtype %] >+ [% END %] >+ </span> >+ [% END %] >+ > [% IF ( AmazonCoverImages || LocalCoverImages ) %] > </div><div class="yui-u" id="bookcoverimg"> > [% IF ( LocalCoverImages ) %] >@@ -540,9 +549,19 @@ function verify_images() { > [% END %] > </ul></li> > [% END %] >- [% IF ( holdcount ) %]<li><strong>Holds:</strong> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></li>[% ELSE %][% END %] >+ [% IF ( holdcount ) %]<li><strong>Holds:</strong> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></li>[% ELSE %][% END %] >+ [% IF !item_level_itypes || BiblioItemtypeImage == 'Koha' %] >+ <li><strong>Itemtype: </strong> >+ [% IF ( description ) %] >+ [% description %] >+ [% ELSE %] >+ [% itemtype %] >+ [% END %] >+ </li> >+ [% END %] > </ul> >- [% END %] >+ [% END %] >+ > > </div> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index d22f35b..85fd702 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -28,6 +28,7 @@ > <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/> > <xsl:variable name="DisplayIconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayIconsXSLT']"/> > <xsl:variable name="OpacSuppression" select="marc:sysprefs/marc:syspref[@name='OpacSuppression']"/> >+ <xsl:variable name="BiblioItemtypeImage" select="marc:sysprefs/marc:syspref[@name='BiblioItemtypeImage']"/> > <xsl:variable name="TracingQuotesLeft"> > <xsl:choose> > <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when> >@@ -163,15 +164,17 @@ > <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/> > </xsl:call-template> > >- <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''"> >+ <xsl:if test="$BiblioItemtypeImage='Control'"> >+ <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''"> > <span class="results_summary type"><span class="label">Material type: </span> > <xsl:element name="img"><xsl:attribute name="src">/intranet-tmpl/prog/img/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element> > <xsl:text> </xsl:text> > <xsl:value-of select="$materialTypeLabel"/> > </span> >- </xsl:if> > > >+ </xsl:if> >+ </xsl:if> > <!--Series: Alternate Graphic Representation (MARC 880) --> > <xsl:if test="$display880"> > <xsl:call-template name="m880Select"> >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 3440af7..8e94d67 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -114,7 +114,8 @@ > <h1 class="title">[% title |html %][% IF ( subtitle ) %] <span class="subtitle">[% FOREACH subtitl IN subtitle %][% subtitl.subfield |html %] [% END %]</span>[% END %]</h1> > [% IF ( author ) %]<h5 class="author">by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% author |url %]">[% author |html %]</a></h5>[% END %] > >- <span class="results_summary">[% UNLESS ( item_level_itypes ) %] >+ <span class="results_summary"> >+ [% IF !item_level_itypes || BiblioItemtypeImage == 'Koha' %] > [ > [% IF ( description ) %] > [% description %] >@@ -362,6 +363,7 @@ > </div> > [% END # / IF MARCURLS %] > [% END # / IF OPACXSLTDetailsDisplay %] >+ > > <!-- This puts the LTFL reviews in, and if TabbedView is not set, puts the remaining content above the Tabs instead of in them --> > [% IF ( LibraryThingForLibrariesID ) %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index a8622f3..a0403d6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -32,6 +32,7 @@ > <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/> > <xsl:variable name="theme" select="marc:sysprefs/marc:syspref[@name='opacthemes']"/> > <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/> >+ <xsl:variable name="BiblioItemtypeImage" select="marc:sysprefs/marc:syspref[@name='BiblioItemtypeImage']"/> > <xsl:variable name="TracingQuotesLeft"> > <xsl:choose> > <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when> >@@ -182,12 +183,14 @@ > </xsl:call-template> > > <xsl:if test="$DisplayOPACiconsXSLT!='0'"> >+ <xsl:if test="$BiblioItemtypeImage='Control'"> > <xsl:if test="$materialTypeCode!=''"> > <span class="results_summary type"><span class="label">Material type: </span> > <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/lib/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt">materialTypeLabel</xsl:attribute><xsl:attribute name="class">materialtype</xsl:attribute></xsl:element> > <xsl:value-of select="$materialTypeLabel"/> > </span> > </xsl:if> >+ </xsl:if> > </xsl:if> > > <!--Series: Alternate Graphic Representation (MARC 880) --> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 9b22fd5..c941f6b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -17,8 +17,8 @@ > </xsl:template> > <xsl:template match="marc:record"> > >- <!-- Option: Display Alternate Graphic Representation (MARC 880) --> >- <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/> >+ <!-- Option: Display Alternate Graphic Representation (MARC 880) --> >+ <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/> > > <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/> > <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/> >@@ -32,6 +32,7 @@ > <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/> > <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/> > <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/> >+ <xsl:variable name="BiblioItemtypeImage" select="marc:sysprefs/marc:syspref[@name='BiblioItemtypeImage']"/> > <xsl:variable name="leader" select="marc:leader"/> > <xsl:variable name="leader6" select="substring($leader,7,1)"/> > <xsl:variable name="leader7" select="substring($leader,8,1)"/> >@@ -606,6 +607,9 @@ > > <xsl:if test="$DisplayOPACiconsXSLT!='0'"> > <span class="results_summary type"> >+ >+ <xsl:if test="$BiblioItemtypeImage='Control'"> >+ > <xsl:if test="$typeOf008!=''"> > <span class="results_material_type"> > <span class="label">Material type: </span> >@@ -963,6 +967,7 @@ > </xsl:choose> > </span> > </xsl:if> >+ </xsl:if> > <xsl:text> </xsl:text> <!-- added blank space to fix font display problem, see Bug 3671 --> > </span> > </xsl:if> >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 98afe3e..27389b6 100755 >--- a/opac/opac-detail.pl >+++ b/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); >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 64b8800..3cacd5a 100755 >--- a/opac/opac-search.pl >+++ b/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); >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8732
:
12029
|
12047
|
12614
|
12722
|
12870
|
16453
|
16454
|
21820
|
21821
|
53470
|
53471
|
91885
|
92383
|
103488
|
103548
|
106831
|
106836
|
106848
|
106948
|
107705
|
107706
|
107707
|
107709
|
108322
|
108441
|
108764
|
108765
|
108766
|
108767
|
108768
|
108769
|
108770