From 53c7115345c079e0bfc4c27cb32a395d7c7434bc Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 23 Sep 2008 21:47:36 +0000 Subject: [PATCH] can now pass raw marcxml to the marc2html method and it will generate the html git-svn-id: svn://svn.open-ils.org/ILS/trunk@10691 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Search/Biblio.pm | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index a0f4491eae..07de45c9e7 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -1216,7 +1216,7 @@ my $slim_marc_sheet; my $settings_client = OpenSRF::Utils::SettingsClient->new(); sub biblio_record_to_marc_html { - my($self, $client, $recordid, $slim) = @_; + my($self, $client, $recordid, $slim, $marcxml) = @_; my $sheet; my $dir = $settings_client->config_value("dirs", "xsl"); @@ -1245,16 +1245,19 @@ sub biblio_record_to_marc_html { } my $record; - my $e = new_editor(); - if($self->api_name =~ /authority/) { - $record = $e->retrieve_authority_record_entry($recordid) - or return $e->event; - } else { - $record = $e->retrieve_biblio_record_entry($recordid) - or return $e->event; + unless($marcxml) { + my $e = new_editor(); + if($self->api_name =~ /authority/) { + $record = $e->retrieve_authority_record_entry($recordid) + or return $e->event; + } else { + $record = $e->retrieve_biblio_record_entry($recordid) + or return $e->event; + } + $marcxml = $record->marc; } - my $xmldoc = $parser->parse_string($record->marc); + my $xmldoc = $parser->parse_string($marcxml); my $html = $sheet->transform($xmldoc); return $html->documentElement->toString(); } -- 2.43.2