From 8c981a7b7f6540ff78b070c11877be55b4248c62 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 14 Jan 2011 09:31:24 -0500 Subject: [PATCH] Fix for Bug 4885 - Only 1 ISBN shows in non-XSL detail view Fixed by doing a pretty dumb copy of GetMarcNotes. Functional, but it could be there is a more efficient way to do it given we want one repeating tag rather than a range of tags? Signed-off-by: Katrin Fischer - fixed small typo in opac-detail - corrected isbd punctuation in opac-detail - tested with 0, 1, 2, 3 isbns in 020, MARC21 Signed-off-by: Chris Nighswonger --- C4/Biblio.pm | 41 +++++++++++++++++++ catalogue/detail.pl | 2 + .../prog/en/modules/catalogue/detail.tmpl | 8 +++- .../prog/en/modules/opac-detail.tmpl | 8 +++- opac/opac-detail.pl | 2 + 5 files changed, 57 insertions(+), 4 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index a712ce742d..b0bdab05b5 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -68,6 +68,7 @@ BEGIN { &GetISBDView &GetMarcNotes + &GetMarcISBN &GetMarcSubjects &GetMarcBiblio &GetMarcAuthors @@ -1254,6 +1255,46 @@ sub GetAuthorisedValueDesc { } } +=head2 GetMarcISBN + + $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); + +Get all ISBNs from the MARC record and returns them in an array. +ISBNs stored in differents places depending on MARC flavour + +=cut + +sub GetMarcISBN { + my ( $record, $marcflavour ) = @_; + my $scope; + if ( $marcflavour eq "MARC21" ) { + $scope = '020'; + } else { # assume unimarc if not marc21 + $scope = '010'; + } + my @marcisbns; + my $isbn = ""; + my $tag = ""; + my $marcisbn; + foreach my $field ( $record->field($scope) ) { + my $value = $field->as_string(); + if ( $isbn ne "" ) { + $marcisbn = { marcisbn => $isbn, }; + push @marcisbns, $marcisbn; + $isbn = $value; + } + if ( $isbn ne $value ) { + $isbn = $isbn . " " . $value; + } + } + + if ($isbn) { + $marcisbn = { marcisbn => $isbn }; + push @marcisbns, $marcisbn; #load last tag into array + } + return \@marcisbns; +} # end GetMarcISBN + =head2 GetMarcNotes $marcnotesarray = GetMarcNotes( $record, $marcflavour ); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index e32170c8c8..6ee79e62ed 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -87,6 +87,7 @@ unless (defined($record)) { } 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); @@ -212,6 +213,7 @@ $template->param( MARCAUTHORS => $marcauthorsarray, MARCSERIES => $marcseriesarray, MARCURLS => $marcurlsarray, + MARCISBNS => $marcisbnsarray, subtitle => $subtitle, itemdata_ccode => $itemfields{ccode}, itemdata_enumchron => $itemfields{enumchron}, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl index d64227a3a6..6d878b3239 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -148,8 +148,12 @@ function verify_images() {
    - -
  • ISBN:
  • + +
  • ISBN:
  • + + +
  • ISBN:
  • +
  • ISSN:
  • diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index c1c8ca8976..b363ae1962 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -140,8 +140,12 @@ YAHOO.util.Event.onContentReady("furtherm", function () { Physical details: - - ISBN: + + ISBN:.; + + + ISBN: + ISSN: diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 05df7510ec..c2c77e1818 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -197,6 +197,7 @@ for my $itm (@items) { my $dbh = C4::Context->dbh; my $marcflavour = C4::Context->preference("marcflavour"); 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); @@ -209,6 +210,7 @@ my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib MARCAUTHORS => $marcauthorsarray, MARCSERIES => $marcseriesarray, MARCURLS => $marcurlsarray, + MARCISBNS => $marcisbnsarray, norequests => $norequests, RequestOnOpac => C4::Context->preference("RequestOnOpac"), itemdata_ccode => $itemfields{ccode}, -- 2.39.5