}
};
+use Memoize;
+memoize('GetMarcStructure');
+
=head1 NAME
C4::Biblio - cataloging management functions
=cut
+my $_auth_val;
+
sub GetAuthorisedValueDesc {
my ( $tag, $subfield, $value, $framework, $tagslib, $category, $opac ) = @_;
my $dbh = C4::Context->dbh;
}
if ( $category ne "" ) {
- my $sth = $dbh->prepare( "SELECT lib, lib_opac FROM authorised_values WHERE category = ? AND authorised_value = ?" );
- $sth->execute( $category, $value );
- my $data = $sth->fetchrow_hashref;
+
+ my $data;
+
+ if ( $data = $_auth_val->{$category}->{$value} ) {
+warn "XXX auth_val hit: $category $value\n";
+ } else {
+ my $sth = $dbh->prepare( "SELECT lib, lib_opac FROM authorised_values WHERE category = ? AND authorised_value = ?" );
+ $sth->execute( $category, $value );
+ $_auth_val->{$category}->{$value} = $data = $sth->fetchrow_hashref;
+ }
return ( $opac && $data->{'lib_opac'} ) ? $data->{'lib_opac'} : $data->{'lib'};
} else {
return $value; # if nothing is found return the original value
=cut
+our $_frameworkcode;
+
sub GetFrameworkCode {
my ($biblionumber) = @_;
+
+ my $frameworkcode;
+ if ( $frameworkcode = $_frameworkcode->{$biblionumber} ) {
+warn "# _frameworkcode hit $biblionumber\n";
+ return $frameworkcode;
+ }
+
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("SELECT frameworkcode FROM biblio WHERE biblionumber=?");
$sth->execute($biblionumber);
my ($frameworkcode) = $sth->fetchrow;
- return $frameworkcode;
+ return $_frameworkcode->{$biblionumber} = $frameworkcode;
}
=head2 TransformKohaToMarc