View | Details | Raw Unified | Return to bug 7943
Collapse All | Expand All

(-)a/C4/Auth.pm (-2 / +3 lines)
Lines 315-321 sub get_template_and_user { Link Here
315
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
315
            "BiblioDefaultView".C4::Context->preference("BiblioDefaultView")         => 1,
316
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
316
            EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'),
317
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
317
            GoogleJackets                => C4::Context->preference("GoogleJackets"),
318
	    OpenLibraryCovers            => C4::Context->preference("OpenLibraryCovers"),
318
            OpenLibraryCovers            => C4::Context->preference("OpenLibraryCovers"),
319
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
319
            KohaAdminEmailAddress        => "" . C4::Context->preference("KohaAdminEmailAddress"),
320
            LoginBranchcode              => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
320
            LoginBranchcode              => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
321
            LoginFirstname               => (C4::Context->userenv?C4::Context->userenv->{"firstname"}:"Bel"),
321
            LoginFirstname               => (C4::Context->userenv?C4::Context->userenv->{"firstname"}:"Bel"),
Lines 328-334 sub get_template_and_user { Link Here
328
            XSLTDetailsDisplay           => C4::Context->preference("XSLTDetailsDisplay"),
328
            XSLTDetailsDisplay           => C4::Context->preference("XSLTDetailsDisplay"),
329
            XSLTResultsDisplay           => C4::Context->preference("XSLTResultsDisplay"),
329
            XSLTResultsDisplay           => C4::Context->preference("XSLTResultsDisplay"),
330
            using_https                  => $in->{'query'}->https() ? 1 : 0,
330
            using_https                  => $in->{'query'}->https() ? 1 : 0,
331
            noItemTypeImages            => C4::Context->preference("noItemTypeImages"),
331
            noItemTypeImages             => C4::Context->preference("noItemTypeImages"),
332
            marcflavour                  => C4::Context->preference("marcflavour"),
332
    );
333
    );
