2.0.0RC2 build last commits...

This commit is contained in:
tipaul 2004-01-20 12:59:28 +00:00
parent b7641a787d
commit b8d4ad01ca
2 changed files with 87 additions and 1 deletions

81
misc/rebuildthesaurus.pl Normal file
View File

@ -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 <<EOF
small script to recreate a authority table into Koha.
parameters :
\th : this version/help screen
\tc : thesaurus category
\tv : verbose mode.
\tt : test mode : parses the file, saying what he would do, but doing nothing.
\tf : the field
\ts : the subfields
\d : delete every entry of the selected category before doing work.
SAMPLE : ./bulkmarcimport.pl -c NP -f 700 -s "\$a, \$b (\$c ; \$d)" => 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";

View File

@ -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)