parameters:
biblionumber
+ MARC::Record of the bib
returns: a hashref malling the authorised value to the value set for this biblionumber
sub get_biblio_authorised_values {
my $biblionumber = shift;
+ my $record = shift;
my $forlibrarian = 1; # are we in staff or opac?
my $frameworkcode = GetFrameworkCode( $biblionumber );
my $authorised_values;
- my $record = GetMarcBiblio( $biblionumber )
- or return $authorised_values;
my $tagslib = GetMarcStructure( $forlibrarian, $frameworkcode )
or return $authorised_values;
# add imageurl to itemtype if there is one
$oldbiblio->{imageurl} = getitemtypeimagelocation( 'opac', $itemtypes{ $oldbiblio->{itemtype} }->{imageurl} );
- $oldbiblio->{'authorised_value_images'} = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $oldbiblio->{'biblionumber'} ) );
+ $oldbiblio->{'authorised_value_images'} = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $oldbiblio->{'biblionumber'}, $marcrecord ) );
(my $aisbn) = $oldbiblio->{isbn} =~ /([\d-]*[X]*)/;
$aisbn =~ s/-//g;
$oldbiblio->{amazonisbn} = $aisbn;
# XSLT processing of some stuff
if (C4::Context->preference("XSLTResultsDisplay") && !$scan) {
- my $newxmlrecord = XSLTParse4Display($oldbiblio->{biblionumber},C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACResults.xsl");
+ my $newxmlrecord = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACResults.xsl");
$oldbiblio->{XSLTResultsRecord} = $newxmlrecord;
}
=head1 transformMARCXML4XSLT
-=head2 replaces codes with authorized values in a MARCXML record
+=head2 replaces codes with authorized values in a MARC::Record object
=cut
sub transformMARCXML4XSLT {
- my ($biblionumber) = @_;
- my $record = GetMarcBiblio($biblionumber);
+ my ($biblionumber, $orig_record) = @_;
+ my $record = $orig_record->clone(); # not updating original record; this may be unnecessarily paranoid
my $biblio = GetBiblioData($biblionumber);
my $frameworkcode = GetFrameworkCode($biblionumber);
my $tagslib = &GetMarcStructure(1,$frameworkcode);
my $stylesheet;
sub XSLTParse4Display {
- my ($biblionumber,$xslfile) = @_;
+ my ($biblionumber, $orig_record, $xslfile) = @_;
# grab the XML, run it through our stylesheet, push it out to the browser
- my $record = transformMARCXML4XSLT($biblionumber);
+ my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
my $itemsxml = buildKohaItemsNamespace($biblionumber);
my $xmlrecord = $record->as_xml();
$xmlrecord =~ s/\<\/record\>/$itemsxml\<\/record\>/;
);
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
+my $record = GetMarcBiblio($biblionumber);
$template->param( biblionumber => $biblionumber );
# XSLT processing of some stuff
if (C4::Context->preference("XSLTDetailsDisplay") ) {
- my $newxmlrecord = XSLTParse4Display($biblionumber,C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACDetail.xsl");
+ my $newxmlrecord = XSLTParse4Display($biblionumber, $record, C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACDetail.xsl");
$template->param('XSLTBloc' => $newxmlrecord);
}
$dat->{'count'} = scalar(@items);
-my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber ) );
+my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
my $norequests = 1;
my $branches = GetBranches();
## get notes and subjects from MARC record
my $dbh = C4::Context->dbh;
my $marcflavour = C4::Context->preference("marcflavour");
-my $record = GetMarcBiblio($biblionumber);
my $marcnotesarray = GetMarcNotes ($record,$marcflavour);
my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);