koha-cvs
[Top][All Lists]
Advanced

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

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


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha/C4 Biblio.pm [rel_2_2]
Date: Mon, 30 Jan 2006 16:06:26 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Henri-Damien LAURENT <address@hidden>   06/01/30 16:06:26

Modified files:
        C4             : Biblio.pm 

Log message:
        BugFix : leader management was annoying for MARCadditem. Changing. 
Avoiding fields which tag is under 100. (Could be a simple different from 000) 
But in UNIMARC, fields under 100 donot have subfields.
        
        Some Improvements on notes and subject management

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

Patches:
Index: koha/C4/Biblio.pm
diff -u koha/C4/Biblio.pm:1.115.2.27 koha/C4/Biblio.pm:1.115.2.28
--- koha/C4/Biblio.pm:1.115.2.27        Thu Jan  5 15:13:55 2006
+++ koha/C4/Biblio.pm   Mon Jan 30 16:06:26 2006
@@ -388,20 +388,22 @@
 
     # now, add subfields...
     foreach my $field (@fields) {
-        my @subfields = $field->subfields();
-        $fieldcount++;
-        foreach my $subfieldcount ( 0 .. $#subfields ) {
-            &MARCaddsubfield(
-                $dbh,
-                $bibid,
-                $field->tag(),
-                $field->indicator(1) . $field->indicator(2),
-                $fieldcount,
-                $subfields[$subfieldcount][0],
-                $subfieldcount + 1,
-                $subfields[$subfieldcount][1]
-            );
-        }
+               unless ($field->tag<100){
+                       my @subfields = $field->subfields();
+                       $fieldcount++;
+                       foreach my $subfieldcount ( 0 .. $#subfields ) {
+                               &MARCaddsubfield(
+                                       $dbh,
+                                       $bibid,
+                                       $field->tag(),
+                                       $field->indicator(1) . 
$field->indicator(2),
+                                       $fieldcount,
+                                       $subfields[$subfieldcount][0],
+                                       $subfieldcount + 1,
+                                       $subfields[$subfieldcount][1]
+                               );
+                       }
+               }
     }
     $dbh->do("unlock tables");
     return $bibid;
@@ -1380,6 +1382,15 @@
                        push @subjects,$subjsubfield[$subfieldcount];
                }
        }
+       ($tagfield,$tagsubfield) = 
MARCfind_marc_from_kohafield($dbh,"items.itemnotes",$frameworkcode);
+       my @notes = $record->field($tagfield);
+       my @itemnotes;
+       foreach my $note (@notes) {
+               my @itemnotefields = $note->subfield($tagsubfield);
+               foreach my $subfieldcount (0..$#itemnotes) {
+                       push @itemnotes,$itemnotefields[$subfieldcount];
+               }
+       }
        OLDmodsubject($dbh,$oldbiblionumber,1,@subjects);
        return 1;
 }
@@ -1427,7 +1438,6 @@
 
 sub NEWmoditem {
     my ( $dbh, $record, $bibid, $itemnumber, $delete ) = @_;
-    
        &MARCmoditem( $dbh, $record, $bibid, $itemnumber, $delete );
        my $frameworkcode=MARCfind_frameworkcode($dbh,$bibid);
     my $olditem = MARCmarc2koha( $dbh, $record,$frameworkcode );
@@ -2002,6 +2012,7 @@
         my $query = "Insert into deleteditems set ";
         my @bind  = ();
         foreach my $temp ( keys %$data ) {
+                       next if ($temp =~/itemcallnumber/);
             $query .= "$temp = ?,";
             push ( @bind, $data->{$temp} );
         }
@@ -2649,6 +2660,17 @@
 #                      warn "for title, I add $tag / 
$subfield".$record->field($tag)->subfield($subfield);
                }
        }
+       ($tag,$subfield) = 
MARCfind_marc_from_kohafield($dbh,"bibliosubtitle.subtitle","");
+       if ($record->field($tag)) {
+               if ($record->field($tag)->subfields($subfield)) {
+                       push @tags, "'".$tag.$subfield."'";
+                       push @and_or, "and";
+                       push @excluding, "";
+                       push @operator, "contains";
+                       push @value, $record->field($tag)->subfield($subfield);
+#                      warn "for title, I add $tag / 
$subfield".$record->field($tag)->subfield($subfield);
+               }
+       }
        # ... and on biblio.author
        ($tag,$subfield) = 
MARCfind_marc_from_kohafield($dbh,"biblio.author","");
        if ($record->field($tag)) {
@@ -2769,8 +2791,13 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.115.2.27 2006/01/05 15:13:55 tipaul Exp $
+# $Id: Biblio.pm,v 1.115.2.28 2006/01/30 16:06:26 hdl Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.115.2.28  2006/01/30 16:06:26  hdl
+# BugFix : leader management was annoying for MARCadditem. Changing. Avoiding 
fields which tag is under 100. (Could be a simple different from 000) But in 
UNIMARC, fields under 100 donot have subfields.
+#
+# Some Improvements on notes and subject management
+#
 # Revision 1.115.2.27  2006/01/05 15:13:55  tipaul
 # bugfix with $0 subfield
 #




reply via email to

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