koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/C4 Biblio.pm


From: paul poulain
Subject: [Koha-cvs] koha/C4 Biblio.pm
Date: Tue, 03 Jul 2007 09:33:05 +0000

CVSROOT:        /sources/koha
Module name:    koha
Changes by:     paul poulain <tipaul>   07/07/03 09:33:05

Modified files:
        C4             : Biblio.pm 

Log message:
        if you just replace su by a space in subjects, you'll replace jesus by 
je s, which is strange for users. this fix solves the problem and introduces 
authoritysep systempref as separator of subfields, for a better identification 
of where the authority starts and end

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&r1=1.214&r2=1.215

Patches:
Index: Biblio.pm
===================================================================
RCS file: /sources/koha/koha/C4/Biblio.pm,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -b -r1.214 -r1.215
--- Biblio.pm   2 Jul 2007 09:13:22 -0000       1.214
+++ Biblio.pm   3 Jul 2007 09:33:05 -0000       1.215
@@ -33,7 +33,7 @@
 use vars qw($VERSION @ISA @EXPORT);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.214 $' =~ /\d+/g; shift(@v).".".join( 
"_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.215 $' =~ /\d+/g; shift(@v).".".join( 
"_", map { sprintf "%03d", $_ } @v ); };
 
 @ISA = qw( Exporter );
 
@@ -1727,9 +1727,10 @@
     foreach my $field ( $record->fields ) {
         next unless $field->tag() >= $mintag && $field->tag() <= $maxtag;
         my @subfields = $field->subfields();
-        my $link;
-        my $label = "su:";
+        my $link = "su:";
+        my $label;
         my $flag = 0;
+        my $authoritysep=C4::Context->preference("authoritysep");
         for my $subject_subfield ( @subfields ) {
             if (
                 $marcflavour ne 'MARC21'
@@ -1743,20 +1744,17 @@
                 next;
             }
             my $code = $subject_subfield->[0];
-            $label .= $subject_subfield->[1] . " and su-to:" unless ( $code == 
9 );
+            $label .= $subject_subfield->[1].$authoritysep unless ( $code == 9 
);
+            $link  .= $subject_subfield->[1] . " and su-to:" unless ( $code == 
9 );
             if ( $code == 9 ) {
                 $link = "Koha-Auth-Number:".$subject_subfield->[1];
                 $flag = 1;
             }
             elsif ( ! $flag ) {
-                $link = $label;
                 $link =~ s/ and\ssu-to:$//;
             }
         }
-        $label =~ s/su/ /g;
-        $label =~ s/://g;
-        $label =~ s/-to//g;
-        $label =~ s/ and //g;
+         $label =~ s/$authoritysep$//;
         push @marcsubjcts,
           {
             label => $label,
@@ -3957,8 +3955,11 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.214 2007/07/02 09:13:22 tipaul Exp $
+# $Id: Biblio.pm,v 1.215 2007/07/03 09:33:05 tipaul Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.215  2007/07/03 09:33:05  tipaul
+# if you just replace su by a space in subjects, you'll replace jesus by je s, 
which is strange for users. this fix solves the problem and introduces 
authoritysep systempref as separator of subfields, for a better identification 
of where the authority starts and end
+#
 # Revision 1.214  2007/07/02 09:13:22  tipaul
 # unimarc bugfix : the encoding is in field 100 in UNIMARC. when 
TransformHTMLtoXML on an item, you must not automatically add a 100 field in 
items, otherwise there will be 2 100 fields in the biblio, which is wrong
 #




reply via email to

[Prev in Thread] Current Thread [Next in Thread]