333
334
334
    if ( $in->{'type'} eq "intranet" ) {
335
    if ( $in->{'type'} eq "intranet" ) {
(-)a/C4/AuthoritiesMarc.pm (-165 / +170 lines)
Lines 46-57 BEGIN { Link Here
46
    	&DelAuthority
46
    	&DelAuthority
47
    	&GetAuthority
47
    	&GetAuthority
48
    	&GetAuthorityXML
48
    	&GetAuthorityXML
49
    
49
50
    	&CountUsage
50
    	&CountUsage
51
    	&CountUsageChildren
51
    	&CountUsageChildren
52
    	&SearchAuthorities
52
    	&SearchAuthorities
53
    
53
    
54
    	&BuildSummary
54
        &BuildSummary
55
    	&BuildUnimarcHierarchies
55
    	&BuildUnimarcHierarchies
56
    	&BuildUnimarcHierarchy
56
    	&BuildUnimarcHierarchy
57
    
57
    
Lines 926-934 sub FindDuplicateAuthority { Link Here
926
926
927
=head2 BuildSummary
927
=head2 BuildSummary
928
928
929
  $text= &BuildSummary( $record, $authid, $authtypecode)
929
  $summary= &BuildSummary( $record, $authid, $authtypecode)
930
930
931
return HTML encoded Summary
931
Returns a hashref with a summary of the specified record.
932
932
933
Comment : authtypecode can be infered from both record and authid.
933
Comment : authtypecode can be infered from both record and authid.
934
Moreover, authid can also be inferred from $record.
934
Moreover, authid can also be inferred from $record.
Lines 936-1106 Would it be interesting to delete those things. Link Here
936
936
937
=cut
937
=cut
938
938
939
sub BuildSummary{
939
sub BuildSummary {
940
## give this a Marc record to return summary
940
    ## give this a Marc record to return summary
941
  my ($record,$authid,$authtypecode)=@_;
941
    my ($record,$authid,$authtypecode)=@_;
942
  my $dbh=C4::Context->dbh;
942
    my $dbh=C4::Context->dbh;
943
  my $summary;
943
    my %summary;
944
  # handle $authtypecode is NULL or eq ""
944
    # handle $authtypecode is NULL or eq ""
945
  if ($authtypecode) {
945
    if ($authtypecode) {
946
  	my $authref = GetAuthType($authtypecode);
946
        my $authref = GetAuthType($authtypecode);
947
  	$summary = $authref->{summary};
947
        $summary{authtypecode} = $authref->{authtypecode};
948
  }
948
        $summary{type} = $authref->{authtypetext};
949
  # FIXME: should use I18N.pm
949
        $summary{summary} = $authref->{summary};
950
  my %language;
951
  $language{'fre'}="Français";
952
  $language{'eng'}="Anglais";
953
  $language{'ger'}="Allemand";
954
  $language{'ita'}="Italien";
955
  $language{'spa'}="Espagnol";
956
  my %thesaurus;
957
  $thesaurus{'1'}="Peuples";
958
  $thesaurus{'2'}="Anthroponymes";
959
  $thesaurus{'3'}="Oeuvres";
960
  $thesaurus{'4'}="Chronologie";
961
  $thesaurus{'5'}="Lieux";
962
  $thesaurus{'6'}="Sujets";
963
  #thesaurus a remplir
964
  my @fields = $record->fields();
965
  my $reported_tag;
966
  # if the library has a summary defined, use it. Otherwise, build a standard one
967
  # FIXME - it appears that the summary field in the authority frameworks
968
  #         can work as a display template.  However, this doesn't
969
  #         suit the MARC21 version, so for now the "templating"
970
  #         feature will be enabled only for UNIMARC for backwards
971
  #         compatibility.
972
  if ($summary and C4::Context->preference('marcflavour') eq 'UNIMARC') {
973
    my @fields = $record->fields();
974
    #             $reported_tag = '$9'.$result[$counter];
975
	my @stringssummary;
976
    foreach my $field (@fields) {
977
      my $tag = $field->tag();
978
      my $tagvalue = $field->as_string();
979
      my $localsummary= $summary;
980
	  $localsummary =~ s/\[(.?.?.?.?)$tag\*(.*?)\]/$1$tagvalue$2\[$1$tag$2\]/g;
981
      if ($tag<10) {
982
        if ($tag eq '001') {
983
          $reported_tag.='$3'.$field->data();
984
        }
985
      } else {
986
        my @subf = $field->subfields;
987
        for my $i (0..$#subf) {
988
          my $subfieldcode = $subf[$i][0];
989
          my $subfieldvalue = $subf[$i][1];
990
          my $tagsubf = $tag.$subfieldcode;
991
          $localsummary =~ s/\[(.?.?.?.?)$tagsubf(.*?)\]/$1$subfieldvalue$2\[$1$tagsubf$2\]/g;
992
        }
993
      }
994
	  push @stringssummary, $localsummary if ($localsummary ne $summary);
995
    }
950
    }
996
	my $resultstring;
951
    my $marc21subfields = 'abcdfghjklmnopqrstuvxyz';
997
	$resultstring = join(" -- ",@stringssummary);
952
    my %marc21controlrefs = ( 'a' => 'earlier',
998
    $resultstring =~ s/\[(.*?)\]//g;
953
        'b' => 'later',
999
    $resultstring =~ s/\n/<br\/>/g;
954
        'd' => 'acronym',
1000
	$summary      =  $resultstring;
955
        'f' => 'musical',
1001
  } else {
956
        'g' => 'broader',
1002
    my $heading = '';
957
        'h' => 'narrower',
1003
    my $altheading = '';
958
        'i' => 'subfi',
1004
    my $seealso = '';
959
        't' => 'parent'
1005
    my $broaderterms = '';
960
    );
1006
    my $narrowerterms = '';
961
    my %thesaurus;
1007
    my $see = '';
962
    $thesaurus{'1'}="Peuples";
1008
    my $seeheading = '';
963
    $thesaurus{'2'}="Anthroponymes";
1009
    my $notes = '';
964
    $thesaurus{'3'}="Oeuvres";
965
    $thesaurus{'4'}="Chronologie";
966
    $thesaurus{'5'}="Lieux";
967
    $thesaurus{'6'}="Sujets";
968
    #thesaurus a remplir
1010
    my @fields = $record->fields();
969
    my @fields = $record->fields();
1011
    if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
970
    my $reported_tag;
1012
    # construct UNIMARC summary, that is quite different from MARC21 one
971
# if the library has a summary defined, use it. Otherwise, build a standard one
1013
      # accepted form
972
# FIXME - it appears that the summary field in the authority frameworks
1014
      foreach my $field ($record->field('2..')) {
973
#         can work as a display template.  However, this doesn't
1015
        $heading.= $field->as_string('abcdefghijlmnopqrstuvwxyz');
974
#         suit the MARC21 version, so for now the "templating"
1016
      }
975
#         feature will be enabled only for UNIMARC for backwards
1017
      # rejected form(s)
976
#         compatibility.
1018
      foreach my $field ($record->field('3..')) {
977
    if ($summary{summary} and C4::Context->preference('marcflavour') eq 'UNIMARC') {
1019
        $notes.= '<span class="note">'.$field->subfield('a')."</span>\n";
978
        my @fields = $record->fields();
1020
      }
979
#             $reported_tag = '$9'.$result[$counter];
1021
      foreach my $field ($record->field('4..')) {
980
        my @stringssummary;
1022
        if ($field->subfield('2')) {
981
        foreach my $field (@fields) {
1023
            my $thesaurus = "thes. : ".$thesaurus{"$field->subfield('2')"}." : ";
982
            my $tag = $field->tag();
1024
            $see.= '<span class="UF">'.$thesaurus.$field->as_string('abcdefghijlmnopqrstuvwxyz')."</span> -- \n";
983
            my $tagvalue = $field->as_string();
984
            my $localsummary= $summary{summary};
985
            $localsummary =~ s/\[(.?.?.?.?)$tag\*(.*?)\]/$1$tagvalue$2\[$1$tag$2\]/g;
986
            if ($tag<10) {
987
                if ($tag eq '001') {
988
                    $reported_tag.='$3'.$field->data();
989
                }
990
            } else {
991
                my @subf = $field->subfields;
992
                for my $i (0..$#subf) {
993
                    my $subfieldcode = $subf[$i][0];
994
                    my $subfieldvalue = $subf[$i][1];
995
                    my $tagsubf = $tag.$subfieldcode;
996
                    $localsummary =~ s/\[(.?.?.?.?)$tagsubf(.*?)\]/$1$subfieldvalue$2\[$1$tagsubf$2\]/g;
997
                }
998
            }
999
            push @stringssummary, $localsummary if ($localsummary ne $summary{summary});
1025
        }
1000
        }
1026
      }
1001
        my $resultstring;
1027
      # see :
1002
        $resultstring = join(" -- ",@stringssummary);
1028
      foreach my $field ($record->field('5..')) {
1003
        $resultstring =~ s/\[(.*?)\]//g;
1029
            
1004
        $resultstring =~ s/\n/<br>/g;
1030
        if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
1005
        $summary{summary}      =  $resultstring;
1031
          $broaderterms.= '<span class="BT"> '.$field->as_string('abcdefgjxyz')."</span> -- \n";
1006
    } else {
1032
        } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
1007
        my @authorized;
1033
          $narrowerterms.= '<span class="NT">'.$field->as_string('abcdefgjxyz')."</span> -- \n";
1008
        my @notes;
1034
        } elsif ($field->subfield('a')) {
1009
        my @seefrom;
1035
          $seealso.= '<span class="RT">'.$field->as_string('abcdefgxyz')."</a></span> -- \n";
1010
        my @seealso;
1011
        my @otherscript;
1012
        my @fields = $record->fields();
1013
        if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
1014
# construct UNIMARC summary, that is quite different from MARC21 one
1015
# accepted form
1016
            foreach my $field ($record->field('2..')) {
1017
                push @authorized, $field->as_string('abcdefghijlmnopqrstuvwxyz');
1018
            }
1019
# rejected form(s)
1020
            foreach my $field ($record->field('3..')) {
1021
                push @notes, $field->subfield('a');
1022
            }
1023
            foreach my $field ($record->field('4..')) {
1024
                my $thesaurus = $field->subfield('2') ? "thes. : ".$thesaurus{"$field->subfield('2')"}." : " : '';
1025
                push @seefrom, { heading => $thesaurus . $field->as_string('abcdefghijlmnopqrstuvwxyz'), type => 'seefrom' };
1026
            }
1027
# see :
1028
            foreach my $field ($record->field('5..')) {
1029
                if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
1030
                    push @seealso, { $field->as_string('abcdefgjxyz'), type => 'broader' };
1031
                } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
1032
                    push @seealso, { heading => $field->as_string('abcdefgjxyz'), type => 'narrower' };
1033
                } elsif ($field->subfield('a')) {
1034
                    push @seealso, { heading => $field->as_string('abcdefgxyz'), type => 'seealso' };
1035
                }
1036
            }
1037
# // form
1038
            foreach my $field ($record->field('7..')) {
1039
                my $lang = substr($field->subfield('8'),3,3);
1040
                push @otherscript, { lang => $lang, term => $field->subfield('a') };
1041
            }
1042
        } else {
1043
# construct MARC21 summary
1044
# FIXME - looping over 1XX is questionable
1045
# since MARC21 authority should have only one 1XX
1046
            foreach my $field ($record->field('1..')) {
1047
                my $tag = $field->tag();
1048
                next if "152" eq $tag;
1049
# FIXME - 152 is not a good tag to use
1050
# in MARC21 -- purely local tags really ought to be
1051
# 9XX
1052
                if ($tag eq '100') {
1053
                    push @authorized, $field->as_string('abcdefghjklmnopqrstvxyz68');
1054
                } elsif ($tag eq '110') {
1055
                    push @authorized, $field->as_string('abcdefghklmnoprstvxyz68');
1056
                } elsif ($tag eq '111') {
1057
                    push @authorized, $field->as_string('acdefghklnpqstvxyz68');
1058
                } elsif ($tag eq '130') {
1059
                    push @authorized, $field->as_string('adfghklmnoprstvxyz68');
1060
                } elsif ($tag eq '148') {
1061
                    push @authorized, $field->as_string('abvxyz68');
1062
                } elsif ($tag eq '150') {
1063
                    push @authorized, $field->as_string('abvxyz68');
1064
                } elsif ($tag eq '151') {
1065
                    push @authorized, $field->as_string('avxyz68');
1066
                } elsif ($tag eq '155') {
1067
                    push @authorized, $field->as_string('abvxyz68');
1068
                } elsif ($tag eq '180') {
1069
                    push @authorized, $field->as_string('vxyz68');
1070
                } elsif ($tag eq '181') {
1071
                    push @authorized, $field->as_string('vxyz68');
1072
                } elsif ($tag eq '182') {
1073
                    push @authorized, $field->as_string('vxyz68');
1074
                } elsif ($tag eq '185') {
1075
                    push @authorized, $field->as_string('vxyz68');
1076
                } else {
1077
                    push @authorized, $field->as_string();
1078
                }
1079
            } #See From
1080
            foreach my $field ($record->field('4..')) {
1081
                my $type = 'seefrom';
1082
                $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w'));
1083
                if ($type eq 'subfi') {
1084
                    push @seefrom, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') };
1085
                } else {
1086
                    push @seefrom, { heading => $field->as_string($marc21subfields), type => $type };
1087
                }
1088
            } #See Also
1089
            foreach my $field ($record->field('5..')) {
1090
                my $type = 'seealso';
1091
                $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w'));
1092
                if ($type eq 'subfi') {
1093
                    push @seealso, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') };
1094
                } else {
1095
                    push @seealso, { heading => $field->as_string($marc21subfields), type => $type };
1096
                }
1097
            }
1098
            foreach my $field ($record->field('6..')) {
1099
                push @notes, $field->as_string();
1100
            }
1036
        }
1101
        }
1037
      }
1102
        $summary{authorized} = \@authorized;
1038
      # // form
1103
        $summary{notes} = \@notes;
1039
      foreach my $field ($record->field('7..')) {
1104
        $summary{seefrom} = \@seefrom;
1040
        my $lang = substr($field->subfield('8'),3,3);
1105
        $summary{seealso} = \@seealso;
1041
        $seeheading.= '<span class="langue"> En '.$language{$lang}.' : </span><span class="OT"> '.$field->subfield('a')."</span><br />\n";  
1106
        $summary{otherscript} = \@otherscript;
1042
      }
1107
    }
1043
            $broaderterms =~s/-- \n$//;
1108
    return \%summary;
1044
            $narrowerterms =~s/-- \n$//;
1045
            $seealso =~s/-- \n$//;
1046
            $see =~s/-- \n$//;
1047
      $summary = $heading."<br />".($notes?"$notes <br />":"");
1048
      $summary.= '<p><div class="label">TG : '.$broaderterms.'</div></p>' if ($broaderterms);
1049
      $summary.= '<p><div class="label">TS : '.$narrowerterms.'</div></p>' if ($narrowerterms);
1050
      $summary.= '<p><div class="label">TA : '.$seealso.'</div></p>' if ($seealso);
1051
      $summary.= '<p><div class="label">EP : '.$see.'</div></p>' if ($see);
1052
      $summary.= '<p><div class="label">'.$seeheading.'</div></p>' if ($seeheading);
1053
      } else {
1054
      # construct MARC21 summary
1055
          # FIXME - looping over 1XX is questionable
1056
          # since MARC21 authority should have only one 1XX
1057
          foreach my $field ($record->field('1..')) {
1058
              next if "152" eq $field->tag(); # FIXME - 152 is not a good tag to use
1059
                                              # in MARC21 -- purely local tags really ought to be
1060
                                              # 9XX
1061
              if ($record->field('100')) {
1062
                  $heading.= $field->as_string('abcdefghjklmnopqrstvxyz68');
1063
              } elsif ($record->field('110')) {
1064
                                      $heading.= $field->as_string('abcdefghklmnoprstvxyz68');
1065
              } elsif ($record->field('111')) {
1066
                                      $heading.= $field->as_string('acdefghklnpqstvxyz68');
1067
              } elsif ($record->field('130')) {
1068
                                      $heading.= $field->as_string('adfghklmnoprstvxyz68');
1069
              } elsif ($record->field('148')) {
1070
                                      $heading.= $field->as_string('abvxyz68');
1071
              } elsif ($record->field('150')) {
1072
                  $heading.= $field->as_string('abvxyz68');
1073
              #$heading.= $field->as_formatted();
1074
              my $tag=$field->tag();
1075
              $heading=~s /^$tag//g;
1076
              $heading =~s /\_/\$/g;
1077
              } elsif ($record->field('151')) {
1078
                                      $heading.= $field->as_string('avxyz68');
1079
              } elsif ($record->field('155')) {
1080
                                      $heading.= $field->as_string('abvxyz68');
1081
              } elsif ($record->field('180')) {
1082
                                      $heading.= $field->as_string('vxyz68');
1083
              } elsif ($record->field('181')) {
1084
                                      $heading.= $field->as_string('vxyz68');
1085
              } elsif ($record->field('182')) {
1086
                                      $heading.= $field->as_string('vxyz68');
1087
              } elsif ($record->field('185')) {
1088
                                      $heading.= $field->as_string('vxyz68');
1089
              } else {
1090
                  $heading.= $field->as_string();
1091
              }
1092
          } #See From
1093
          foreach my $field ($record->field('4..')) {
1094
              $seeheading.= "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>used for/see from:</i> ".$field->as_string();
1095
          } #See Also
1096
          foreach my $field ($record->field('5..')) {
1097
              $altheading.= "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see also:</i> ".$field->as_string();
1098
          }
1099
          $summary .= ": " if $summary;
1100
          $summary.=$heading.$seeheading.$altheading;
1101
      }
1102
  }
