Bug 9403: Material type icons not showing for XSLT default view in intranet

Implements the material type icons shown in the MARC21 XSLT result list
of the OPAC for the intrant result list.

Also adds the system preference DisplayIconsXSLT as an intranet analogue
for the OPAC system preference DisplayOPACiconsXSLT and corrects the
descriptions of both preferences in the syspref editor.

To test:
0) Run database update to add new system preference
1) Activate default XSLTResultsDisplay
2) Check the new system preference DisplayIconsXSLT shows up correctly
  and is activated by default. Compare descriptions between DisplayIconsXSLT
  and DisplayOPACiconsXSLT.
3) Check the intranet result list for icons showing up after 'Type:' and
  before the corresponding description. Detail pages should be showing
  the 'Type:' as before.
4) Turn off DisplayIconsXSLT.
5) Check the line containing 'Type:', format and audience information is now
  hidden from the result list.
6) Check that the 'Type:'line is also hidden from the detail page.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Katrin Fischer 2013-01-17 17:49:08 +01:00 committed by Jared Camins-Esakov
parent 6807d7e338
commit 2618c05568
17 changed files with 39 additions and 21 deletions

View file

@ -188,7 +188,7 @@ sub XSLTParse4Display {
UseAuthoritiesForTracings TraceSubjectSubdivisions
Display856uAsImage OPACDisplay856uAsImage
UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
singleBranchMode OPACItemLocation
singleBranchMode OPACItemLocation DisplayIconsXSLT
AlternateHoldingsField AlternateHoldingsSeparator
TrackClicks / )
{

View file

@ -272,7 +272,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACMySummaryHTML','','Enter the HTML that will appear in a column on the \'my summary\' and \'my reading history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','70|10','Textarea');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACPatronDetails','1','If OFF the patron details tab in the OPAC is disabled.','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFinesTab','1','If OFF the patron fines tab in the OPAC is disabled.','','YesNo');
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, type icons in XSLT MARC21 results and display pages.', 'YesNo');
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowAllMessageDeletion','0','Allow any Library to delete any message','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('ShowPatronImageInWebBasedSelfCheck', '0', 'If ON, displays patron image when a patron uses web-based self-checkout', '', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnableOpacSearchHistory', '1', 'Enable or disable opac search history', 'YesNo','');
@ -420,3 +420,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('UNIMARCAuthorsFacetsSeparator',', ', 'UNIMARC authors facets separator', NULL, 'short');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo');
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice');
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');

View file

@ -6556,6 +6556,12 @@ if ( CheckVersion($DBversion) ) {
print "Upgrade to $DBversion done (Bug 9827 - Remove 'insecure' system preference)\n";
SetVersion($DBversion);
}
$DBversion = "3.11.00.XXX";
if ( CheckVersion($DBversion) ) {
$dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');");
print "Upgrade to $DBversion done (Bug 9403: Add DisplayIconsXSLT)\n";
SetVersion ($DBversion);
}
$DBversion = "3.11.00.104";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {

View file

@ -66,12 +66,11 @@ OPAC:
class: file
- '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="OPACXSLTDetailsDisplay" data-value="">Leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="OPACXSLTDetailsDisplay" data-value="default">default</a>" for the default one</li><li>put a path to define a xslt file</li><li>put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language'
-
- On pages displayed with XSLT stylesheets on the OPAC,
- pref: DisplayOPACiconsXSLT
choices:
yes: show
no: "don't show"
- icons for itemtype and authorized values.
yes: Show
no: "Don't show"
- the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.
-
- pref: COinSinOPACResults
choices:

View file

@ -65,6 +65,12 @@ Staff Client:
- pref: XSLTDetailsDisplay
class: file
- '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="XSLTDetailsDisplay" data-value="">Leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="XSLTDetailsDisplay" data-value="default">default</a>" for the default one</li><li>put a path to define a xslt file</li><li>put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language'
-
- pref: DisplayIconsXSLT
choices:
yes: Show
no: "Don't show"
- the format, audience, and material type icons in XSLT MARC21 results and detail pages in the staff client.
-
- Use the Yahoo UI libraries
- pref: yuipath

View file

@ -25,6 +25,7 @@
<xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
<xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
<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="TracingQuotesLeft">
<xsl:choose>
<xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
@ -142,13 +143,14 @@
<xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
<xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
<xsl:if test="$materialTypeCode!=''">
<xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''">
<span class="results_summary type"><span class="label">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>
<!--Series: Alternate Graphic Representation (MARC 880) -->
<xsl:if test="$display880">

View file

@ -26,6 +26,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="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
<xsl:variable name="DisplayIconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayIconsXSLT']"/>
<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)"/>
@ -447,29 +448,31 @@
</xsl:for-each>
</xsl:if>
<xsl:if test="$DisplayIconsXSLT!='0'">
<span class="results_summary">
<xsl:if test="$typeOf008!=''">
<span class="label">Type: </span>
<xsl:choose>
<xsl:when test="$leader19='a'"> Set</xsl:when>
<xsl:when test="$leader19='a'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/book_link.png" alt="book" title="book" class="materialtype"/> Set</xsl:when>
<xsl:when test="$leader6='a'">
<xsl:choose>
<xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'"> Book</xsl:when>
<xsl:when test="$leader7='i' or $leader7='s'"> Continuing Resource</xsl:when>
<xsl:when test="$leader7='a' or $leader7='b'"> Article</xsl:when>
<xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
<xsl:when test="$leader7='i' or $leader7='s'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/newspaper.png" alt="serial" title="serial" class="materialtype"/> Continuing Resource</xsl:when>
<xsl:when test="$leader7='a' or $leader7='b'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/book_open.png" alt="article" title="article" class="materialtype"/> Article</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="$leader6='t'"> Book</xsl:when>
<xsl:when test="$leader6='o'"> Kit</xsl:when>
<xsl:when test="$leader6='p'"> Mixed Materials</xsl:when>
<xsl:when test="$leader6='m'"> Computer File</xsl:when>
<xsl:when test="$leader6='e' or $leader6='f'"> Map</xsl:when>
<xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'"> Visual Material</xsl:when>
<xsl:when test="$leader6='c' or $leader6='d'"> Score</xsl:when>
<xsl:when test="$leader6='i'"> Sound</xsl:when>
<xsl:when test="$leader6='j'"> Music</xsl:when>
<xsl:when test="$leader6='t'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
<xsl:when test="$leader6='o'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/report_disk.png" alt="kit" title="kit" class="materialtype"/> Kit</xsl:when>
<xsl:when test="$leader6='p'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/report_disk.png" alt="mixed materials" title="mixed materials" class="materialtype"/>Mixed Materials</xsl:when>
<xsl:when test="$leader6='m'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/computer_link.png" alt="computer file" title="computer file" class="materialtype"/> Computer File</xsl:when>
<xsl:when test="$leader6='e' or $leader6='f'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/map.png" alt="map" title="map" class="materialtype"/> Map</xsl:when>
<xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/film.png" alt="visual material" title="visual material" class="materialtype"/> Visual Material</xsl:when>
<xsl:when test="$leader6='c' or $leader6='d'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/music.png" alt="score" title="score" class="materialtype"/> Score</xsl:when>
<xsl:when test="$leader6='i'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/sound.png" alt="sound" title="sound" class="materialtype"/> Sound</xsl:when>
<xsl:when test="$leader6='j'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/sound.png" alt="music" title="music" class="materialtype"/> Music</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="string-length(normalize-space($physicalDescription))">
<span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of>
</xsl:if>
@ -768,6 +771,7 @@
</xsl:if>
<xsl:text> </xsl:text> <!-- added blank space to fix font display problem, see Bug 3671 -->
</span>
</xsl:if> <!-- DisplayIconsXSLT -->
<!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
<xsl:if test="$display880">

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B