Lines 876-887
sub BuildSummary {
Link Here
|
876 |
my ($record,$authid,$authtypecode)=@_; |
876 |
my ($record,$authid,$authtypecode)=@_; |
877 |
my $dbh=C4::Context->dbh; |
877 |
my $dbh=C4::Context->dbh; |
878 |
my %summary; |
878 |
my %summary; |
|
|
879 |
my $summary_template; |
879 |
# handle $authtypecode is NULL or eq "" |
880 |
# handle $authtypecode is NULL or eq "" |
880 |
if ($authtypecode) { |
881 |
if ($authtypecode) { |
881 |
my $authref = GetAuthType($authtypecode); |
882 |
my $authref = GetAuthType($authtypecode); |
882 |
$summary{authtypecode} = $authref->{authtypecode}; |
883 |
$summary{authtypecode} = $authref->{authtypecode}; |
883 |
$summary{type} = $authref->{authtypetext}; |
884 |
$summary{type} = $authref->{authtypetext}; |
884 |
$summary{summary} = $authref->{summary}; |
885 |
$summary_template = $authref->{summary}; |
885 |
} |
886 |
} |
886 |
my $marc21subfields = 'abcdfghjklmnopqrstuvxyz68'; |
887 |
my $marc21subfields = 'abcdfghjklmnopqrstuvxyz68'; |
887 |
my %marc21controlrefs = ( 'a' => 'earlier', |
888 |
my %marc21controlrefs = ( 'a' => 'earlier', |
Lines 914-927
sub BuildSummary {
Link Here
|
914 |
# suit the MARC21 version, so for now the "templating" |
915 |
# suit the MARC21 version, so for now the "templating" |
915 |
# feature will be enabled only for UNIMARC for backwards |
916 |
# feature will be enabled only for UNIMARC for backwards |
916 |
# compatibility. |
917 |
# compatibility. |
917 |
if ($summary{summary} and C4::Context->preference('marcflavour') eq 'UNIMARC') { |
918 |
if ($summary_template and C4::Context->preference('marcflavour') eq 'UNIMARC') { |
918 |
my @fields = $record->fields(); |
919 |
my @fields = $record->fields(); |
919 |
# $reported_tag = '$9'.$result[$counter]; |
920 |
# $reported_tag = '$9'.$result[$counter]; |
920 |
my @stringssummary; |
921 |
my @repets; |
921 |
foreach my $field (@fields) { |
922 |
foreach my $field (@fields) { |
922 |
my $tag = $field->tag(); |
923 |
my $tag = $field->tag(); |
923 |
my $tagvalue = $field->as_string(); |
924 |
my $tagvalue = $field->as_string(); |
924 |
my $localsummary= $summary{summary}; |
925 |
my $localsummary= $summary_template; |
925 |
$localsummary =~ s/\[(.?.?.?.?)$tag\*(.*?)\]/$1$tagvalue$2\[$1$tag$2\]/g; |
926 |
$localsummary =~ s/\[(.?.?.?.?)$tag\*(.*?)\]/$1$tagvalue$2\[$1$tag$2\]/g; |
926 |
if ($tag<10) { |
927 |
if ($tag<10) { |
927 |
if ($tag eq '001') { |
928 |
if ($tag eq '001') { |
Lines 936-948
sub BuildSummary {
Link Here
|
936 |
$localsummary =~ s/\[(.?.?.?.?)$tagsubf(.*?)\]/$1$subfieldvalue$2\[$1$tagsubf$2\]/g; |
937 |
$localsummary =~ s/\[(.?.?.?.?)$tagsubf(.*?)\]/$1$subfieldvalue$2\[$1$tagsubf$2\]/g; |
937 |
} |
938 |
} |
938 |
} |
939 |
} |
939 |
push @stringssummary, $localsummary if ($localsummary ne $summary{summary}); |
940 |
if ($localsummary ne $summary_template) { |
|
|
941 |
$localsummary =~ s/\[(.*?)\]//g; |
942 |
$localsummary =~ s/\n/<br>/g; |
943 |
push @repets, $localsummary; |
944 |
} |
940 |
} |
945 |
} |
941 |
my $resultstring; |
946 |
$summary{repets} = \@repets; |
942 |
$resultstring = join(" -- ",@stringssummary); |
|
|
943 |
$resultstring =~ s/\[(.*?)\]//g; |
944 |
$resultstring =~ s/\n/<br>/g; |
945 |
$summary{summary} = $resultstring; |
946 |
} |
947 |
} |
947 |
my @authorized; |
948 |
my @authorized; |
948 |
my @notes; |
949 |
my @notes; |