"BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
GoogleJackets => C4::Context->preference("GoogleJackets"),
- OpenLibraryCovers => C4::Context->preference("OpenLibraryCovers"),
+ OpenLibraryCovers => C4::Context->preference("OpenLibraryCovers"),
KohaAdminEmailAddress => "" . C4::Context->preference("KohaAdminEmailAddress"),
LoginBranchcode => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
LoginFirstname => (C4::Context->userenv?C4::Context->userenv->{"firstname"}:"Bel"),
XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"),
XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"),
using_https => $in->{'query'}->https() ? 1 : 0,
- noItemTypeImages => C4::Context->preference("noItemTypeImages"),
+ noItemTypeImages => C4::Context->preference("noItemTypeImages"),
+ marcflavour => C4::Context->preference("marcflavour"),
);
if ( $in->{'type'} eq "intranet" ) {
&DelAuthority
&GetAuthority
&GetAuthorityXML
-
+
&CountUsage
&CountUsageChildren
&SearchAuthorities
- &BuildSummary
+ &BuildSummary
&BuildUnimarcHierarchies
&BuildUnimarcHierarchy
=head2 BuildSummary
- $text= &BuildSummary( $record, $authid, $authtypecode)
+ $summary= &BuildSummary( $record, $authid, $authtypecode)
-return HTML encoded Summary
+Returns a hashref with a summary of the specified record.
Comment : authtypecode can be infered from both record and authid.
Moreover, authid can also be inferred from $record.
=cut
-sub BuildSummary{
-## give this a Marc record to return summary
- my ($record,$authid,$authtypecode)=@_;
- my $dbh=C4::Context->dbh;
- my $summary;
- # handle $authtypecode is NULL or eq ""
- if ($authtypecode) {
- my $authref = GetAuthType($authtypecode);
- $summary = $authref->{summary};
- }
- # FIXME: should use I18N.pm
- my %language;
- $language{'fre'}="Français";
- $language{'eng'}="Anglais";
- $language{'ger'}="Allemand";
- $language{'ita'}="Italien";
- $language{'spa'}="Espagnol";
- my %thesaurus;
- $thesaurus{'1'}="Peuples";
- $thesaurus{'2'}="Anthroponymes";
- $thesaurus{'3'}="Oeuvres";
- $thesaurus{'4'}="Chronologie";
- $thesaurus{'5'}="Lieux";
- $thesaurus{'6'}="Sujets";
- #thesaurus a remplir
- my @fields = $record->fields();
- my $reported_tag;
- # if the library has a summary defined, use it. Otherwise, build a standard one
- # FIXME - it appears that the summary field in the authority frameworks
- # can work as a display template. However, this doesn't
- # suit the MARC21 version, so for now the "templating"
- # feature will be enabled only for UNIMARC for backwards
- # compatibility.
- if ($summary and C4::Context->preference('marcflavour') eq 'UNIMARC') {
- my @fields = $record->fields();
- # $reported_tag = '$9'.$result[$counter];
- my @stringssummary;
- foreach my $field (@fields) {
- my $tag = $field->tag();
- my $tagvalue = $field->as_string();
- my $localsummary= $summary;
- $localsummary =~ s/\[(.?.?.?.?)$tag\*(.*?)\]/$1$tagvalue$2\[$1$tag$2\]/g;
- if ($tag<10) {
- if ($tag eq '001') {
- $reported_tag.='$3'.$field->data();
- }
- } else {
- my @subf = $field->subfields;
- for my $i (0..$#subf) {
- my $subfieldcode = $subf[$i][0];
- my $subfieldvalue = $subf[$i][1];
- my $tagsubf = $tag.$subfieldcode;
- $localsummary =~ s/\[(.?.?.?.?)$tagsubf(.*?)\]/$1$subfieldvalue$2\[$1$tagsubf$2\]/g;
- }
- }
- push @stringssummary, $localsummary if ($localsummary ne $summary);
+sub BuildSummary {
+ ## give this a Marc record to return summary
+ my ($record,$authid,$authtypecode)=@_;
+ my $dbh=C4::Context->dbh;
+ my %summary;
+ # handle $authtypecode is NULL or eq ""
+ if ($authtypecode) {
+ my $authref = GetAuthType($authtypecode);
+ $summary{authtypecode} = $authref->{authtypecode};
+ $summary{type} = $authref->{authtypetext};
+ $summary{summary} = $authref->{summary};
}
- my $resultstring;
- $resultstring = join(" -- ",@stringssummary);
- $resultstring =~ s/\[(.*?)\]//g;
- $resultstring =~ s/\n/<br\/>/g;
- $summary = $resultstring;
- } else {
- my $heading = '';
- my $altheading = '';
- my $seealso = '';
- my $broaderterms = '';
- my $narrowerterms = '';
- my $see = '';
- my $seeheading = '';
- my $notes = '';
+ my $marc21subfields = 'abcdfghjklmnopqrstuvxyz';
+ my %marc21controlrefs = ( 'a' => 'earlier',
+ 'b' => 'later',
+ 'd' => 'acronym',
+ 'f' => 'musical',
+ 'g' => 'broader',
+ 'h' => 'narrower',
+ 'i' => 'subfi',
+ 't' => 'parent'
+ );
+ my %thesaurus;
+ $thesaurus{'1'}="Peuples";
+ $thesaurus{'2'}="Anthroponymes";
+ $thesaurus{'3'}="Oeuvres";
+ $thesaurus{'4'}="Chronologie";
+ $thesaurus{'5'}="Lieux";
+ $thesaurus{'6'}="Sujets";
+ #thesaurus a remplir
my @fields = $record->fields();
- if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
- # construct UNIMARC summary, that is quite different from MARC21 one
- # accepted form
- foreach my $field ($record->field('2..')) {
- $heading.= $field->as_string('abcdefghijlmnopqrstuvwxyz');
- }
- # rejected form(s)
- foreach my $field ($record->field('3..')) {
- $notes.= '<span class="note">'.$field->subfield('a')."</span>\n";
- }
- foreach my $field ($record->field('4..')) {
- if ($field->subfield('2')) {
- my $thesaurus = "thes. : ".$thesaurus{"$field->subfield('2')"}." : ";
- $see.= '<span class="UF">'.$thesaurus.$field->as_string('abcdefghijlmnopqrstuvwxyz')."</span> -- \n";
+ my $reported_tag;
+# if the library has a summary defined, use it. Otherwise, build a standard one
+# FIXME - it appears that the summary field in the authority frameworks
+# can work as a display template. However, this doesn't
+# suit the MARC21 version, so for now the "templating"
+# feature will be enabled only for UNIMARC for backwards
+# compatibility.
+ if ($summary{summary} and C4::Context->preference('marcflavour') eq 'UNIMARC') {
+ my @fields = $record->fields();
+# $reported_tag = '$9'.$result[$counter];
+ my @stringssummary;
+ foreach my $field (@fields) {
+ my $tag = $field->tag();
+ my $tagvalue = $field->as_string();
+ my $localsummary= $summary{summary};
+ $localsummary =~ s/\[(.?.?.?.?)$tag\*(.*?)\]/$1$tagvalue$2\[$1$tag$2\]/g;
+ if ($tag<10) {
+ if ($tag eq '001') {
+ $reported_tag.='$3'.$field->data();
+ }
+ } else {
+ my @subf = $field->subfields;
+ for my $i (0..$#subf) {
+ my $subfieldcode = $subf[$i][0];
+ my $subfieldvalue = $subf[$i][1];
+ my $tagsubf = $tag.$subfieldcode;
+ $localsummary =~ s/\[(.?.?.?.?)$tagsubf(.*?)\]/$1$subfieldvalue$2\[$1$tagsubf$2\]/g;
+ }
+ }
+ push @stringssummary, $localsummary if ($localsummary ne $summary{summary});
}
- }
- # see :
- foreach my $field ($record->field('5..')) {
-
- if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
- $broaderterms.= '<span class="BT"> '.$field->as_string('abcdefgjxyz')."</span> -- \n";
- } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
- $narrowerterms.= '<span class="NT">'.$field->as_string('abcdefgjxyz')."</span> -- \n";
- } elsif ($field->subfield('a')) {
- $seealso.= '<span class="RT">'.$field->as_string('abcdefgxyz')."</a></span> -- \n";
+ my $resultstring;
+ $resultstring = join(" -- ",@stringssummary);
+ $resultstring =~ s/\[(.*?)\]//g;
+ $resultstring =~ s/\n/<br>/g;
+ $summary{summary} = $resultstring;
+ } else {
+ my @authorized;
+ my @notes;
+ my @seefrom;
+ my @seealso;
+ my @otherscript;
+ my @fields = $record->fields();
+ if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
+# construct UNIMARC summary, that is quite different from MARC21 one
+# accepted form
+ foreach my $field ($record->field('2..')) {
+ push @authorized, $field->as_string('abcdefghijlmnopqrstuvwxyz');
+ }
+# rejected form(s)
+ foreach my $field ($record->field('3..')) {
+ push @notes, $field->subfield('a');
+ }
+ foreach my $field ($record->field('4..')) {
+ my $thesaurus = $field->subfield('2') ? "thes. : ".$thesaurus{"$field->subfield('2')"}." : " : '';
+ push @seefrom, { heading => $thesaurus . $field->as_string('abcdefghijlmnopqrstuvwxyz'), type => 'seefrom' };
+ }
+# see :
+ foreach my $field ($record->field('5..')) {
+ if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
+ push @seealso, { $field->as_string('abcdefgjxyz'), type => 'broader' };
+ } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
+ push @seealso, { heading => $field->as_string('abcdefgjxyz'), type => 'narrower' };
+ } elsif ($field->subfield('a')) {
+ push @seealso, { heading => $field->as_string('abcdefgxyz'), type => 'seealso' };
+ }
+ }
+# // form
+ foreach my $field ($record->field('7..')) {
+ my $lang = substr($field->subfield('8'),3,3);
+ push @otherscript, { lang => $lang, term => $field->subfield('a') };
+ }
+ } else {
+# construct MARC21 summary
+# FIXME - looping over 1XX is questionable
+# since MARC21 authority should have only one 1XX
+ foreach my $field ($record->field('1..')) {
+ my $tag = $field->tag();
+ next if "152" eq $tag;
+# FIXME - 152 is not a good tag to use
+# in MARC21 -- purely local tags really ought to be
+# 9XX
+ if ($tag eq '100') {
+ push @authorized, $field->as_string('abcdefghjklmnopqrstvxyz68');
+ } elsif ($tag eq '110') {
+ push @authorized, $field->as_string('abcdefghklmnoprstvxyz68');
+ } elsif ($tag eq '111') {
+ push @authorized, $field->as_string('acdefghklnpqstvxyz68');
+ } elsif ($tag eq '130') {
+ push @authorized, $field->as_string('adfghklmnoprstvxyz68');
+ } elsif ($tag eq '148') {
+ push @authorized, $field->as_string('abvxyz68');
+ } elsif ($tag eq '150') {
+ push @authorized, $field->as_string('abvxyz68');
+ } elsif ($tag eq '151') {
+ push @authorized, $field->as_string('avxyz68');
+ } elsif ($tag eq '155') {
+ push @authorized, $field->as_string('abvxyz68');
+ } elsif ($tag eq '180') {
+ push @authorized, $field->as_string('vxyz68');
+ } elsif ($tag eq '181') {
+ push @authorized, $field->as_string('vxyz68');
+ } elsif ($tag eq '182') {
+ push @authorized, $field->as_string('vxyz68');
+ } elsif ($tag eq '185') {
+ push @authorized, $field->as_string('vxyz68');
+ } else {
+ push @authorized, $field->as_string();
+ }
+ } #See From
+ foreach my $field ($record->field('4..')) {
+ my $type = 'seefrom';
+ $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w'));
+ if ($type eq 'subfi') {
+ push @seefrom, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') };
+ } else {
+ push @seefrom, { heading => $field->as_string($marc21subfields), type => $type };
+ }
+ } #See Also
+ foreach my $field ($record->field('5..')) {
+ my $type = 'seealso';
+ $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w'));
+ if ($type eq 'subfi') {
+ push @seealso, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') };
+ } else {
+ push @seealso, { heading => $field->as_string($marc21subfields), type => $type };
+ }
+ }
+ foreach my $field ($record->field('6..')) {
+ push @notes, $field->as_string();
+ }
}
- }
- # // form
- foreach my $field ($record->field('7..')) {
- my $lang = substr($field->subfield('8'),3,3);
- $seeheading.= '<span class="langue"> En '.$language{$lang}.' : </span><span class="OT"> '.$field->subfield('a')."</span><br />\n";
- }
- $broaderterms =~s/-- \n$//;
- $narrowerterms =~s/-- \n$//;
- $seealso =~s/-- \n$//;
- $see =~s/-- \n$//;
- $summary = $heading."<br />".($notes?"$notes <br />":"");
- $summary.= '<p><div class="label">TG : '.$broaderterms.'</div></p>' if ($broaderterms);
- $summary.= '<p><div class="label">TS : '.$narrowerterms.'</div></p>' if ($narrowerterms);
- $summary.= '<p><div class="label">TA : '.$seealso.'</div></p>' if ($seealso);
- $summary.= '<p><div class="label">EP : '.$see.'</div></p>' if ($see);
- $summary.= '<p><div class="label">'.$seeheading.'</div></p>' if ($seeheading);
- } else {
- # construct MARC21 summary
- # FIXME - looping over 1XX is questionable
- # since MARC21 authority should have only one 1XX
- foreach my $field ($record->field('1..')) {
- next if "152" eq $field->tag(); # FIXME - 152 is not a good tag to use
- # in MARC21 -- purely local tags really ought to be
- # 9XX
- if ($record->field('100')) {
- $heading.= $field->as_string('abcdefghjklmnopqrstvxyz68');
- } elsif ($record->field('110')) {
- $heading.= $field->as_string('abcdefghklmnoprstvxyz68');
- } elsif ($record->field('111')) {
- $heading.= $field->as_string('acdefghklnpqstvxyz68');
- } elsif ($record->field('130')) {
- $heading.= $field->as_string('adfghklmnoprstvxyz68');
- } elsif ($record->field('148')) {
- $heading.= $field->as_string('abvxyz68');
- } elsif ($record->field('150')) {
- $heading.= $field->as_string('abvxyz68');
- #$heading.= $field->as_formatted();
- my $tag=$field->tag();
- $heading=~s /^$tag//g;
- $heading =~s /\_/\$/g;
- } elsif ($record->field('151')) {
- $heading.= $field->as_string('avxyz68');
- } elsif ($record->field('155')) {
- $heading.= $field->as_string('abvxyz68');
- } elsif ($record->field('180')) {
- $heading.= $field->as_string('vxyz68');
- } elsif ($record->field('181')) {
- $heading.= $field->as_string('vxyz68');
- } elsif ($record->field('182')) {
- $heading.= $field->as_string('vxyz68');
- } elsif ($record->field('185')) {
- $heading.= $field->as_string('vxyz68');
- } else {
- $heading.= $field->as_string();
- }
- } #See From
- foreach my $field ($record->field('4..')) {
- $seeheading.= "<br /> <i>used for/see from:</i> ".$field->as_string();
- } #See Also
- foreach my $field ($record->field('5..')) {
- $altheading.= "<br /> <i>see also:</i> ".$field->as_string();
- }
- $summary .= ": " if $summary;
- $summary.=$heading.$seeheading.$altheading;
- }
- }
- return $summary;
+ $summary{authorized} = \@authorized;
+ $summary{notes} = \@notes;
+ $summary{seefrom} = \@seefrom;
+ $summary{seealso} = \@seealso;
+ $summary{otherscript} = \@otherscript;
+ }
+ return \%summary;
}
=head2 BuildUnimarcHierarchies
print "[";
my $i = 0;
- foreach (@$results) {
+ foreach my $result (@$results) {
if($i > 0){ print ","; }
- my ($value) = $_->{'summary'};
- # Removes new lines
- $value =~ s/<br \/>/ /g;
- $value =~ s/\n//g;
- $value = "{\"summary\":\"" . $value . "\"" . "}";
+ my $value = '';
+ my $authorized = $result->{'summary'}->{authorized};
+ foreach my $heading (@$authorized) {
+ $value .= $heading . ' ';
+ }
+ $value = "{\"summary\":\"" . $value . "\"" . "}";
print nsb_clean($value) . "\n";
$i++;
}
-print "]";
\ No newline at end of file
+print "]";
frameworkcode => $frameworkcode,
itemtype => $frameworkcode,
borrowernumber => $loggedinuser,
- marcflavour => C4::Context->preference("marcflavour"),
);
output_html_with_http_headers $input, $cookie, $template->output;
#header_search .ui-corner-top {
border-radius: 0 0 4px 4px;
}
+
+
+.authref {
+ text-indent: 2em;
+}
+
+.authref .label {
+ font-style: italic;
+}
--- /dev/null
+[% BLOCK showreference %]
+ [% IF marcflavour == 'UNIMARC' %]
+ [% SWITCH type %]
+ [% CASE 'broader' %]
+ <span class="BT">[% heading %]</span> --
+ [% CASE 'narrower' %]
+ <span class="NT">[% heading %]</span> --
+ [% CASE 'narrower' %]
+ <span class="NT">[% heading %]</span> --
+ [% CASE 'seefrom' %]
+ <span class="UF">[% heading %]</span> --
+ [% CASE 'seealso' %]
+ <span class="RT">[% heading %]</span> --
+ [% END %]
+ [% ELSE %]
+ [% IF ( label ) %]<span class="label">[% label %]</span>[% END %]
+ <span class="heading">[% heading %]</span>
+ [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% SWITCH type %]
+ [% CASE 'earlier' %](Earlier heading)
+ [% CASE 'later' %](Later heading)
+ [% CASE 'acronym' %](Acronym)
+ [% CASE 'musical' %](Musical composition)
+ [% CASE 'broader' %](Broader heading)
+ [% CASE 'narrower' %](Narrower heading)
+ [% CASE %]([% type %])
+ [% END %]</span>[% END %]
+ [% END %]
+[% END %]
+[% BLOCK authresult %]
+ [% IF ( summary.summary ) %][% summary.summary %]:[% END %]
+ [% UNLESS ( summary.summaryonly ) %]
+ [% FOREACH authorize IN summary.authorized %]
+ <span class="authorizedheading">[% authorize %]</span>
+ [% END %]
+ [% IF ( marcflavour == 'UNIMARC' ) %]
+ [% FOREACH note IN summary.notes %]
+ <span class="note">[% note %]</span>
+ [% END %]
+ [% FOREACH seefro IN summary.seefrom %]
+ [% PROCESS showreference heading=seefro.heading label="" type=seefro.type %]
+ [% END %]
+ [% ELSE %]
+ [% IF ( summary.seefrom ) %]
+ [% FOREACH seefro IN summary.seefrom %]
+ <div class="seefrom authref">
+ [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type %]
+ </div>
+ [% END %]
+ [% END %]
+ [% IF ( summary.seealso ) %]
+ [% FOREACH seeals IN summary.seealso %]
+ <div class="seealso authref">
+ [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type %]
+ </div>
+ [% END %]
+ [% END %]
+ [% END %]
+ [% END %]
+[% END %]
+[% PROCESS 'authorities-search-results.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Cataloging authority plugin</title>
[% INCLUDE 'doc-head-close.inc' %]
</tr>
[% FOREACH resul IN result %]
<tr>
- <td>[% resul.summary %]</td>
+ <td>[% PROCESS authresult summary=resul.summary %]</td>
<td>[% resul.used %] times</td>
<td>
[% IF resul.repets %]
+[% PROCESS 'authorities-search-results.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Authorities › Authority search results</title>
[% INCLUDE 'doc-head-close.inc' %]
[% ELSE %]
<tr>
[% END %]
- <td>[% resul.summary %]</td>
+ <td>[% PROCESS authresult summary=resul.summary %]</td>
<td><a href="detail.pl?authid=[% resul.authid %]">Details</a></td>
[% UNLESS ( resul.isEDITORS ) %]
<td>
+[% PROCESS 'authorities-search-results.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>UNIMARC field 210c builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</tr>
[% FOREACH resul IN result %]
<tr>
- <td>[% resul.summary %]</td>
+ <td>[% PROCESS authresult summary=resul.summary %]</td>
<td>[% resul.used %] times</td>
<td>
[% IF ( resul.to_report ) %]
color: #222222;
}
+.authref {
+ text-indent: 2em;
+}
+
+.authref .label {
+ font-style: italic;
+}
+
+
/* ## BABELTHEQUE ## */
/* Uncomment if babeltheque configuration no contains these lines */
/*
--- /dev/null
+[% BLOCK showreference %]
+ [% IF marcflavour == 'UNIMARC' %]
+ [% SWITCH type %]
+ [% CASE 'broader' %]
+ <span class="BT">[% heading %]</span> --
+ [% CASE 'narrower' %]
+ <span class="NT">[% heading %]</span> --
+ [% CASE 'narrower' %]
+ <span class="NT">[% heading %]</span> --
+ [% CASE 'seefrom' %]
+ <span class="UF">[% heading %]</span> --
+ [% CASE 'seealso' %]
+ <span class="RT">[% heading %]</span> --
+ [% END %]
+ [% ELSE %]
+ [% IF ( label ) %]<span class="label">[% label %]</span>[% END %]
+ <span class="heading">[% heading %]</span>
+ [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% SWITCH type %]
+ [% CASE 'earlier' %](Earlier heading)
+ [% CASE 'later' %](Later heading)
+ [% CASE 'acronym' %](Acronym)
+ [% CASE 'musical' %](Musical composition)
+ [% CASE 'broader' %](Broader heading)
+ [% CASE 'narrower' %](Narrower heading)
+ [% CASE %]([% type %])
+ [% END %]</span>[% END %]
+ [% END %]
+[% END %]
+[% BLOCK authresult %]
+ [% IF ( summary.summary ) %][% summary.summary %]:[% END %]
+ [% UNLESS ( summary.summaryonly ) %]
+ [% FOREACH authorize IN summary.authorized %]
+ <span class="authorizedheading">[% authorize %]</span>
+ [% END %]
+ [% IF ( marcflavour == 'UNIMARC' ) %]
+ [% FOREACH note IN summary.notes %]
+ <span class="note">[% note %]</span>
+ [% END %]
+ [% FOREACH seefro IN summary.seefrom %]
+ [% PROCESS showreference heading=seefro.heading label="" type=seefro.type %]
+ [% END %]
+ [% ELSE %]
+ [% IF ( summary.seefrom ) %]
+ [% FOREACH seefro IN summary.seefrom %]
+ <div class="seefrom authref">
+ [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type %]
+ </div>
+ [% END %]
+ [% END %]
+ [% IF ( summary.seealso ) %]
+ [% FOREACH seeals IN summary.seealso %]
+ <div class="seealso authref">
+ [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type %]
+ </div>
+ [% END %]
+ [% END %]
+ [% END %]
+ [% END %]
+[% END %]
--- /dev/null
+[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Entry
+[% INCLUDE 'doc-head-close.inc' %]
+[% IF ( displayhierarchy ) %]
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/hierarchy.css">
+<script language="JavaScript" type="text/javascript">
+function showParents(mynumber) {
+ var parents=document.getElementsByName(mynumber+'p')
+ for(i=0;i<parents.length;i++){
+ if (parents[i].style.display == "none") {
+ parents[i].style.display ="block";
+ } else {
+ parents[i].style.display ="none";
+ }
+ }
+}
+function showChildren(mynumber) {
+ var children=document.getElementsByName(mynumber+'c')
+ for(i=0;i<children.length;i++){
+ if (children[i].style.display == "none") {
+ children[i].style.display = "block";
+ } else {
+ children[i].style.display = "none";
+ }
+ }
+}
+</script>
+[% END %]
+</head>
+<body id="opac-authoritiesdetail">
+
+<div id="doc3" class="yui-t1">
+ <div id="bd">
+[% INCLUDE 'masthead.inc' %]
+ <div id="yui-main">
+ <div class="yui-b"><div class="yui-g">
+<div id="userauthdetails" class="container">
+
+[% IF ( displayhierarchy ) %]
+
+<div class="hierarchies">
+[% FOREACH loophierarchie IN loophierarchies %]
+ <div class="hierarchy">
+ [% FOREACH loopelemen IN loophierarchie.loopelement %]
+ <div id="[% loopelemen.loopauthid %]" class="[% loopelemen.class %]">
+ [% IF ( loopelemen.current_value ) %]
+ [% loopelemen.value %]
+ [% ELSE %]
+ <a href="opac-authoritiesdetail.pl?authid=[% loopelemen.loopauthid %]" title="Term">[% loopelemen.value %]</a>
+ [% END %]
+ [% IF ( loopelemen.ifchildren ) %]
+ <sub><a class="parents" title="Narrower terms" href="JavaScript:showChildren('[% loopelemen.loopauthid %]');">+</a></sub><br/>
+ [% FOREACH loopchildre IN loopelemen.loopchildren %]
+ <div name="[% loopchildre.loopauthid %]c" class="child"> <a href="opac-authoritiesdetail.pl?authid=[% loopchildre.childauthid %]">[% loopchildre.childvalue %]</a></div>
+ [% END %]
+ [% END %]
+ </div>
+ [% END %]
+
+ </div>
+[% END %]
+</div>
+[% END %]
+<h1>Entry [% authtypetext %]</h1>
+ <p>Used in <a href="opac-search.pl?type=opac&q=[% authid %]&idx=an,phr">[% count %] records</a></p>
+ [% FOREACH Tag0X IN Tab0XX %]
+ <p><b>[% Tag0X.tag %]</b></p>
+ <ul>
+ [% FOREACH subfiel IN Tag0X.subfield %]
+ <p><b>[% subfiel.marc_lib %]:</b>
+ [% IF subfiel.isurl %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value %]</a>
+ [% ELSE %][% subfiel.marc_value %][% END %]</p>
+ [% END %]
+ </ul>
+ [% END %]
+</div>
+
+</div>
+</div>
+</div>
+[% IF ( OpacNav ) %]
+<div class="yui-b">
+<div id="leftmenus" class="container">
+[% INCLUDE 'navigation.inc' %]
+</div>
+</div>[% END %]
+</div>
+[% INCLUDE 'opac-bottom.inc' %]
+++ /dev/null
-[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Entry
-[% INCLUDE 'doc-head-close.inc' %]
-[% IF ( displayhierarchy ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/hierarchy.css">
-<script language="JavaScript" type="text/javascript">
-function showParents(mynumber) {
- var parents=document.getElementsByName(mynumber+'p')
- for(i=0;i<parents.length;i++){
- if (parents[i].style.display == "none") {
- parents[i].style.display ="block";
- } else {
- parents[i].style.display ="none";
- }
- }
-}
-function showChildren(mynumber) {
- var children=document.getElementsByName(mynumber+'c')
- for(i=0;i<children.length;i++){
- if (children[i].style.display == "none") {
- children[i].style.display = "block";
- } else {
- children[i].style.display = "none";
- }
- }
-}
-</script>
-[% END %]
-</head>
-<body id="opac-authoritiesdetail">
-
-<div id="doc3" class="yui-t1">
- <div id="bd">
-[% INCLUDE 'masthead.inc' %]
- <div id="yui-main">
- <div class="yui-b"><div class="yui-g">
-<div id="userauthdetails" class="container">
-
-[% IF ( displayhierarchy ) %]
-
-<div class="hierarchies">
-[% FOREACH loophierarchie IN loophierarchies %]
- <div class="hierarchy">
- [% FOREACH loopelemen IN loophierarchie.loopelement %]
- <div id="[% loopelemen.loopauthid %]" class="[% loopelemen.class %]">
- [% IF ( loopelemen.current_value ) %]
- [% loopelemen.value %]
- [% ELSE %]
- <a href="opac-authoritiesdetail.pl?authid=[% loopelemen.loopauthid %]" title="Term">[% loopelemen.value %]</a>
- [% END %]
- [% IF ( loopelemen.ifchildren ) %]
- <sub><a class="parents" title="Narrower terms" href="JavaScript:showChildren('[% loopelemen.loopauthid %]');">+</a></sub><br/>
- [% FOREACH loopchildre IN loopelemen.loopchildren %]
- <div name="[% loopchildre.loopauthid %]c" class="child"> <a href="opac-authoritiesdetail.pl?authid=[% loopchildre.childauthid %]">[% loopchildre.childvalue %]</a></div>
- [% END %]
- [% END %]
- </div>
- [% END %]
-
- </div>
-[% END %]
-</div>
-[% END %]
-<h1>Entry [% authtypetext %]</h1>
- <p>Used in <a href="opac-search.pl?type=opac&q=[% authid %]&idx=an,phr">[% count %] records</a></p>
- [% FOREACH Tag0X IN Tab0XX %]
- <p><b>[% Tag0X.tag %]</b></p>
- <ul>
- [% FOREACH subfiel IN Tag0X.subfield %]
- <p><b>[% subfiel.marc_lib %]:</b> [% subfiel.marc_value %]</p>
- [% END %]
- </ul>
- [% END %]
-</div>
-
-</div>
-</div>
-</div>
-[% IF ( OpacNav ) %]
-<div class="yui-b">
-<div id="leftmenus" class="container">
-[% INCLUDE 'navigation.inc' %]
-</div>
-</div>[% END %]
-</div>
-[% INCLUDE 'opac-bottom.inc' %]
+[% PROCESS 'authorities-search-results.inc' %]
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › [% IF ( total ) %]Authority search result[% ELSE %]No results found[% END %]
[% INCLUDE 'doc-head-close.inc' %]
</head>
[% ELSE %]
<tr>
[% END %]
- <td>[% resul.summary %]</td>
-
- <td>
- [% authtypetext %]
- </td>
+ <td>[% PROCESS authresult summary=resul.summary %]</td>
+ <td>[% authtypetext %]</td>
[% UNLESS ( resul.isEDITORS ) %]
<td>
<a href="/cgi-bin/koha/opac-search.pl?type=opac&op=do_search&q=an=[% resul.authid %]">[% resul.used %] biblios</a>
my $dbh = C4::Context->dbh;
-my $authid = $query->param('authid');
-my $authtypecode = &GetAuthTypeCode( $authid );
-my $tagslib = &GetTagsLabels( 1, $authtypecode );
+my $display_hierarchy = C4::Context->preference("AuthDisplayHierarchy");
+my $show_marc = $query->param('marc') || 1; # Currently only MARC view is available
# open template
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
}
);
+my $authid = $query->param('authid');
+my $authtypecode = &GetAuthTypeCode( $authid );
+my $tagslib = &GetTagsLabels( 0, $authtypecode );
+
+
my $record;
-if (C4::Context->preference("AuthDisplayHierarchy")){
+if ($display_hierarchy){
my $trees=BuildUnimarcHierarchies($authid);
my @trees = split /;/,$trees ;
push @trees,$trees unless (@trees);
push @loophierarchies, { 'loopelement' =>\@loophierarchy};
}
$template->param(
- 'displayhierarchy' =>C4::Context->preference("AuthDisplayHierarchy"),
+ 'displayhierarchy' => $display_hierarchy,
'loophierarchies' =>\@loophierarchies,
);
}
my %subfield_data;
$subfield_data{marc_lib} =
$tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
- if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{isurl} ) {
- $subfield_data{marc_value} =
- "<a href=\"$subf[$i][1]\">$subf[$i][1]</a>";
- }
- else {
- $subfield_data{marc_value} = $subf[$i][1];
- }
$subfield_data{marc_subfield} = $subf[$i][0];
$subfield_data{marc_tag} = $field->tag();
+ $subfield_data{isurl} = $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{isurl};
+ $subfield_data{marc_value} = $subf[$i][1];
push( @subfields_data, \%subfield_data );
}
}
biblio_fields => $biblio_fields,
authtypetext => $authtypes->{$authtypecode}{'authtypetext'},
authtypesloop => \@authtypesloop,
- LibraryName => C4::Context->preference("LibraryName"),
- OpacNav => C4::Context->preference("OpacNav"),
- opaccredits => C4::Context->preference("opaccredits"),
- opacsmallimage => C4::Context->preference("opacsmallimage"),
- opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
- opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"),
);
output_html_with_http_headers $query, $cookie, $template->output;