Lines 685-690
Link Here
|
685 |
</xsl:if> |
685 |
</xsl:if> |
686 |
</xsl:template> |
686 |
</xsl:template> |
687 |
|
687 |
|
|
|
688 |
<xsl:template name="GetCnumSearchURL"> |
689 |
<xsl:param name="title_subfield" select="'t'"/> |
690 |
<xsl:param name="cnum_subfield" select="'w'"/> |
691 |
<xsl:param name="opac_url" select="1"/> |
692 |
<xsl:param name="UseControlNumber"/> |
693 |
|
694 |
<xsl:variable name="orgcode"> |
695 |
<xsl:choose> |
696 |
<xsl:when test="$UseControlNumber!='1'"/> |
697 |
<xsl:when test="substring-before(marc:subfield[@code=$cnum_subfield],')')"> |
698 |
<!-- substring before closing parenthesis, remove parentheses and spaces --> |
699 |
<xsl:value-of select="normalize-space(translate(substring-before(marc:subfield[@code=$cnum_subfield],')'),'()',''))"/> |
700 |
</xsl:when> |
701 |
</xsl:choose> |
702 |
</xsl:variable> |
703 |
<xsl:variable name="controlnumber"> |
704 |
<xsl:choose> |
705 |
<xsl:when test="$UseControlNumber!='1'"/> |
706 |
<xsl:when test="substring-after(marc:subfield[@code=$cnum_subfield],')')"> |
707 |
<!-- substring after closing parenthesis, remove spaces --> |
708 |
<xsl:value-of select="normalize-space(substring-after(marc:subfield[@code=$cnum_subfield],')'))"/> |
709 |
</xsl:when> |
710 |
<xsl:otherwise> |
711 |
<!-- consider whole subfield now as controlnumber --> |
712 |
<xsl:value-of select="normalize-space(marc:subfield[@code=$cnum_subfield])"/> |
713 |
</xsl:otherwise> |
714 |
</xsl:choose> |
715 |
</xsl:variable> |
716 |
<xsl:variable name="scriptname"> |
717 |
<xsl:choose> |
718 |
<xsl:when test="$opac_url=1"><xsl:text>/cgi-bin/koha/opac-search.pl</xsl:text></xsl:when> |
719 |
<xsl:otherwise><xsl:text>/cgi-bin/koha/catalogue/search.pl</xsl:text></xsl:otherwise> |
720 |
</xsl:choose> |
721 |
</xsl:variable> |
722 |
<xsl:choose> |
723 |
<!-- search for (1) controlnumber AND orgcode, or (2) only controlnumber, or (3) title --> |
724 |
<xsl:when test="$controlnumber!='' and $orgcode!=''"> |
725 |
<xsl:value-of select="str:encode-uri(concat($scriptname,'?q=Control-number:',$controlnumber,' and Control-number-identifier:',$orgcode),false())"/> |
726 |
</xsl:when> |
727 |
<xsl:when test="$controlnumber!=''"> |
728 |
<xsl:value-of select="str:encode-uri(concat($scriptname,'?q=Control-number:',$controlnumber),false())"/> |
729 |
</xsl:when> |
730 |
<xsl:otherwise> |
731 |
<xsl:value-of select="str:encode-uri(concat($scriptname,'?q=ti,phr:',translate(marc:subfield[@code=$title_subfield], '()', '')),false())"/> |
732 |
</xsl:otherwise> |
733 |
</xsl:choose> |
734 |
</xsl:template> |
735 |
|
688 |
</xsl:stylesheet> |
736 |
</xsl:stylesheet> |
689 |
|
737 |
|
690 |
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp. |
738 |
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp. |
691 |
- |
|
|