From b8d4ad01ca5fc8235bf6a401730bc69ae31159ca Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 20 Jan 2004 12:59:28 +0000 Subject: [PATCH] 2.0.0RC2 build last commits... --- misc/rebuildthesaurus.pl | 81 +++++++++++++++++++++++++++++++++++ misc/release_notes_200RC2.txt | 7 ++- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 misc/rebuildthesaurus.pl diff --git a/misc/rebuildthesaurus.pl b/misc/rebuildthesaurus.pl new file mode 100644 index 0000000000..fd952a3bc2 --- /dev/null +++ b/misc/rebuildthesaurus.pl @@ -0,0 +1,81 @@ +#!/usr/bin/perl +# script that rebuild thesaurus from biblio table. + +use strict; + +# Koha modules used +use MARC::File::USMARC; +use MARC::Record; +use MARC::Batch; +use C4::Context; +use C4::Biblio; +use C4::Authorities; +use Time::HiRes qw(gettimeofday); + +use Getopt::Long; +my ( $input_marc_file, $number) = ('',0); +my ($version, $verbose, $test_parameter, $field,$delete,$category,$subfields); +GetOptions( + 'h' => \$version, + 'd' => \$delete, + 't' => \$test_parameter, + 'f:s' => \$field, + 's:s' => \$subfields, + 'v' => \$verbose, + 'c:s' => \$category, +); + +if ($version || ($category eq '')) { + print < will build authority file NP with value constructed with 700 field \$a, \$b, \$c & \$d subfields +In UNIMARC this rebuild author authority file. +EOF +;# +die; +} + +my $dbh = C4::Context->dbh; +my @subfields = $subfields =~ /(\S)/g; +if ($delete) { + print "deleting thesaurus\n"; + my $sth = $dbh->prepare("delete from bibliothesaurus where category=?"); + $sth->execute($category); +} +if ($test_parameter) { + print "TESTING MODE ONLY\n DOING NOTHING\n===============\n"; +} + +my $starttime = gettimeofday; +my $sth = $dbh->prepare("select bibid from marc_biblio"); +$sth->execute; +my $i; +while (my ($bibid) = $sth->fetchrow) { + my $record = MARCgetbiblio($dbh,$bibid); +# warn $record->as_formatted; + foreach my $fieldwanted ($record->field($field)) { + my $resultstring = $subfields; + foreach my $pair ( $fieldwanted->subfields() ) { + $resultstring =~ s/\$$pair->[0]/$pair->[1]/g; + } + # deals empty subfields + foreach my $empty (@subfields) { + $resultstring =~ s/\$$empty//g; + } + warn "result : $resultstring" if $verbose; + &newauthority($dbh,$category,$resultstring); + $i++; + } + +} +my $timeneeded = gettimeofday - $starttime; +print "$i entries done in $timeneeded seconds\n"; diff --git a/misc/release_notes_200RC2.txt b/misc/release_notes_200RC2.txt index 5b17f2b2d0..e27b18e4ad 100644 --- a/misc/release_notes_200RC2.txt +++ b/misc/release_notes_200RC2.txt @@ -2,7 +2,11 @@ RELEASE NOTES ============= This version of Koha is the second in the 2.0 "stable" series. It does not mean that it has no bugs, but least five libraries are using it and don't encounter impossible problems. -If you want to adopt Koha, please do, but you're warned that this release candidate version may still have some bugs and missing features. If you test it and let us know about any we haven't seen yet, it will help us to fix them. +If you want to adopt Koha, please do, but you're warned that this release candidate version may still have some bugs and missing features. +If you test it and let us know about any we haven't seen yet, it will help us to fix them. + +The 2.0.x series version is "feature freezed". Only bugs or minor changes will be made in this branch. +The koha team is already working on the 2.2.x version. In CVS (HEAD branch), developpers can already get 1st draft of a working z3950 server. INSTALLATION @@ -75,6 +79,7 @@ IMPROVEMENTS: * new OPAC theme. it's called "css". It's a XHTML1.0 strict OPAC. In librarian interface, just change systempref opactheme to css to get it. Will be the default opac in 2.2 * publisher added in acquisition process (the one with basket & supplier) Basket now ordered by publisher. * notforloan field management added in itemtype administration screen +* new migration script : misc/rebuildthesaurus.pl => this script can rebuild thesaurus/authority file after importing records with misc/bulkmarcimport.pl DB change : *index added into z3950results table UNIQUE KEY query_server (queryid,server) (added by installer & updater) -- 2.39.5