Bugzilla – Attachment 106831 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), 12.59 KB, created by
Nick Clemens (kidclamp)
on 2020-07-13 14:03:30 UTC
(
hide
)
Description:
Bug 8732: Allowing biblio level itemtypes to display instead of MARC ones
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-07-13 14:03:30 UTC
Size:
12.59 KB
patch
obsolete
>From ac9bca476eed011757cf61859ef3fff34868adab 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 > >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 >--- > catalogue/detail.pl | 1 - > installer/data/mysql/sysprefs.sql | 1 + > .../en/modules/admin/preferences/searching.pref | 6 ++++++ > .../prog/en/modules/catalogue/detail.tt | 14 +++++++++++++- > .../prog/en/modules/catalogue/results.tt | 2 +- > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 22 ++++++++-------------- > .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 3 +-- > .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 1 + > .../bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl | 1 - > 9 files changed, 31 insertions(+), 20 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index c968e33dc9..e49830f86c 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -523,7 +523,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( >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index d67a02b367..18b5106944 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -96,6 +96,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'), >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 9301c59ce7..34c009fe4f 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 >@@ -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." >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 efbf34fb5d..326e4c720a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -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 %]&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"> >@@ -777,7 +789,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 %] ©[% 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 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 220d7de5ea..efee494965 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -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 %]" /> >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 e18ab3659f..f855897cc4 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -133,16 +133,10 @@ > <h2 class="title">[% INCLUDE 'biblio-title.inc' %]</h2> > [% IF ( author ) %]<h5 class="author">by <a class="contributors" href="/cgi-bin/koha/opac-search.pl?q=au:[% author |url %]">[% author | html %]</a></h5>[% 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 %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index b9d1423378..3609640138 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -261,8 +261,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 ) %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 6ef7dad123..cb91f70af2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -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> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl >index 5186823762..5b91a5c611 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl >@@ -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']"/> > >-- >2.11.0
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