1103
  return $summary;
1104
}
1109
}
1105
1110
1106
=head2 BuildUnimarcHierarchies
1111
=head2 BuildUnimarcHierarchies
(-)a/authorities/ysearch.pl (-3 / +7 lines)
Lines 62-71 if ( $auth_status ne "ok" ) { Link Here
62
    my $startfrom = 0;
62
    my $startfrom = 0;
63
63
64
    my ( $results, $total ) = SearchAuthorities( \@marclist, \@and_or, \@excluding, \@operator, \@value, $startfrom * $resultsperpage, $resultsperpage, $authtypecode, $orderby );
64
    my ( $results, $total ) = SearchAuthorities( \@marclist, \@and_or, \@excluding, \@operator, \@value, $startfrom * $resultsperpage, $resultsperpage, $authtypecode, $orderby );
65
    foreach (@$results) {
65
    foreach my $result (@$results) {
66
	my ($value) = $_->{'summary'};
66
        my $value = '';
67
        my $authorized = $result->{'summary'}->{authorized};
68
        foreach my $heading (@$authorized) {
69
            $value .= $heading . ' ';
70
        }
67
        # Removes new lines
71
        # Removes new lines
68
        $value =~ s/<br \/>/ /g;
72
        $value =~ s/<br \/>/ /g;
69
        $value =~ s/\n//g;
73
        $value =~ s/\n//g;
70
	print nsb_clean($value) . "\n";
74
        print nsb_clean($value) . "\n";
71
    }
75
    }
(-)a/cataloguing/addbiblio.pl (-1 lines)
Lines 984-990 $template->param( Link Here
984
    frameworkcode => $frameworkcode,
984
    frameworkcode => $frameworkcode,
985
    itemtype => $frameworkcode,
985
    itemtype => $frameworkcode,
986
    borrowernumber => $loggedinuser, 
986
    borrowernumber => $loggedinuser, 
987
    marcflavour => C4::Context->preference("marcflavour"),
988
);
987
);
989
988
990
output_html_with_http_headers $input, $cookie, $template->output;
989
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (+9 lines)
Lines 2236-2238 div#acqui_order_supplierlist > div.supplier > span.action { Link Here
2236
div#acqui_order_supplierlist > div.supplier > div.baskets {
2236
div#acqui_order_supplierlist > div.supplier > div.baskets {
2237
    margin-top: 0.5em;
