Lines 932-938
sub GetISBDView {
Link Here
|
932 |
return unless defined $record; |
932 |
return unless defined $record; |
933 |
my $itemtype = &GetFrameworkCode($biblionumber); |
933 |
my $itemtype = &GetFrameworkCode($biblionumber); |
934 |
my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype ); |
934 |
my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype ); |
935 |
my $tagslib = &GetMarcStructure( 1, $itemtype ); |
935 |
my $tagslib = &GetMarcStructure( 1, $itemtype, { unsafe => 1 } ); |
936 |
|
936 |
|
937 |
my $ISBD = C4::Context->preference($sysprefname); |
937 |
my $ISBD = C4::Context->preference($sysprefname); |
938 |
my $bloc = $ISBD; |
938 |
my $bloc = $ISBD; |
Lines 1109-1130
sub IsMarcStructureInternal {
Link Here
|
1109 |
|
1109 |
|
1110 |
=head2 GetMarcStructure |
1110 |
=head2 GetMarcStructure |
1111 |
|
1111 |
|
1112 |
$res = GetMarcStructure($forlibrarian,$frameworkcode); |
1112 |
$res = GetMarcStructure($forlibrarian, $frameworkcode, [ $params ]); |
1113 |
|
1113 |
|
1114 |
Returns a reference to a big hash of hash, with the Marc structure for the given frameworkcode |
1114 |
Returns a reference to a big hash of hash, with the Marc structure for the given frameworkcode |
1115 |
$forlibrarian :if set to 1, the MARC descriptions are the librarians ones, otherwise it's the public (OPAC) ones |
1115 |
$forlibrarian :if set to 1, the MARC descriptions are the librarians ones, otherwise it's the public (OPAC) ones |
1116 |
$frameworkcode : the framework code to read |
1116 |
$frameworkcode : the framework code to read |
1117 |
|
1117 |
|
|
|
1118 |
TODO: add 'unsafe' parameter description and a warnings: what kinds of operations |
1119 |
on the directly returned data structure are allowed / forbidden |
1120 |
(autovivification of $tagslib->{$tag}->{$subfield} etc. are OK, |
1121 |
but adding/removing/modifying any scalars in the "leafs" are strictly forbidden) |
1122 |
|
1118 |
=cut |
1123 |
=cut |
1119 |
|
1124 |
|
1120 |
sub GetMarcStructure { |
1125 |
sub GetMarcStructure { |
1121 |
my ( $forlibrarian, $frameworkcode ) = @_; |
1126 |
my ( $forlibrarian, $frameworkcode, $params ) = @_; |
1122 |
$frameworkcode = "" unless $frameworkcode; |
1127 |
$frameworkcode = "" unless $frameworkcode; |
1123 |
|
1128 |
|
1124 |
$forlibrarian = $forlibrarian ? 1 : 0; |
1129 |
$forlibrarian = $forlibrarian ? 1 : 0; |
|
|
1130 |
my $unsafe = ($params && $params->{unsafe})? 1: 0; |
1125 |
my $cache = Koha::Cache->get_instance(); |
1131 |
my $cache = Koha::Cache->get_instance(); |
1126 |
my $cache_key = "MarcStructure-$forlibrarian-$frameworkcode"; |
1132 |
my $cache_key = "MarcStructure-$forlibrarian-$frameworkcode"; |
1127 |
my $cached = $cache->get_from_cache($cache_key); |
1133 |
my $cached = $cache->get_from_cache($cache_key, { unsafe => $unsafe }); |
1128 |
return $cached if $cached; |
1134 |
return $cached if $cached; |
1129 |
|
1135 |
|
1130 |
my $dbh = C4::Context->dbh; |
1136 |
my $dbh = C4::Context->dbh; |
Lines 1937-1946
sub GetMarcAuthors {
Link Here
|
1937 |
} |
1943 |
} |
1938 |
my ( $mintag, $maxtag, $fields_filter ); |
1944 |
my ( $mintag, $maxtag, $fields_filter ); |
1939 |
|
1945 |
|
1940 |
# tagslib useful for UNIMARC author reponsabilities |
1946 |
# tagslib useful only for UNIMARC author responsibilities |
1941 |
my $tagslib = |
1947 |
my $tagslib; |
1942 |
&GetMarcStructure( 1, '' ); # FIXME : we don't have the framework available, we take the default framework. May be buggy on some setups, will be usually correct. |
|
|
1943 |
if ( $marcflavour eq "UNIMARC" ) { |
1948 |
if ( $marcflavour eq "UNIMARC" ) { |
|
|
1949 |
# FIXME : we don't have the framework available, we take the default framework. May be buggy on some setups, will be usually correct. |
1950 |
$tagslib = GetMarcStructure( 1, '', { unsafe => 1 }); |
1944 |
$mintag = "700"; |
1951 |
$mintag = "700"; |
1945 |
$maxtag = "712"; |
1952 |
$maxtag = "712"; |
1946 |
$fields_filter = '7..'; |
1953 |
$fields_filter = '7..'; |
Lines 3533-3539
sub get_biblio_authorised_values {
Link Here
|
3533 |
|
3540 |
|
3534 |
my $authorised_values; |
3541 |
my $authorised_values; |
3535 |
|
3542 |
|
3536 |
my $tagslib = GetMarcStructure( $forlibrarian, $frameworkcode ) |
3543 |
my $tagslib = GetMarcStructure( $forlibrarian, $frameworkcode, { unsafe => 1 }) |
3537 |
or return $authorised_values; |
3544 |
or return $authorised_values; |
3538 |
|
3545 |
|
3539 |
# assume that these entries in the authorised_value table are bibliolevel. |
3546 |
# assume that these entries in the authorised_value table are bibliolevel. |