koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 AuthoritiesMarc.pm [rel_2_2]


From: paul poulain
Subject: [Koha-cvs] koha/C4 AuthoritiesMarc.pm [rel_2_2]
Date: Wed, 08 Mar 2006 15:17:10 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     paul poulain <address@hidden>   06/03/08 15:17:10

Modified files:
        C4             : AuthoritiesMarc.pm 

Log message:
        fixing some UNIMARC behaviour + removing some hardcoded strings

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/AuthoritiesMarc.pm.diff?only_with_tag=rel_2_2&tr1=1.9.2.10&tr2=1.9.2.11&r1=text&r2=text

Patches:
Index: koha/C4/AuthoritiesMarc.pm
diff -u koha/C4/AuthoritiesMarc.pm:1.9.2.10 koha/C4/AuthoritiesMarc.pm:1.9.2.11
--- koha/C4/AuthoritiesMarc.pm:1.9.2.10 Mon Mar  6 19:11:55 2006
+++ koha/C4/AuthoritiesMarc.pm  Wed Mar  8 15:17:09 2006
@@ -154,47 +154,72 @@
                my $seeheading;
                my $see;
                my $authtype;
-               if ($record->field('.00')) {
-                       $authtype.= "Personal Name";
-               }
-                if ($record->field('.10')) {
-                        $authtype.= "Corporate Name";
-                }
-                if ($record->field('.11')) {
-                        $authtype.= "Meeting Name";
-                }
-                if ($record->field('.30')) {
-                        $authtype.= "Uniform Title";
-                }
-                if ($record->field('.48')) {
-                        $authtype.= "Chronological Term";
-                }
-                if ($record->field('.50')) {
-                        $authtype.= "Topical Term";
-                }
-                if ($record->field('.51')) {
-                        $authtype.= "Geographic Name";
-                }
-                if ($record->field('.55')) {
-                        $authtype = "Genre/Form Term";
-                }
+               # KADOS : why do you handle hardcoded $authtype, as you have it 
in $authref ?
+#              if ($record->field('.00')) {
+#                      $authtype.= "Personal Name";
+#              }
+#              if ($record->field('.10')) {
+#                              $authtype.= "Corporate Name";
+#              }
+#              if ($record->field('.11')) {
+#                              $authtype.= "Meeting Name";
+#              }
+#              if ($record->field('.30')) {
+#                              $authtype.= "Uniform Title";
+#              }
+#              if ($record->field('.48')) {
+#                              $authtype.= "Chronological Term";
+#              }
+#              if ($record->field('.50')) {
+#                              $authtype.= "Topical Term";
+#              }
+#              if ($record->field('.51')) {
+#                              $authtype.= "Geographic Name";
+#              }
+#              if ($record->field('.55')) {
+#                              $authtype = "Genre/Form Term";
+#              }
+               $authtype=$authref->{authtypetext};
 
                my @fields = $record->fields();
-       
-               foreach my $field ($record->field('1..')) {
-                       $heading.= $field->as_string();
+               my $summary; #.="<b>".$heading."</b><br />";
+               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();
+                       }
+                       # rejected form(s)
+                       foreach my $field ($record->field('4..')) {
+                               $summary.= 
"&nbsp;&nbsp;&nbsp;<i>".$field->as_string()."</i><br/>";
+                               $summary.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see:</i> ".$heading."<br/>";
+                       }
+                       # see :
+                       foreach my $field ($record->field('5..')) {
+                               $summary.= 
"&nbsp;&nbsp;&nbsp;<i>".$field->as_string()."</i><br/>";
+                               $summary.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see:</i> ".$heading."<br/>";
+                       }
+                       # // form
+                       foreach my $field ($record->field('7..')) {
+                               $seeheading.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see also:</i> 
".$field->as_string()."<br />";     
+                               $altheading.= 
"&nbsp;&nbsp;&nbsp;".$field->as_string()."<br />";
+                               $altheading.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see also:</i> ".$heading."<br />";
+                       }
+               } else {
+               # construct MARC21 summary
+                       foreach my $field ($record->field('1..')) {
+                               $heading.= $field->as_string();
+                       }
+                       foreach my $field ($record->field('4..')) {
+                               $summary.= 
"&nbsp;&nbsp;&nbsp;".$field->as_string()."<br />";
+                               $summary.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see:</i> ".$heading."<br />";        
+                       }
+                       foreach my $field ($record->field('5..')) {
+                               $seeheading.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see also:</i> 
".$field->as_string()."<br />";     
+                               $altheading.= 
"&nbsp;&nbsp;&nbsp;".$field->as_string()."<br />";
+                               $altheading.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see also:</i> ".$heading."<br />";
+                       }
                }
-               my $summary; #.="<b>".$heading."</b><br>";
-
-               foreach my $field ($record->field('4..')) {
-                        $summary.= 
"&nbsp;&nbsp;&nbsp;".$field->as_string()."<br>";
-                       $summary.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see:</i> ".$heading."<br>";  
-                }
-                foreach my $field ($record->field('5..')) {
-                       $seeheading.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see also:</i> 
".$field->as_string()."<br>";       
-                        $altheading.= 
"&nbsp;&nbsp;&nbsp;".$field->as_string()."<br>";
-                        $altheading.= 
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>see also:</i> ".$heading."<br>";
-                }
                foreach my $field (@fields) {
                        my $tag = $field->tag();
                        if ($tag<10) {
@@ -218,7 +243,7 @@
                        $tags_using_authtype.= $tagfield."9,";
                }
                chop $tags_using_authtype;
-               $summary = "<b><a 
href='http://opac.liblime.com/cgi-bin/koha/opac-search.pl?type=opac&op=do_search&marclist=$tags_using_authtype&operator==&value=$result[$counter]&and_or=and&excluding='>".$heading."</a></b><br>".$seeheading.$altheading.$summary;
  
+               $summary = "<b><a 
href='/cgi-bin/koha/opac-search.pl?type=opac&op=do_search&marclist=$tags_using_authtype&operator==&value=$result[$counter]&and_or=and&excluding='>".$heading."</a></b><br
 />".$seeheading.$altheading.$summary;       
                # then add a line for the template loop
                my %newline;
                $newline{summary} = $summary;
@@ -1037,8 +1062,11 @@
 
 =cut
 
-# $Id: AuthoritiesMarc.pm,v 1.9.2.10 2006/03/06 19:11:55 kados Exp $
+# $Id: AuthoritiesMarc.pm,v 1.9.2.11 2006/03/08 15:17:09 tipaul Exp $
 # $Log: AuthoritiesMarc.pm,v $
+# Revision 1.9.2.11  2006/03/08 15:17:09  tipaul
+# fixing some UNIMARC behaviour + removing some hardcoded strings
+#
 # Revision 1.9.2.10  2006/03/06 19:11:55  kados
 # Fixes buggy use of ISBD for summary in Authorities display. Previously,
 # it was not possible to properly display repeated tags/subfields in the




reply via email to

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