Bugzilla – Attachment 12029 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-displ.patch (text/plain), 7.74 KB, created by
Chris Cormack
on 2012-09-06 21:54:51 UTC
(
hide
)
Description:
Bug 8732 : Allowing biblio level itemtypes to display instead of MARC ones
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2012-09-06 21:54:51 UTC
Size:
7.74 KB
patch
obsolete
>From 1c5c93102e90dc888e0a0d8bdae14bc38d18181b Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Thu, 6 Sep 2012 14:19:37 +1200 >Subject: [PATCH] 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 | 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(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index d17b828..c6909c2 100644 >--- a/C4/XSLT.pm >+++ b/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 ); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 35f92cc..a333dbd 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 25cd367..78182b0 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/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) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 4df81b4..8f088c2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -236,6 +236,12 @@ OPAC: > - '<br />Note: Available options are: BIBTEX (<code>bibtex</code>), Dublin Core (<code>dc</code>),' > - 'MARCXML (<code>marcxml</code>), MARC-8 encoded MARC (<code>marc8</code>), Unicode/UTF-8 encoded MARC (<code>utf8</code>),' > - 'Unicode/UTF-8 encoded MARC without local use -9xx, x9x, xx9- fields and subfields (<code>marcstd</code>), MODS (<code>mods</code>), RIS (<code>ris</code>)' >+ - >+ - '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." >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >index 6191342..d869c01 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >+++ b/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 ) %]<input type="checkbox" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" /> <label for="bib[% SEARCH_RESULT.biblionumber %]"></label>[% END %][% END %][% END %][% END %][% END %]</td> > <td class="select selectcol">[% UNLESS suppress_result_number %][% SEARCH_RESULT.result_number %].[% END %]</td> > >- [% UNLESS ( item_level_itypes ) %] >+ [% IF !item_level_itypes || OpacResultsItemtypeImage == 'Koha' %] > [% UNLESS ( noItemTypeImages ) %] > > <td class="itypecol"> >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl >index 751c61a..d7ad281 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl >@@ -28,6 +28,7 @@ > <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/> > <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/> > <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/> >+ <xsl:variable name="OpacResultsItemtypeImage" select="marc:sysprefs/marc:syspref[@name='OpacResultsItemtypeImage']"/> > <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)"/> >@@ -530,6 +531,9 @@ > > <xsl:if test="$DisplayOPACiconsXSLT!='0'"> > <span class="results_summary"> >+ >+ <xsl:if test="$OpacResultsItemtypeImage='Control'"> >+ > <xsl:if test="$typeOf008!=''"> > <span class="label">Type: </span> > <xsl:choose> >@@ -870,6 +874,7 @@ > </xsl:when> > </xsl:choose> > </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-search.pl b/opac/opac-search.pl >index 46cf105..41e52fc 100755 >--- a/opac/opac-search.pl >+++ b/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; >-- >1.7.9.5
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