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