[Koha-cvs] CVS: koha/C4 Biblio.pm,NONE,1.1 Catalogue.pm,1.18,1.19

Paul POULAIN tipaul at users.sourceforge.net
Fri Jun 14 18:47:35 CEST 2002


Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv14856

Modified Files:
	Catalogue.pm 
Added Files:
	Biblio.pm 
Log Message:
Going to MARC 1.4...

0- Requires MARC::Record from cpan to work

1- divided Catalogue.pm in 2 parts : 
Biblio.pm ,that contains biblio management
Catalogue.pm, that contains acquisition management.
When ended, they will replace the Acquisition.pm package

2- Created MARCxxx functions :
* MARCgetbiblio : retrieves a MARC::Record from the bibid passed in parameter (working, see test.pl script)
* MARCaddbiblio : creates a MARC-DB entry, for a MARC::Record given as parameter. (working)
* MARCmodsubfield : modifies a subfield for a given subfieldid
* MARCfingsubfield : retrieves a subfieldvalue from a bibid/tag/subfield
* MARCaddsubfield : adds a subfield to biblio into the DB
* MARCkoha2marc : builds a MARC::Record, given a biblionumber, a biblioitemnumber and/or an itemnumber. (working). 


TODO :
A lot ;-))))
For instance, you can create only a MARC-DB entry from a old-DB entry. Note some questions are still to solve around bibid (old-DB/MARC-DB)...




--- NEW FILE ---
package C4::Biblio; 

# Contains all sub used for biblio management. tables :
# biblio, biblioitems, items
# bibliosubject, bibliosubtitle

use strict;
require Exporter;
use C4::Database;
use MARC::Record;

use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);

# set the version for version checking
$VERSION = 0.01;

@ISA = qw(Exporter);
@EXPORT = qw(
	     &MARCmodsubfield &MARCaddsubfield &MARCfindsubfield 
[...1857 lines suppressed...]
    if ($database eq 'kohadb') {
	my $type=shift;
	my $section=shift;
	my $item=shift;
	my $original=shift;
	my $new=shift;
	print STDERR "KOHA: $type $section $item $original $new\n";
    } elsif ($database eq 'marc') {
	my $type=shift;
	my $Record_ID=shift;
	my $tag=shift;
	my $mark=shift;
	my $subfield_ID=shift;
	my $original=shift;
	my $new=shift;
	print STDERR "MARC: $type $Record_ID $tag $mark $subfield_ID $original $new\n";
    }
}

END { }       # module clean-up code here (global destructor)

Index: Catalogue.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Catalogue.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** Catalogue.pm	10 Jun 2002 20:49:54 -0000	1.18
--- Catalogue.pm	14 Jun 2002 16:47:33 -0000	1.19
***************
*** 14,17 ****
--- 14,18 ----
  use C4::Database;
  use MARC::Record;
+ use C4::Biblio;
  
  use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
***************
*** 21,40 ****
  
  @ISA = qw(Exporter);
[...2697 lines suppressed...]
  }
  
! sub insertsup {
!   my ($data)=@_;
    my $dbh=C4Connect;
!   my $sth=$dbh->prepare("Select max(id) from aqbooksellers");
    $sth->execute;
!   my $data2=$sth->fetchrow_hashref;
    $sth->finish;
!   $data2->{'max(id)'}++;
!   $sth=$dbh->prepare("Insert into aqbooksellers (id) values ($data2->{'max(id)'})");
    $sth->execute;
    $sth->finish;
+   $data->{'id'}=$data2->{'max(id)'};
    $dbh->disconnect;
!   updatesup($data);
!   return($data->{'id'});
! }
  
  sub websitesearch {





More information about the Koha-cvs mailing list