koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/acqui.simple addbiblio.pl additem.pl [dev_week]


From: Joshua Ferraro
Subject: [Koha-cvs] koha/acqui.simple addbiblio.pl additem.pl [dev_week]
Date: Tue, 11 Jul 2006 13:00:46 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Joshua Ferraro <kados>  06/07/11 13:00:46

Modified files:
        acqui.simple   : addbiblio.pl additem.pl 

Log message:
        syncing with rel_2_2 before rel_2_2 was broken (meaning that
        dev-week MARC editor works now)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/acqui.simple/addbiblio.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.52.2.40.2.1&r2=1.52.2.40.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/acqui.simple/additem.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.27.2.19&r2=1.27.2.19.2.1

Patches:
Index: addbiblio.pl
===================================================================
RCS file: /sources/koha/koha/acqui.simple/Attic/addbiblio.pl,v
retrieving revision 1.52.2.40.2.1
retrieving revision 1.52.2.40.2.2
diff -u -b -r1.52.2.40.2.1 -r1.52.2.40.2.2
--- addbiblio.pl        30 May 2006 17:36:51 -0000      1.52.2.40.2.1
+++ addbiblio.pl        11 Jul 2006 13:00:46 -0000      1.52.2.40.2.2
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: addbiblio.pl,v 1.52.2.40.2.1 2006/05/30 17:36:51 tgarip1957 Exp $
+# $Id: addbiblio.pl,v 1.52.2.40.2.2 2006/07/11 13:00:46 kados Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -25,7 +25,8 @@
 use C4::Output;
 use C4::Interface::CGI::Output;
 use C4::Biblio;
-use C4::Search; # also includes Biblio.pm, SearchMarc is used to FindDuplicate
+use C4::SearchMarc; # also includes Biblio.pm, SearchMarc is used to 
FindDuplicate
+use C4::Search;
 use C4::Context;
 use C4::Koha; # XXX subfield_is_koha_internal_p
 #use Smart::Comments;
@@ -487,9 +488,10 @@
        my @ind_tag = $input->param('ind_tag');
        my @indicator = $input->param('indicator');
        my $xml = 
MARChtml2xml(address@hidden,address@hidden,address@hidden,address@hidden,address@hidden);
-       #warn $xml;
-       my 
$record=MARC::Record->new_from_xml($xml,C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour'));
-       #warn $record->as_formatted;
+       $xml =~ s/collection/record/g;
+       warn "BEFORE".$xml;
+       my $record=MARC::Record->new_from_xml($xml, 'UTF-8'); #,'UNIMARC'); 
#C4::Context->preference('TemplateEncoding'), 
C4::Context->preference('marcflavour'));
+       warn $record->as_formatted;
        #warn "IN ADDBIB";
        # check for a duplicate
        my ($duplicatebiblionumber,$duplicatebibid,$duplicatetitle) = 
FindDuplicate($record) if ($op eq "addbiblio") && (!$is_a_modif);
@@ -537,7 +539,7 @@
        my @ind_tag = $input->param('ind_tag');
        my @indicator = $input->param('indicator');
        my $xml = 
MARChtml2xml(address@hidden,address@hidden,address@hidden,address@hidden,address@hidden);
-       my $record=MARC::Record->new_from_xml($xml, 
C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour'));
+       my $record=MARC::Record->new_from_xml($xml, 'UTF-8'); 
#C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour'));
        # adding an empty field
        my $field = 
MARC::Field->new("$addedfield",'','','$tagaddfield_subfield' => "");
        $record->append_fields($field);

Index: additem.pl
===================================================================
RCS file: /sources/koha/koha/acqui.simple/Attic/additem.pl,v
retrieving revision 1.27.2.19
retrieving revision 1.27.2.19.2.1
diff -u -b -r1.27.2.19 -r1.27.2.19.2.1
--- additem.pl  26 Apr 2006 16:53:37 -0000      1.27.2.19
+++ additem.pl  11 Jul 2006 13:00:46 -0000      1.27.2.19.2.1
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: additem.pl,v 1.27.2.19 2006/04/26 16:53:37 tgarip1957 Exp $
+# $Id: additem.pl,v 1.27.2.19.2.1 2006/07/11 13:00:46 kados Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -261,16 +261,12 @@
                                        (C4::Context->userenv->{flags} != 1) && 
($value) && ($value ne C4::Context->userenv->{branch}) ;
 #              print $input->redirect(".pl?bibid=$bibid") if ($test);
                # search for itemcallnumber if applicable
-##Lc callnumbers expect 2 subfields like 050ab or 090ab . Modified to accept 2 
subfields
                if ($tagslib->{$tag}->{$subfield}->{kohafield} eq 
'items.itemcallnumber' && C4::Context->preference('itemcallnumber')) {
                        my $CNtag = 
substr(C4::Context->preference('itemcallnumber'),0,3);
                        my $CNsubfield = 
substr(C4::Context->preference('itemcallnumber'),3,1);
-                       my $CNsubfield2 = 
substr(C4::Context->preference('itemcallnumber'),4,1);
                        my $temp = $record->field($CNtag);
                        if ($temp) {
-                               $value = ($temp->subfield($CNsubfield)).' 
'.($temp->subfield($CNsubfield2));
-#remove any trailing space incase one subfield is used
-                       $value=~s/^\s+|\s+$//g;
+                               $value = $temp->subfield($CNsubfield);
                        }
                }
                if ($tagslib->{$tag}->{$subfield}->{authorised_value}) {




reply via email to

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