[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Biblio.pm,1.26,1.27 Output.pm,1.31,1.32 Search.p
From: |
Paul POULAIN |
Subject: |
[Koha-cvs] CVS: koha/C4 Biblio.pm,1.26,1.27 Output.pm,1.31,1.32 Search.pm,1.50,1.51 |
Date: |
Tue, 19 Nov 2002 04:36:18 -0800 |
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1:/tmp/cvs-serv31520/C4
Modified Files:
Biblio.pm Output.pm Search.pm
Log Message:
road to 1.3.2
various bugfixes, improvments, and migration from acquisition.pm to biblio.pm
Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** Biblio.pm 12 Nov 2002 15:58:43 -0000 1.26
--- Biblio.pm 19 Nov 2002 12:36:16 -0000 1.27
***************
*** 2,5 ****
--- 2,9 ----
# $Id$
# $Log$
+ # Revision 1.27 2002/11/19 12:36:16 tipaul
+ # road to 1.3.2
+ # various bugfixes, improvments, and migration from acquisition.pm to
biblio.pm
+ #
# Revision 1.26 2002/11/12 15:58:43 tipaul
# road to 1.3.2 :
***************
*** 176,187 ****
&MARCfind_oldbiblionumber_from_MARCbibid
&MARCfind_MARCbibid_from_oldbiblionumber
! &NEWnewbiblio &NEWnewitem
- &MARCgettagslib
&MARCaddbiblio &MARCadditem
&MARCmodsubfield &MARCaddsubfield
&MARCmodbiblio &MARCmoditem
- &MARCfindsubfield
&MARCkoha2marcBiblio &MARCmarc2koha
&MARCkoha2marcItem &MARChtml2marc
--- 180,193 ----
&MARCfind_oldbiblionumber_from_MARCbibid
&MARCfind_MARCbibid_from_oldbiblionumber
+ &MARCfind_marc_from_kohafield
+ &MARCfindsubfield
+ &MARCgettagslib
! &NEWnewbiblio &NEWnewitem
! &NEWmodbiblio &NEWmoditem
&MARCaddbiblio &MARCadditem
&MARCmodsubfield &MARCaddsubfield
&MARCmodbiblio &MARCmoditem
&MARCkoha2marcBiblio &MARCmarc2koha
&MARCkoha2marcItem &MARChtml2marc
***************
*** 257,262 ****
last param is 1 for liblibrarian and 0 for libopac
returns a hash with tag/subfield meaning
!
! =item ($tagfield,$tagsubfield) =
&MARCfindmarc_from_kohafield($dbh,$kohafield);
finds MARC tag and subfield for a given kohafield
--- 263,267 ----
last param is 1 for liblibrarian and 0 for libopac
returns a hash with tag/subfield meaning
! =item ($tagfield,$tagsubfield) =
&MARCfind_marc_from_kohafield($dbh,$kohafield);
finds MARC tag and subfield for a given kohafield
***************
*** 349,355 ****
my $sth;
if ($forlibrarian eq 1) {
! $sth=$dbh->prepare("select tagfield,liblibrarian as lib from
marc_tag_structure");
} else {
! $sth=$dbh->prepare("select tagfield,libopac as lib from
marc_tag_structure");
}
$sth->execute;
--- 354,360 ----
my $sth;
if ($forlibrarian eq 1) {
! $sth=$dbh->prepare("select tagfield,liblibrarian as lib from
marc_tag_structure order by tagfield");
} else {
! $sth=$dbh->prepare("select tagfield,libopac as lib from
marc_tag_structure order by tagfield");
}
$sth->execute;
***************
*** 361,367 ****
if ($forlibrarian eq 1) {
! $sth=$dbh->prepare("select tagfield,tagsubfield,liblibrarian as
lib,tab, mandatory,
repeatable,authorised_value,thesaurus_category,value_builder from
marc_subfield_structure");
} else {
! $sth=$dbh->prepare("select tagfield,tagsubfield,libopac as
lib,tab, mandatory,
repeatable,authorised_value,thesaurus_category,value_builder from
marc_subfield_structure");
}
$sth->execute;
--- 366,372 ----
if ($forlibrarian eq 1) {
! $sth=$dbh->prepare("select tagfield,tagsubfield,liblibrarian as
lib,tab, mandatory,
repeatable,authorised_value,thesaurus_category,value_builder from
marc_subfield_structure order by tagfield,tagsubfield");
} else {
! $sth=$dbh->prepare("select tagfield,tagsubfield,libopac as
lib,tab, mandatory,
repeatable,authorised_value,thesaurus_category,value_builder from
marc_subfield_structure order by tagfield,tagsubfield");
}
$sth->execute;
***************
*** 539,543 ****
$prevtagorder=$row->{tagorder};
$prevtag = $row->{tag};
! $previndicator=$row->{tag};
%subfieldlist={};
%subfieldlist->{$row->{'subfieldcode'}} =
$row->{'subfieldvalue'};
--- 544,548 ----
$prevtagorder=$row->{tagorder};
$prevtag = $row->{tag};
! $previndicator=$row->{tag_indicator};
%subfieldlist={};
%subfieldlist->{$row->{'subfieldcode'}} =
$row->{'subfieldvalue'};
***************
*** 545,549 ****
%subfieldlist->{$row->{'subfieldcode'}} =
$row->{'subfieldvalue'};
$prevtag= $row->{tag};
! $previndicator=$row->{indicator};
}
}
--- 550,554 ----
%subfieldlist->{$row->{'subfieldcode'}} =
$row->{'subfieldvalue'};
$prevtag= $row->{tag};
! $previndicator=$row->{tag_indicator};
}
}
***************
*** 605,608 ****
--- 610,614 ----
# if nothing to change, don't waste time...
if ($oldrecord eq $record) {
+ warn "NOTHING TO CHANGE";
return;
}
***************
*** 633,668 ****
}
sub MARCmoditem {
! my ($dbh,$record,$bibid,$itemnumber,$delete)address@hidden;
! my $oldrecord=&MARCgetitem($dbh,$bibid,$itemnumber);
! # if nothing to change, don't waste time...
! if ($oldrecord eq $record) {
! return;
! }
! # otherwise, skip through each subfield...
! my @fields = $record->fields();
! # search old MARC item
! my $sth2 = $dbh->prepare("select tagorder from
marc_subfield_table,marc_subfield_structure where
marc_subfield_table.tag=marc_subfield_structure.tagfield and
marc_subfield_table.subfieldcode=marc_subfield_structure.tagsubfield and
bibid=? and kohafield='items.itemnumber' and subfieldvalue=?");
! $sth2->execute($bibid,$itemnumber);
! my ($tagorder) = $sth2->fetchrow_array();
! foreach my $field (@fields) {
! my $oldfield = $oldrecord->field($field->tag());
! my @subfields=$field->subfields();
! my $subfieldorder=0;
! foreach my $subfield (@subfields) {
! $subfieldorder++;
! if ($oldfield eq 0 or (! $oldfield->subfield(@$subfield[0])) ) {
! # just adding datas...
!
&MARCaddsubfield($dbh,$bibid,$field->tag(),$field->indicator(1).$field->indicator(2),
!
$tagorder,@$subfield[0],$subfieldorder,@$subfield[1]);
! } else {
! # modify he subfield if it's a different string
! if ($oldfield->subfield(@$subfield[0]) ne @$subfield[1] ) {
! my
$subfieldid=&MARCfindsubfieldid($dbh,$bibid,$field->tag(),$tagorder,@$subfield[0],$subfieldorder);
! &MARCmodsubfield($dbh,$subfieldid,@$subfield[1]);
} else {
}
- }
}
- }
}
--- 639,680 ----
}
sub MARCmoditem {
! my ($dbh,$record,$bibid,$itemnumber,$delete)address@hidden;
! my $oldrecord=&MARCgetitem($dbh,$bibid,$itemnumber);
! # if nothing to change, don't waste time...
! if ($oldrecord eq $record) {
! warn "nothing to change";
! return;
! }
! warn "MARCmoditem : ".$record->as_formatted;
! # otherwise, skip through each subfield...
! my @fields = $record->fields();
! # search old MARC item
! my $sth2 = $dbh->prepare("select tagorder from
marc_subfield_table,marc_subfield_structure where
marc_subfield_table.tag=marc_subfield_structure.tagfield and
marc_subfield_table.subfieldcode=marc_subfield_structure.tagsubfield and
bibid=? and kohafield='items.itemnumber' and subfieldvalue=?");
! $sth2->execute($bibid,$itemnumber);
! my ($tagorder) = $sth2->fetchrow_array();
! foreach my $field (@fields) {
! my $oldfield = $oldrecord->field($field->tag());
! my @subfields=$field->subfields();
! my $subfieldorder=0;
! foreach my $subfield (@subfields) {
! $subfieldorder++;
! if ($oldfield eq 0 or (! $oldfield->subfield(@$subfield[0])) ) {
! # just adding datas...
! warn "addfield : / $subfieldorder / @$subfield[0] -
@$subfield[1]";
!
&MARCaddsubfield($dbh,$bibid,$field->tag(),$field->indicator(1).$field->indicator(2),
!
$tagorder,@$subfield[0],$subfieldorder,@$subfield[1]);
} else {
+ warn "modfield : / $subfieldorder / @$subfield[0] -
@$subfield[1]";
+ # modify he subfield if it's a different string
+ if ($oldfield->subfield(@$subfield[0]) ne @$subfield[1]
) {
+ my
$subfieldid=&MARCfindsubfieldid($dbh,$bibid,$field->tag(),$tagorder,@$subfield[0],$subfieldorder);
+ warn "HERE : $subfieldid,
$bibid,$field->tag(),$tagorder,@$subfield[0],$subfieldorder";
+
&MARCmodsubfield($dbh,$subfieldid,@$subfield[1]);
+ } else {
+ warn "ICI";
+ }
+ }
}
}
}
***************
*** 1013,1019 ****
$sth->execute("biblioitems.biblioitemnumber");
(my $tagfield2, my $tagsubfield2) = $sth->fetchrow;
! if ($tagsubfield1 != $tagsubfield2) {
! print STDERR "Error in NEWnewbiblio : biblio.biblionumber and
biblioitems.biblioitemnumber MUST have the same subfield number";
! print "Content-Type: text/html\n\nError in NEWnewbiblio :
biblio.biblionumber and biblioitems.biblioitemnumber MUST have the same
subfield number";
die;
}
--- 1025,1031 ----
$sth->execute("biblioitems.biblioitemnumber");
(my $tagfield2, my $tagsubfield2) = $sth->fetchrow;
! if ($tagfield1 != $tagfield2) {
! print STDERR "Error in NEWnewbiblio : biblio.biblionumber and
biblioitems.biblioitemnumber MUST have the same field number";
! print "Content-Type: text/html\n\nError in NEWnewbiblio :
biblio.biblionumber and biblioitems.biblioitemnumber MUST have the same field
number";
die;
}
***************
*** 1029,1035 ****
}
sub NEWnewitem {
my ($dbh, $record,$bibid) = @_;
- warn "add item : ".$record->as_formatted();
# add item in old-DB
my $item = &MARCmarc2koha($dbh,$record);
--- 1041,1053 ----
}
+ sub NEWmodbiblio {
+ my ($dbh,$record,$bibid) address@hidden;
+ &MARCmodbiblio($dbh,$record,$bibid);
+ return 1;
+ }
+
+
sub NEWnewitem {
my ($dbh, $record,$bibid) = @_;
# add item in old-DB
my $item = &MARCmarc2koha($dbh,$record);
***************
*** 1047,1050 ****
--- 1065,1072 ----
}
+ sub NEWmoditem {
+ my ($dbh,$record,$bibid,$itemnumber,$delete) = @_;
+ &MARCmoditem($dbh,$record,$bibid,$itemnumber,$delete);
+ }
#
***************
*** 1423,1435 ****
$sth->finish;
- $item->{'booksellerid'} = $dbh->quote($item->{'booksellerid'});
- $item->{'homebranch'} = $dbh->quote($item->{'homebranch'});
- $item->{'price'} = $dbh->quote($item->{'price'});
- $item->{'replacementprice'} = $dbh->quote($item->{'replacementprice'});
- $item->{'itemnotes'} = $dbh->quote($item->{'itemnotes'});
-
- # foreach my $barcode (@barcodes) {
- # $barcode = uc($barcode);
- $barcode = $dbh->quote($barcode);
$sth=$dbh->prepare("Insert into items set
itemnumber = ?,
biblionumber = ?,
--- 1445,1448 ----
Index: Output.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Output.pm,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** Output.pm 14 Oct 2002 07:41:04 -0000 1.31
--- Output.pm 19 Nov 2002 12:36:16 -0000 1.32
***************
*** 106,109 ****
--- 106,110 ----
my $dbh = C4::Context->dbh;
my @languages = split " ", C4::Context->preference("opaclanguages");
+ warn "==>".C4::Context->preference("opaclanguages");
# language preference
my @themes = split " ", C4::Context->preference("opacthemes");
***************
*** 125,130 ****
--- 126,133 ----
}
if ($theme and $lang) {
+ warn "IN";
return ($theme, $lang);
} else {
+ warn "OUT";
return ('default', 'en');
}
Index: Search.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Search.pm,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -r1.50 -r1.51
*** Search.pm 16 Oct 2002 12:45:15 -0000 1.50
--- Search.pm 19 Nov 2002 12:36:16 -0000 1.51
***************
*** 1691,1704 ****
# Find the last 3 people who borrowed this item.
$query2 = "select * from issues, borrowers
! where itemnumber = '$data->{'itemnumber'}'
! and issues.borrowernumber = borrowers.borrowernumber
! and returndate is not NULL
! order by returndate desc,timestamp desc";
! $sth2 = $dbh->prepare($query2)
! || die $dbh->errstr;
! $sth2->execute
! || die $sth2->errstr;
!
! for (my $i2 = 0; $i2 < 2; $i2++) {
if (my $data2 = $sth2->fetchrow_hashref) {
$data->{"timestamp$i2"} = $data2->{'timestamp'};
--- 1691,1702 ----
# Find the last 3 people who borrowed this item.
$query2 = "select * from issues, borrowers
! where itemnumber = ?
! and
issues.borrowernumber = borrowers.borrowernumber
! and
returndate is not NULL
! order
by returndate desc,timestamp desc";
! warn "$query2";
! $sth2 = $dbh->prepare($query2) || die $dbh->errstr;
! $sth2->execute($data->{'itemnumber'}) || die $sth2->errstr;
! for (my $i2 = 0; $i2 < 2; $i2++) { # FIXME : error if there is less
than 3 pple borrowing this item
if (my $data2 = $sth2->fetchrow_hashref) {
$data->{"timestamp$i2"} = $data2->{'timestamp'};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Biblio.pm,1.26,1.27 Output.pm,1.31,1.32 Search.pm,1.50,1.51,
Paul POULAIN <=