Bugzilla – Attachment 5245 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]
Bug 6129 - [master] this adds an ISSN to serialssolutions URLs
Bug-6129---master-this-adds-an-ISSN-to-serialssolu.patch (text/plain), 7.76 KB, created by
Robin Sheat
on 2011-09-01 07:00:47 UTC
(
hide
)
Description:
Bug 6129 - [master] this adds an ISSN to serialssolutions URLs
Filename:
MIME Type:
Creator:
Robin Sheat
Created:
2011-09-01 07:00:47 UTC
Size:
7.76 KB
patch
obsolete
>From f7be35d2637adb550f499c65c8722eb316c4a796 Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Thu, 1 Sep 2011 18:57:20 +1200 >Subject: [PATCH] Bug 6129 - [master] this adds an ISSN to serialssolutions URLs > >If a URL is a serialssolutions URLs that doesn't already have an ISSN >parameter, this adds one on the OPAC. > >Author: Srdjan Jankovic <srdjan@catalyst.net.nz> >Author: Robin Sheat <robin@catalyst.net.nz> >--- > C4/Biblio.pm | 6 ++++-- > basket/basket.pl | 4 ++-- > catalogue/detail.pl | 10 ++++++++-- > .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 5 ++++- > opac/opac-basket.pl | 2 +- > opac/opac-detail.pl | 12 ++++++------ > 6 files changed, 25 insertions(+), 14 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 96baaef..ddae223 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1624,7 +1624,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) >@@ -1632,7 +1632,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') ) { >@@ -1642,6 +1642,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 8fc15e4..90c4cf8 100755 >--- a/basket/basket.pl >+++ b/basket/basket.pl >@@ -65,8 +65,8 @@ 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 @items = GetItemsInfo( $biblionumber ); >+ my $marcurlsarray = GetMarcUrls ($record,$marcflavour,$dat->{issn}); >+ my @items = GetItemsInfo( $biblionumber, 'opac' ); > > my $hasauthors = 0; > if($dat->{'author'} || @$marcauthorsarray) { >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 8738737..ac94cc0 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -99,12 +99,19 @@ $template->param( > normalized_isbn => $isbn, > ); > >+unless (defined($record)) { >+ print $query->redirect("/cgi-bin/koha/errors/404.pl"); >+ 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 +124,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 d4f763f..c8d8c3b 100755 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >@@ -436,6 +436,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"> >@@ -539,7 +540,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 e18e046..8511456 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -97,12 +97,12 @@ my $hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddeni > # Hide items > if ($hideitems) { > for my $itm (@all_items) { >- if ( C4::Context->preference('hidelostitems') ) { >- push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; >- } else { >- push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; >+ if ( C4::Context->preference('hidelostitems') ) { >+ push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems; >+ } else { >+ push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems; >+ } > } >-} > } else { > # Or not > @items = @all_items; >@@ -223,7 +223,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.7.4.1
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