[Koha-cvs] CVS: koha/C4 Biblio.pm,1.100,1.101
Paul POULAIN
tipaul at users.sourceforge.net
Wed Aug 18 18:01:41 CEST 2004
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10089/C4
Modified Files:
Biblio.pm
Log Message:
modifs to support frameworkcodes
Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.100
retrieving revision 1.101
diff -C2 -r1.100 -r1.101
*** Biblio.pm 13 Aug 2004 16:37:25 -0000 1.100
--- Biblio.pm 18 Aug 2004 16:01:37 -0000 1.101
***************
*** 885,889 ****
my $sth =
$dbh->prepare(
! "select tagfield,tagsubfield from marc_subfield_structure where kohafield=?"
);
my $record = MARC::Record->new();
--- 885,889 ----
my $sth =
$dbh->prepare(
! "select tagfield,tagsubfield from marc_subfield_structure where frameworkcode=? and kohafield=?"
);
my $record = MARC::Record->new();
***************
*** 902,906 ****
if ( $row->{$code} ) {
&MARCkoha2marcOnefield( $sth, $record, "biblio." . $code,
! $row->{$code} );
}
}
--- 902,906 ----
if ( $row->{$code} ) {
&MARCkoha2marcOnefield( $sth, $record, "biblio." . $code,
! $row->{$code}, '');
}
}
***************
*** 924,928 ****
if ( $row->{$code} ) {
&MARCkoha2marcOnefield( $sth, $record, "biblioitems." . $code,
! $row->{$code} );
}
}
--- 924,928 ----
if ( $row->{$code} ) {
&MARCkoha2marcOnefield( $sth, $record, "biblioitems." . $code,
! $row->{$code},'' );
}
}
***************
*** 936,940 ****
while ( my $row = $sth2->fetchrow_hashref ) {
&MARCkoha2marcOnefield( $sth, $record, "additionalauthors.author",
! $row->{'author'} );
}
my $sth2 =
--- 936,940 ----
while ( my $row = $sth2->fetchrow_hashref ) {
&MARCkoha2marcOnefield( $sth, $record, "additionalauthors.author",
! $row->{'author'},'' );
}
my $sth2 =
***************
*** 943,947 ****
while ( my $row = $sth2->fetchrow_hashref ) {
&MARCkoha2marcOnefield( $sth, $record, "bibliosubject.subject",
! $row->{'subject'} );
}
my $sth2 =
--- 943,947 ----
while ( my $row = $sth2->fetchrow_hashref ) {
&MARCkoha2marcOnefield( $sth, $record, "bibliosubject.subject",
! $row->{'subject'},'' );
}
my $sth2 =
***************
*** 951,955 ****
while ( my $row = $sth2->fetchrow_hashref ) {
&MARCkoha2marcOnefield( $sth, $record, "bibliosubtitle.title",
! $row->{'subtitle'} );
}
return $record;
--- 951,955 ----
while ( my $row = $sth2->fetchrow_hashref ) {
&MARCkoha2marcOnefield( $sth, $record, "bibliosubtitle.title",
! $row->{'subtitle'},'' );
}
return $record;
***************
*** 964,968 ****
my $sth =
$dbh->prepare(
! "select tagfield,tagsubfield from marc_subfield_structure where kohafield=?"
);
my $record = MARC::Record->new();
--- 964,968 ----
my $sth =
$dbh->prepare(
! "select tagfield,tagsubfield from marc_subfield_structure where frameworkcode=? and kohafield=?"
);
my $record = MARC::Record->new();
***************
*** 987,991 ****
if ( $row->{$code} ) {
&MARCkoha2marcOnefield( $sth, $record, "items." . $code,
! $row->{$code} );
}
}
--- 987,991 ----
if ( $row->{$code} ) {
&MARCkoha2marcOnefield( $sth, $record, "items." . $code,
! $row->{$code},'' );
}
}
***************
*** 1000,1016 ****
my $sth =
$dbh->prepare(
! "select tagfield,tagsubfield from marc_subfield_structure where kohafield=?"
);
my $record = MARC::Record->new();
&MARCkoha2marcOnefield( $sth, $record, "bibliosubtitle.subtitle",
! $subtitle );
return $record;
}
sub MARCkoha2marcOnefield {
! my ( $sth, $record, $kohafieldname, $value ) = @_;
my $tagfield;
my $tagsubfield;
! $sth->execute($kohafieldname);
if ( ( $tagfield, $tagsubfield ) = $sth->fetchrow ) {
if ( $record->field($tagfield) ) {
--- 1000,1016 ----
my $sth =
$dbh->prepare(
! "select tagfield,tagsubfield from marc_subfield_structure where frameworkcode=? and kohafield=?"
);
my $record = MARC::Record->new();
&MARCkoha2marcOnefield( $sth, $record, "bibliosubtitle.subtitle",
! $subtitle,'' );
return $record;
}
sub MARCkoha2marcOnefield {
! my ( $sth, $record, $kohafieldname, $value,$frameworkcode ) = @_;
my $tagfield;
my $tagsubfield;
! $sth->execute($frameworkcode,$kohafieldname);
if ( ( $tagfield, $tagsubfield ) = $sth->fetchrow ) {
if ( $record->field($tagfield) ) {
***************
*** 1090,1094 ****
$sth2->execute;
while (($field)=$sth2->fetchrow) {
! $result = &MARCmarc2kohaOneField($sth,"items",$field,$record,$result,$frameworkcode);
}
# additional authors : specific
--- 1090,1095 ----
$sth2->execute;
while (($field)=$sth2->fetchrow) {
! # warn "X";
! $result=&MARCmarc2kohaOneField($sth,"items",$field,$record,$result,$frameworkcode);
}
# additional authors : specific
***************
*** 1120,1129 ****
# FIXME ? if a field has a repeatable subfield that is used in old-db, only the 1st will be retrieved...
my ( $sth, $kohatable, $kohafield, $record, $result,$frameworkcode ) = @_;
-
# warn "kohatable / $kohafield / $result / ";
my $res = "";
my $tagfield;
my $subfield;
! $sth->execute( $frameworkcode,$kohatable . "." . $kohafield );
( $tagfield, $subfield ) = $sth->fetchrow;
foreach my $field ( $record->field($tagfield) ) {
--- 1121,1129 ----
# FIXME ? if a field has a repeatable subfield that is used in old-db, only the 1st will be retrieved...
my ( $sth, $kohatable, $kohafield, $record, $result,$frameworkcode ) = @_;
# warn "kohatable / $kohafield / $result / ";
my $res = "";
my $tagfield;
my $subfield;
! $sth->execute($frameworkcode, $kohatable . "." . $kohafield );
( $tagfield, $subfield ) = $sth->fetchrow;
foreach my $field ( $record->field($tagfield) ) {
***************
*** 1137,1140 ****
--- 1137,1141 ----
}
}
+ # warn "OneField for $kohatable.$kohafield and $frameworkcode=> $tagfield, $subfield";
return $result;
}
***************
*** 1331,1337 ****
# add item in old-DB
my $frameworkcode=MARCfind_frameworkcode($dbh,$bibid);
-
my $item = &MARCmarc2koha( $dbh, $record,$frameworkcode );
-
# needs old biblionumber and biblioitemnumber
$item->{'biblionumber'} =
--- 1332,1336 ----
***************
*** 1347,1353 ****
my $sth =
$dbh->prepare(
! "select tagfield,tagsubfield from marc_subfield_structure where kohafield=?"
);
! &MARCkoha2marcOnefield( $sth, $record, "items.itemnumber", $itemnumber );
# add the item
--- 1346,1352 ----
my $sth =
$dbh->prepare(
! "select tagfield,tagsubfield from marc_subfield_structure where frameworkcode=? and kohafield=?"
);
! &MARCkoha2marcOnefield( $sth, $record, "items.itemnumber", $itemnumber,$frameworkcode );
# add the item
***************
*** 2535,2538 ****
--- 2534,2540 ----
# $Id$
# $Log$
+ # Revision 1.101 2004/08/18 16:01:37 tipaul
+ # modifs to support frameworkcodes
+ #
# Revision 1.100 2004/08/13 16:37:25 tipaul
# adding frameworkcode to API in some subs
More information about the Koha-cvs
mailing list