Bugzilla – Attachment 3819 Details for
Bug 6129
ISSN url param for serialssolutions.com
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
0001-bug-6129-added-issn-to-serialsolutions-url.patch (text/plain), 7.13 KB, created by
Srdjan Jankovic
on 2011-04-08 03:39:15 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2011-04-08 03:39:15 UTC
Size:
7.13 KB
patch
obsolete
>From 60f4912512266d80173ab5232c0b707886d9d8b6 Mon Sep 17 00:00:00 2001 >From: Srdjan Jankovic <srdjan@catalyst.net.nz> >Date: Fri, 8 Apr 2011 15:35:46 +1200 >Subject: [PATCH] bug 6129: added issn to serialsolutions url > >--- > C4/Biblio.pm | 6 ++++-- > basket/basket.pl | 2 +- > catalogue/detail.pl | 5 +++-- > .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 5 ++++- > opac/opac-basket.pl | 2 +- > opac/opac-detail.pl | 8 +++++--- > 6 files changed, 18 insertions(+), 10 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 135dd91..7a2e18c 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1534,7 +1534,7 @@ sub GetMarcAuthors { > > =head2 GetMarcUrls > >- $marcurls = GetMarcUrls($record,$marcflavour); >+ $marcurls = GetMarcUrls($record,$marcflavour,$issn); > > Returns arrayref of URLs from MARC data, suitable to pass to tmpl loop. > Assumes web resources (not uncommon in MARC21 to omit resource type ind) >@@ -1542,7 +1542,7 @@ Assumes web resources (not uncommon in MARC21 to omit resource type ind) > =cut > > sub GetMarcUrls { >- my ( $record, $marcflavour ) = @_; >+ my ( $record, $marcflavour, $issn ) = @_; > > my @marcurls; > for my $field ( $record->field('856') ) { >@@ -1552,6 +1552,8 @@ sub GetMarcUrls { > } > my @urls = $field->subfield('u'); > foreach my $url (@urls) { >+ $url .= "?sid=&ISSN=$issn" >+ if $issn && ($url =~ m/\bserialssolutions\b/o) && ($url !~ m/\bISSN=/o); > my $marcurl; > if ( $marcflavour eq 'MARC21' ) { > my $s3 = $field->subfield('3'); >diff --git a/basket/basket.pl b/basket/basket.pl >index ed6e5a4..50caf61 100755 >--- a/basket/basket.pl >+++ b/basket/basket.pl >@@ -65,7 +65,7 @@ foreach my $biblionumber ( @bibs ) { > my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); > my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); > my $marcseriesarray = GetMarcSeries ($record,$marcflavour); >- my $marcurlsarray = GetMarcUrls ($record,$marcflavour); >+ my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); > my @items = &GetItemsInfo( $biblionumber, 'opac' ); > > my $hasauthors = 0; >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 21fcb1f..40ae381 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -98,12 +98,14 @@ unless (defined($record)) { > exit; > } > >+my $dat = &GetBiblioData($biblionumber); >+ > my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); > my $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); > my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); > my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); > my $marcseriesarray = GetMarcSeries($record,$marcflavour); >-my $marcurlsarray = GetMarcUrls ($record,$marcflavour); >+my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); > my $subtitle = GetRecordValue('subtitle', $record, $fw); > > # Get Branches, Itemtypes and Locations >@@ -117,7 +119,6 @@ my @items; > for my $itm (@all_items) { > push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems); > } >-my $dat = &GetBiblioData($biblionumber); > > # get count of holds > my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1); >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >index 369b74b..00f33a7 100755 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >@@ -431,6 +431,7 @@ > </xsl:for-each> > </span> > </xsl:if> >+ <xsl:variable name="issn"><xsl:if test="marc:datafield[@tag=022]"><xsl:value-of select="marc:datafield[@tag=022]/marc:subfield[@code='a']"/></xsl:if></xsl:variable> > > <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) --> > <xsl:if test="$display880"> >@@ -534,7 +535,9 @@ > <span class="results_summary"><span class="label">Online Resources: </span> > <xsl:for-each select="marc:datafield[@tag=856]"> > <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >- <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >+ <xsl:variable name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:variable> >+ <!-- <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/><xsl:if test="$issn and matches(marc:subfield[@code='u'], 'serialssolutions') and not matches(marc:subfield[@code='u'], 'ISSN')">?ISSN=<xsl:value-of select="$issn"/></xsl:if></xsl:attribute> --> >+ <a><xsl:attribute name="href"><xsl:value-of select="$href"/><xsl:if test="$issn and contains($href, 'serialssolutions') and not(contains($href, 'ISSN'))">?sid=&ISSN=<xsl:value-of select="$issn"/></xsl:if></xsl:attribute> > <xsl:if test="$OPACURLOpenInNewWindow='1'"> > <xsl:attribute name="target">_blank</xsl:attribute> > </xsl:if> >diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl >index 5e92d15..e56509e 100755 >--- a/opac/opac-basket.pl >+++ b/opac/opac-basket.pl >@@ -67,7 +67,7 @@ foreach my $biblionumber ( @bibs ) { > my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); > my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); > my $marcseriesarray = GetMarcSeries ($record,$marcflavour); >- my $marcurlsarray = GetMarcUrls ($record,$marcflavour); >+ my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); > my @items = &GetItemsLocationInfo( $biblionumber ); > my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); > >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index f230834..a39d9f7 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -86,14 +86,16 @@ $template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowChec > # change back when ive fixed request.pl > my @all_items = &GetItemsInfo( $biblionumber, 'opac' ); > my @items; >-@items = @all_items unless C4::Context->preference('hidelostitems'); >- > if (C4::Context->preference('hidelostitems')) { > # Hide host items > for my $itm (@all_items) { > push @items, $itm unless $itm->{itemlost}; > } > } >+else { >+ @items = @all_items; >+} >+ > my $dat = &GetBiblioData($biblionumber); > > my $itemtypes = GetItemTypes(); >@@ -209,7 +211,7 @@ my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); > my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); > my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); > my $marcseriesarray = GetMarcSeries ($record,$marcflavour); >-my $marcurlsarray = GetMarcUrls ($record,$marcflavour); >+my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); > my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); > > $template->param( >-- >1.6.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 6129
:
3819
|
5245
|
5246
|
5304
|
6916