koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha C4/AuthoritiesMarc.pm authorities/authorit... [R_2-2-7-1


From: Antoine Farnault
Subject: [Koha-cvs] koha C4/AuthoritiesMarc.pm authorities/authorit... [R_2-2-7-1]
Date: Mon, 12 Feb 2007 10:05:13 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         R_2-2-7-1
Changes by:     Antoine Farnault <toins>        07/02/12 10:05:13

Modified files:
        C4             : AuthoritiesMarc.pm 
        authorities    : authorities.pl detail.pl 

Log message:
        Commiting BUG FIX for 2.2.7.1.
        
        Previous log was :
                Bug Fixing authtrees

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/AuthoritiesMarc.pm?cvsroot=koha&only_with_tag=R_2-2-7-1&r1=1.9.2.24&r2=1.9.2.24.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/authorities/authorities.pl?cvsroot=koha&only_with_tag=R_2-2-7-1&r1=1.8.2.11&r2=1.8.2.11.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/authorities/detail.pl?cvsroot=koha&only_with_tag=R_2-2-7-1&r1=1.2.2.7&r2=1.2.2.7.2.1

Patches:
Index: C4/AuthoritiesMarc.pm
===================================================================
RCS file: /sources/koha/koha/C4/AuthoritiesMarc.pm,v
retrieving revision 1.9.2.24
retrieving revision 1.9.2.24.2.1
diff -u -b -r1.9.2.24 -r1.9.2.24.2.1
--- C4/AuthoritiesMarc.pm       10 Aug 2006 12:42:33 -0000      1.9.2.24
+++ C4/AuthoritiesMarc.pm       12 Feb 2007 10:05:13 -0000      1.9.2.24.2.1
@@ -195,6 +195,7 @@
                chop $tags_using_authtype;
                my $reported_tag;
                # if the library has a summary defined, use it. Otherwise, 
build a standard one
+               $summary=BuildSummary($record,$summary);
                if ($summary) {
                        my @fields = $record->fields();
                        $reported_tag = '$9'.$result[$counter];
@@ -532,7 +533,7 @@
 #  existing authids in the records. I've adjusted below to account for this 
instance --JF.
        if ($authid) {
                $dbh->do("lock tables auth_header WRITE,auth_subfield_table 
WRITE, auth_word WRITE, stopwords READ");
-               my $sth=$dbh->prepare("insert into auth_header 
(authid,datecreated,authtypecode) values (?,now(),?)");
+               my $sth=$dbh->prepare("insert ignore into auth_header 
(authid,datecreated,authtypecode) values (?,now(),?)");
                $sth->execute($authid,$authtypecode);
                $sth->finish;
 # if authid empty => true add, find a new authid number
@@ -1132,8 +1133,6 @@
 sub BuildSummary{
        my $record = shift @_;
        my $summary = shift @_;
-    ##TODO : use langages from authorised_values
-    ## AND Thesaurii from auth_types
        my %language;
        $language{'fre'}="Fran├žais";
        $language{'eng'}="Anglais";
@@ -1187,33 +1186,49 @@
                        }
                        # rejected form(s)
                        foreach my $field ($record->field('3..')) {
-                         $notes.= '<span 
class="note">'.$field->subfield('a')."</span>\n";
+                         $notes.= '<span 
class="note">'.$field->subfield('a')."</span>";
                        }
                        foreach my $field ($record->field('4..')) {
                          my $thesaurus = "thes. : 
".$thesaurus{"$field->subfield('2')"}." : " if ($field->subfield('2'));
-                         $see.= '<span 
class="UF">'.$thesaurus.$field->subfield('a')."</span> -- \n";
+                         $see.= '<span 
class="UF">'.$thesaurus.$field->subfield('a')."</span> -- ";
                        }
                        # see :
                        foreach my $field ($record->field('5..')) {
                        
                                if (($field->subfield('5')) && 
($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
-                                 $broaderterms.= '<span class="BT"> <a 
href="detail.pl?authid='.$field->subfield('3').'">'.$field->subfield('a')."</a></span>
 -- \n";
+                                 $broaderterms.= '<span class="BT">';
+#                   $broaderterms.='<a 
href="detail.pl?authid='.$field->subfield('3').'">';
+                  $broaderterms.=$field->subfield('a');
+#                   $broaderterms.="</a>";
+                  $broaderterms.="</span> -- ";
                                } elsif (($field->subfield('5')) && 
($field->subfield('a')) && ($field->subfield('5') eq 'h')){
-                                 $narrowerterms.= '<span class="NT"><a 
href="detail.pl?authid='.$field->subfield('3').'">'.$field->subfield('a')."</a></span>
 -- \n";
+                                 $narrowerterms.= '<span class="NT">';
+#                   $narrowerterms.='<a 
href="detail.pl?authid='.$field->subfield('3').'">';
+                  $narrowerterms.=$field->subfield('a');
+#                   $narrowerterms.="</a>";
+                  $narrowerterms.="</span> -- ";
                                } elsif ($field->subfield('a')) {
-                                 $seealso.= '<span class="RT"><a 
href="detail.pl?authid='.$field->subfield('3').'">'.$field->subfield('a')."</a></span>
 -- \n";
+                                 $seealso.= '<span class="RT">';
+#                   $seealso.= '<a 
href="detail.pl?authid='.$field->subfield('3').'">';
+                  $seealso.= $field->subfield('a');
+#                   $seealso.= "</a>";
+                  $seealso.= "</span> -- ";
                                }
                        }
                        # // 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";      
+                               $seeheading.= '<span class="langue"> En 
'.$language{$lang}.' : </span><span class="OT"> 
'.$field->subfield('a')."</span>\n";    
                        }
             $broaderterms =~s/-- \n$//;
             $narrowerterms =~s/-- \n$//;
             $seealso =~s/-- \n$//;
             $see =~s/-- \n$//;
-                       $summary = "<b><a 
href=\"detail.pl?authid=$authid\">".$heading."</a></b><br />".($notes?"$notes 
<br />":"");
+                       $summary = "<b>";
+#             $summary.= "<a href=\"detail.pl?authid=$authid\">";
+            $summary.=$heading;
+#             $summary.="</a>";
+            $summary.="</b><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);
@@ -1333,8 +1348,14 @@
 
 =cut
 
-# $Id: AuthoritiesMarc.pm,v 1.9.2.24 2006/08/10 12:42:33 tipaul Exp $
+# $Id: AuthoritiesMarc.pm,v 1.9.2.24.2.1 2007/02/12 10:05:13 toins Exp $
 # $Log: AuthoritiesMarc.pm,v $
+# Revision 1.9.2.24.2.1  2007/02/12 10:05:13  toins
+# Commiting BUG FIX for 2.2.7.1.
+#
+# Previous log was :
+#      Bug Fixing authtrees
+#
 # Revision 1.9.2.24  2006/08/10 12:42:33  tipaul
 # warn commenting + some bugfixes I forgot to commit (for authorities editing)
 #

Index: authorities/authorities.pl
===================================================================
RCS file: /sources/koha/koha/authorities/authorities.pl,v
retrieving revision 1.8.2.11
retrieving revision 1.8.2.11.2.1
diff -u -b -r1.8.2.11 -r1.8.2.11.2.1
--- authorities/authorities.pl  10 Aug 2006 11:41:45 -0000      1.8.2.11
+++ authorities/authorities.pl  12 Feb 2007 10:05:13 -0000      1.8.2.11.2.1
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: authorities.pl,v 1.8.2.11 2006/08/10 11:41:45 tipaul Exp $
+# $Id: authorities.pl,v 1.8.2.11.2.1 2007/02/12 10:05:13 toins Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -330,7 +330,7 @@
        my @ind_tag = $input->param('ind_tag');
        my @indicator = $input->param('indicator');
        my $record;
-       if (C4::Context->preference('TemplateEncoding') eq "iso-8859-1") {
+       if (C4::Context->preference('TemplateEncoding') eq 
"iso-8859-1"||C4::Context->preference('marcflavour') eq "UNIMARC") {
         my %indicators;
         for (my $i=0;$i<=$#ind_tag;$i++) {
             $indicators{$ind_tag[$i]} = $indicator[$i];
@@ -376,7 +376,7 @@
        my @ind_tag = $input->param('ind_tag');
        my @indicator = $input->param('indicator');
        my $record;
-       if (C4::Context->preference('TemplateEncoding') eq "iso-8859-1") {
+       if (C4::Context->preference('TemplateEncoding') eq "iso-8859-1" 
||C4::Context->preference('marcflavour') eq "UNIMARC") {
         my %indicators;
         for (my $i=0;$i<=$#ind_tag;$i++) {
             $indicators{$ind_tag[$i]} = $indicator[$i];

Index: authorities/detail.pl
===================================================================
RCS file: /sources/koha/koha/authorities/detail.pl,v
retrieving revision 1.2.2.7
retrieving revision 1.2.2.7.2.1
diff -u -b -r1.2.2.7 -r1.2.2.7.2.1
--- authorities/detail.pl       14 Nov 2006 13:55:10 -0000      1.2.2.7
+++ authorities/detail.pl       12 Feb 2007 10:05:13 -0000      1.2.2.7.2.1
@@ -93,11 +93,11 @@
       $cnt++;
     }
     push @loophierarchies, { 'loopelement' =>address@hidden;
+  }
     $template->param(
       'displayhierarchy' =>C4::Context->preference("AuthDisplayHierarchy"),
       'loophierarchies' =>address@hidden,
     );
-  }
 } else {
   $record=AUTHgetauthority($dbh,$authid);
 }




reply via email to

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