my $itemsxml = buildKohaItemsNamespace($biblionumber);
my $xmlrecord = $record->as_xml();
$xmlrecord =~ s/\<\/record\>/$itemsxml\<\/record\>/;
+ my $sysxml = "<sysprefs>\n";
+ foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText/ ) {
+ $sysxml .= "<syspref name=\"$syspref\">" .
+ C4::Context->preference( $syspref ) .
+ "</syspref>\n";
+ }
+ $sysxml .= "</sysprefs>\n";
+ $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
+
my $parser = XML::LibXML->new();
# don't die when you find &, >, etc
$parser->recover_silently(1);
$tabsysprefs{OPACAllowHoldDateInFuture} = "OPAC";
$tabsysprefs{OPACPatronDetails} = "OPAC";
$tabsysprefs{OPACFinesTab} = "OPAC";
+$tabsysprefs{DisplayOPACiconsXSLT} = "OPAC";
# OPAC
$tabsysprefs{SearchMyLibraryFirst} = "OPAC";
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'If this is switched on, patron''s cardnumber will be shown instead of their name on the holds and catalog screens', 'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACSearchForTitleIn','<li><a href="http://worldcat.org/search?q={TITLE}" target="_blank">Other Libraries (WorldCat)</a></li>\n<li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Other Databases (Google Scholar)</a></li>\n<li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&title={TITLE}&st=xl&ac=qr" target="_blank">Online Stores (Bookfinder.com)</a></li>','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','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');
\ No newline at end of file
+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 ( 'ReturnToShelvingCart', '0', '', 'Si défini, quand un exemplaire est renvoyé son code sera modifié pour CART.' 'YesNo');
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ('DisplayClearScreenButton', '0', '', 'Cette option ajoute un bouton à la page de circulation pour effacer l\'écran', 'YesNo');
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'Active l''affichage du numéro des adhérents à la place de leur nom dans les pages de réservation et du catalogue.', 'YesNo');
+INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'Si activé, affiche le format, le type de public et les icônes de type en XSLT (MARC21)).', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'if ON, enables the librarian to choose when they want to check out a notForLoan regular item',NULL,'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');
print "Upgrade to $DBversion done (Added primary keys to language tables)\n";
}
+$DBversion = '3.01.00.042';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("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')");
+ SetVersion ($DBversion);
+ print "Upgrade to $DBversion done (added DisplayOPACiconsXSLT sysprefs)\n";
+}
+
+
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table
<!-- Option: Display Alternate Graphic Representation (MARC 880) -->
<xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
+ <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']"/>
<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)"/>
<span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}">Card View (ISBD)</a></span>
</div>
-
+ <xsl:if test="$DisplayOPACiconsXSLT!='0'">
<xsl:if test="$materialTypeCode!=''">
<span class="results_summary"><span class="label">Type: </span>
<xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
<xsl:value-of select="$materialTypeLabel"/>
</span>
</xsl:if>
+ </xsl:if>
<!--Series: Alternate Graphic Representation (MARC 880) -->
<xsl:if test="$display880">
<xsl:if test="marc:datafield[@tag=856]">
<span class="results_summary"><span class="label">Online Resources: </span>
<xsl:for-each select="marc:datafield[@tag=856]">
- <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">y3z</xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
- Click here to access online
- </xsl:when>
- </xsl:choose>
- </a>
- <xsl:choose>
- <xsl:when test="position()=last()"></xsl:when>
- <xsl:otherwise> | </xsl:otherwise>
- </xsl:choose>
-
+ <xsl:if test="$OPACURLOpenInNewWindow='0'">
+ <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">y3z</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
+ <xsl:choose>
+ <xsl:when test="$URLLinkText!=''">
+ <xsl:value-of select="$URLLinkText"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Click here to access online</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </a>
+ </xsl:if>
+ <xsl:if test="$OPACURLOpenInNewWindow='1'">
+ <a target='_blank'><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">y3z</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
+ <xsl:choose>
+ <xsl:when test="$URLLinkText!=''">
+ <xsl:value-of select="$URLLinkText"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Click here to access online</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </a>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
+ <xsl:otherwise> | </xsl:otherwise>
+ </xsl:choose>
+
</xsl:for-each>
</span>
</xsl:if>
<!-- Option: Display Alternate Graphic Representation (MARC 880) -->
<xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
+ <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']"/>
<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)"/>
</span>
</xsl:if>
+<xsl:if test="$DisplayOPACiconsXSLT!='0'">
<span class="results_summary">
<xsl:if test="$typeOf008!=''">
<span class="label">Type: </span>
</xsl:choose>
</xsl:if>
</span>
+</xsl:if>
<!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
<xsl:if test="$display880">
</xsl:call-template>
</xsl:for-each>
</span>
-
</xsl:if>
<span class="results_summary">
<xsl:choose>
<xsl:when test="marc:datafield[@tag=856]">
<xsl:for-each select="marc:datafield[@tag=856]">
- <xsl:choose>
- <xsl:when test="@ind2=0">
- <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
+ <xsl:if test="$OPACURLOpenInNewWindow='0'">
+ <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">y3z</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
+ <xsl:choose>
+ <xsl:when test="$URLLinkText!=''">
+ <xsl:value-of select="$URLLinkText"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Click here to access online</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </a>
+ </xsl:if>
+ <xsl:if test="$OPACURLOpenInNewWindow='1'">
+ <a target='_blank'><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
<xsl:choose>
<xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
<xsl:call-template name="subfieldSelect">
</xsl:call-template>
</xsl:when>
<xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
- Click here to access online
+ <xsl:choose>
+ <xsl:when test="$URLLinkText!=''">
+ <xsl:value-of select="$URLLinkText"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Click here to access online</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
</xsl:choose>
</a>
+ </xsl:if>
<xsl:choose>
- <xsl:when test="position()=last()"></xsl:when>
+ <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
<xsl:otherwise> | </xsl:otherwise>
</xsl:choose>
- </xsl:when>
- </xsl:choose>
</xsl:for-each>
</xsl:when>
+
<xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">No copies available
</xsl:when>
<xsl:when test="count(key('item-by-status', 'available'))>0">