2237
    margin-top: 0.5em;
2238
}
2238
}
2239
2240
2241
.authref {
2242
    text-indent: 2em;
2243
}
2244
2245
.authref .label {
2246
    font-style: italic;
2247
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc (+59 lines)
Line 0 Link Here
1
[% BLOCK showreference %]
2
    [% IF marcflavour == 'UNIMARC' %]
3
        [% SWITCH type %]
4
        [% CASE 'broader' %]
5
            <span class="BT">[% heading %]</span> --
6
        [% CASE 'narrower' %]
7
            <span class="NT">[% heading %]</span> --
8
        [% CASE 'narrower' %]
9
            <span class="NT">[% heading %]</span> --
10
        [% CASE 'seefrom' %]
11
            <span class="UF">[% heading %]</span> --
12
        [% CASE 'seealso' %]
13
            <span class="RT">[% heading %]</span> --
14
        [% END %]
15
    [% ELSE %]
16
        [% IF ( label ) %]<span class="label">[% label %]</span>[% END %]
17
        <span class="heading">[% heading %]</span>
18
        [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% SWITCH type %]
19
        [% CASE 'earlier' %](Earlier heading)
20
        [% CASE 'later' %](Later heading)
21
        [% CASE 'acronym' %](Acronym)
22
        [% CASE 'musical' %](Musical composition)
23
        [% CASE 'broader' %](Broader heading)
24
        [% CASE 'narrower' %](Narrower heading)
25
        [% CASE %]([% type %])
26
        [% END %]</span>[% END %]
27
    [% END %]
28
[% END %]
29
[% BLOCK authresult %]
30
    [% IF ( summary.summary ) %][% summary.summary %]:[% END %]
31
    [% UNLESS ( summary.summaryonly ) %]
32
        [% FOREACH authorize IN summary.authorized %]
33
            <span class="authorizedheading">[% authorize %]</span>
34
        [% END %]
35
        [% IF ( marcflavour == 'UNIMARC' ) %]
36
            [% FOREACH note IN summary.notes %]
37
                <span class="note">[% note %]</span>
38
            [% END %]
39
            [% FOREACH seefro IN summary.seefrom %]
40
                [% PROCESS showreference heading=seefro.heading label="" type=seefro.type %]
41
            [% END %]
42
        [% ELSE %]
43
            [% IF ( summary.seefrom ) %]
44
                [% FOREACH seefro IN summary.seefrom %]
45
                    <div class="seefrom authref">
46
                    [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type %]
47
                    </div>
48
                [% END %]
49
            [% END %]
50
            [% IF ( summary.seealso ) %]
51
                [% FOREACH seeals IN summary.seealso %]
52
                    <div class="seealso authref">
53
                    [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type %]
54
                    </div>
55
                [% END %]
56
            [% END %]
57
        [% END %]
58
    [% END %]
59
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt (-1 / +2 lines)
Lines 1-3 Link Here
1
[% PROCESS 'authorities-search-results.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Cataloging authority plugin</title>
3
<title>Koha &rsaquo; Cataloging authority plugin</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 67-73 function jumpfull(page) Link Here
67
                </tr>
68
                </tr>
68
                [% FOREACH resul IN result %]
69
                [% FOREACH resul IN result %]
69
                    <tr>
70
                    <tr>
70
                        <td>[% resul.summary %]</td>
71
                        <td>[% PROCESS authresult summary=resul.summary %]</td>
71
                        <td>[% resul.used %] times</td>
72
                        <td>[% resul.used %] times</td>
72
                        <td>
73
                        <td>
73
                          [% IF resul.repets %]
74
                          [% IF resul.repets %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-1 / +2 lines)
Lines 1-3 Link Here
1
[% PROCESS 'authorities-search-results.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Authorities &rsaquo; Authority search results</title>
3
<title>Koha &rsaquo; Authorities &rsaquo; Authority search results</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 63-69 function searchauthority() { Link Here
63
    [% ELSE %]
64
    [% ELSE %]
64
    <tr>
65
    <tr>
65
    [% END %]
66
    [% END %]
66
      <td>[% resul.summary %]</td>
67
      <td>[% PROCESS authresult summary=resul.summary %]</td>
67
      <td><a href="detail.pl?authid=[% resul.authid %]">Details</a></td>
68
      <td><a href="detail.pl?authid=[% resul.authid %]">Details</a></td>
68
  [% UNLESS ( resul.isEDITORS ) %]
69
  [% UNLESS ( resul.isEDITORS ) %]
69
      <td>
70
      <td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt (-1 / +2 lines)
Lines 1-3 Link Here
1
[% PROCESS 'authorities-search-results.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>UNIMARC field 210c builder</title>
3
<title>UNIMARC field 210c builder</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 59-65 Link Here
59
                </tr>
60
                </tr>
60
                [% FOREACH resul IN result %]
61
                [% FOREACH resul IN result %]
61
                    <tr>
62
                    <tr>
62
                        <td>[% resul.summary %]</td>
63
                        <td>[% PROCESS authresult summary=resul.summary %]</td>
63
                        <td>[% resul.used %] times</td>
64
                        <td>[% resul.used %] times</td>
64
                        <td>
65
                        <td>
65
                [% IF ( resul.to_report ) %]
66
                [% IF ( resul.to_report ) %]
(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (+9 lines)
Lines 2371-2376 span.sep { Link Here
2371
	text-shadow: 1px 1px 0 #FFF;
2371
	text-shadow: 1px 1px 0 #FFF;
2372
}
2372
}
2373
2373
2374
.authref {
2375
    text-indent: 2em;
2376
}
2377
2378
.authref .label {
2379
 font-style: italic;
2380
}
2381
2382
2374
/* ## BABELTHEQUE ## */
2383
/* ## BABELTHEQUE ## */
2375
/* Uncomment if babeltheque configuration no contains these lines */
2384
/* Uncomment if babeltheque configuration no contains these lines */
2376
/*
2385
/*
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc (+59 lines)
Line 0 Link Here
1
[% BLOCK showreference %]
2
    [% IF marcflavour == 'UNIMARC' %]
3
        [% SWITCH type %]
4
        [% CASE 'broader' %]
5
            <span class="BT">[% heading %]</span> --
6
        [% CASE 'narrower' %]
7
            <span class="NT">[% heading %]</span> --
8
        [% CASE 'narrower' %]
9
            <span class="NT">[% heading %]</span> --
10
        [% CASE 'seefrom' %]
11
            <span class="UF">[% heading %]</span> --
12
        [% CASE 'seealso' %]
13
            <span class="RT">[% heading %]</span> --
14
        [% END %]
15
    [% ELSE %]
16
        [% IF ( label ) %]<span class="label">[% label %]</span>[% END %]
17
        <span class="heading">[% heading %]</span>
18
        [% UNLESS ( type=='seefrom' || type=='seealso' ) %]<span class="type">[% SWITCH type %]
19
        [% CASE 'earlier' %](Earlier heading)
20
        [% CASE 'later' %](Later heading)
21
        [% CASE 'acronym' %](Acronym)
22
        [% CASE 'musical' %](Musical composition)
23
        [% CASE 'broader' %](Broader heading)
24
        [% CASE 'narrower' %](Narrower heading)
25
        [% CASE %]([% type %])
26
        [% END %]</span>[% END %]
27
    [% END %]
28
[% END %]
29
[% BLOCK authresult %]
30
    [% IF ( summary.summary ) %][% summary.summary %]:[% END %]
31
    [% UNLESS ( summary.summaryonly ) %]
32
        [% FOREACH authorize IN summary.authorized %]
33
            <span class="authorizedheading">[% authorize %]</span>
34
        [% END %]
35
        [% IF ( marcflavour == 'UNIMARC' ) %]
36
            [% FOREACH note IN summary.notes %]
37
                <span class="note">[% note %]</span>
38
            [% END %]
39
            [% FOREACH seefro IN summary.seefrom %]
40
                [% PROCESS showreference heading=seefro.heading label="" type=seefro.type %]
41
            [% END %]
42
        [% ELSE %]
43
            [% IF ( summary.seefrom ) %]
44
                [% FOREACH seefro IN summary.seefrom %]
45
                    <div class="seefrom authref">
46
                    [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type %]
47
                    </div>
48
                [% END %]
49
            [% END %]
50
            [% IF ( summary.seealso ) %]
51
                [% FOREACH seeals IN summary.seealso %]
52
                    <div class="seealso authref">
53
                    [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type %]
54
                    </div>
55
                [% END %]
56
            [% END %]
57
        [% END %]
58
    [% END %]
59
[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiesdetail.tt (-2 / +4 lines)
Lines 66-73 function showChildren(mynumber) { Link Here
66
        <p><b>[% Tag0X.tag %]</b></p>
66
        <p><b>[% Tag0X.tag %]</b></p>
67
        <ul>
67
        <ul>
68
        [% FOREACH subfiel IN Tag0X.subfield %]
68
        [% FOREACH subfiel IN Tag0X.subfield %]
69
                <p><b>[% subfiel.marc_lib %]:</b> [% subfiel.marc_value %]</p>
69
            <p><b>[% subfiel.marc_lib %]:</b>
70
            [% END %]
70
            [% IF subfiel.isurl %]<a href="[% subfiel.marc_value %]">[% subfiel.marc_value %]</a>
71
            [% ELSE %][% subfiel.marc_value %][% END %]</p>
72
        [% END %]
71
        </ul>
73
        </ul>
72
        [% END %]
74
        [% END %]
73
</div>	
75
</div>	
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt (-5 / +3 lines)
Lines 1-3 Link Here
1
[% PROCESS 'authorities-search-results.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; [% IF ( total ) %]Authority search result[% ELSE %]No results found[% END %]
2
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; [% IF ( total ) %]Authority search result[% ELSE %]No results found[% END %]
2
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
3
</head>
4
</head>
Lines 52-62 Link Here
52
            [% ELSE %]
53
            [% ELSE %]
53
                <tr>
54
                <tr>
54
            [% END %]
55
            [% END %]
55
					<td>[% resul.summary %]</td>
56
                    <td>[% PROCESS authresult summary=resul.summary %]</td>
56
57
                    <td>[% authtypetext %]</td>
57
						<td>
58
					[% authtypetext %]
59
						</td>
60
					[% UNLESS ( resul.isEDITORS ) %]
58
					[% UNLESS ( resul.isEDITORS ) %]
61
						<td>
59
						<td>
62
							 <a href="/cgi-bin/koha/opac-search.pl?type=opac&amp;op=do_search&amp;q=an=[% resul.authid %]">[% resul.used %] biblios</a>
60
							 <a href="/cgi-bin/koha/opac-search.pl?type=opac&amp;op=do_search&amp;q=an=[% resul.authid %]">[% resul.used %] biblios</a>
(-)a/opac/opac-authoritiesdetail.pl (-19 / +11 lines)
Lines 52-60 my $query = new CGI; Link Here
52
52
53
my $dbh = C4::Context->dbh;
53
my $dbh = C4::Context->dbh;
54
54
55
my $authid       = $query->param('authid');
55
my $display_hierarchy = C4::Context->preference("AuthDisplayHierarchy");
56
my $authtypecode = &GetAuthTypeCode( $authid );
56
my $show_marc = $query->param('marc') || 1; # Currently only MARC view is available
57
my $tagslib      = &GetTagsLabels( 1, $authtypecode );
58
57
59
# open template
58
# open template
60
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
59
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 67-74 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
67
    }
66
    }
68
);
67
);
69
68
69
my $authid       = $query->param('authid');
70
my $authtypecode = &GetAuthTypeCode( $authid );
71
my $tagslib      = &GetTagsLabels( 0, $authtypecode );
72
73
70
my $record;
74
my $record;
71
if (C4::Context->preference("AuthDisplayHierarchy")){
75
if ($display_hierarchy){
72
  my $trees=BuildUnimarcHierarchies($authid);
76
  my $trees=BuildUnimarcHierarchies($authid);
73
  my @trees = split /;/,$trees ;
77
  my @trees = split /;/,$trees ;
74
  push @trees,$trees unless (@trees);
78
  push @trees,$trees unless (@trees);
Lines 88-94 if (C4::Context->preference("AuthDisplayHierarchy")){ Link Here
88
    push @loophierarchies, { 'loopelement' =>\@loophierarchy};
92
    push @loophierarchies, { 'loopelement' =>\@loophierarchy};
89
  }
93
  }
90
  $template->param(
94
  $template->param(
91
    'displayhierarchy' =>C4::Context->preference("AuthDisplayHierarchy"),
95
    'displayhierarchy' => $display_hierarchy,
92
    'loophierarchies' =>\@loophierarchies,
96
    'loophierarchies' =>\@loophierarchies,
93
  );
97
  );
94
}
98
}
Lines 145-159 foreach my $field (@fields) { Link Here
145
            my %subfield_data;
149
            my %subfield_data;
146
            $subfield_data{marc_lib} =
150
            $subfield_data{marc_lib} =
147
              $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
151
              $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
148
            if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{isurl} ) {
149
                $subfield_data{marc_value} =
150
                  "<a href=\"$subf[$i][1]\">$subf[$i][1]</a>";
151
            }
152
            else {
153
                $subfield_data{marc_value} = $subf[$i][1];
154
            }
155
            $subfield_data{marc_subfield} = $subf[$i][0];
152
            $subfield_data{marc_subfield} = $subf[$i][0];
156
            $subfield_data{marc_tag}      = $field->tag();
153
            $subfield_data{marc_tag}      = $field->tag();
154
            $subfield_data{isurl} =  $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{isurl};
155
            $subfield_data{marc_value} = $subf[$i][1];
157
            push( @subfields_data, \%subfield_data );
156
            push( @subfields_data, \%subfield_data );
158
        }
157
        }
159
    }
158
    }
Lines 186-197 $template->param( Link Here
186
    biblio_fields        => $biblio_fields,
185
    biblio_fields        => $biblio_fields,
187
    authtypetext         => $authtypes->{$authtypecode}{'authtypetext'},
186
    authtypetext         => $authtypes->{$authtypecode}{'authtypetext'},
188
    authtypesloop        => \@authtypesloop,
187
    authtypesloop        => \@authtypesloop,
189
    LibraryName          => C4::Context->preference("LibraryName"),
190
    OpacNav              => C4::Context->preference("OpacNav"),
191
    opaccredits          => C4::Context->preference("opaccredits"),
192
    opacsmallimage       => C4::Context->preference("opacsmallimage"),
193
    opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
194
    opaccolorstylesheet  => C4::Context->preference("opaccolorstylesheet"),
195
);
188
);
196
output_html_with_http_headers $query, $cookie, $template->output;
189
output_html_with_http_headers $query, $cookie, $template->output;
197
190
198
- 

Return to bug 7943