From 60f4912512266d80173ab5232c0b707886d9d8b6 Mon Sep 17 00:00:00 2001 From: Srdjan Jankovic 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 @@ + @@ -534,7 +535,9 @@ Online Resources: - + + + ?sid=&ISSN= _blank 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