22 changed files with 110 additions and 683 deletions
@ -1,5 +1,5 @@ |
|||
#!/usr/bin/perl |
|||
# This script finds and fixes missing 090 fields in Koha for MARC21 |
|||
# This script finds and fixes missing biblionumber/biblioitemnumber fields in Koha |
|||
# Written by TG on 01/10/2005 |
|||
# Revised by Joshua Ferraro on 03/31/2006 |
|||
use strict; |
@ -1,51 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
# small script that dumps an iso2709 file. |
|||
|
|||
|
|||
use strict; |
|||
BEGIN { |
|||
# find Koha's Perl modules |
|||
# test carefully before changing this |
|||
use FindBin; |
|||
eval { require "$FindBin::Bin/kohalib.pl" }; |
|||
} |
|||
|
|||
# Koha modules used |
|||
use MARC::File::USMARC; |
|||
use MARC::Record; |
|||
use MARC::Batch; |
|||
|
|||
use Getopt::Long; |
|||
my ( $input_marc_file,$number,$nowarning) = ('',0); |
|||
my $version; |
|||
GetOptions( |
|||
'file:s' => \$input_marc_file, |
|||
'n:s' => \$number, |
|||
'v' => \$version, |
|||
'w' => \$nowarning, |
|||
); |
|||
|
|||
warn "NUM : $number\n"; |
|||
if ($version || ($input_marc_file eq '')) { |
|||
print <<EOF |
|||
small script to dump an iso2709 file. |
|||
parameters : |
|||
\tv : this version/help screen |
|||
\tfile /path/to/file/to/dump : the file to dump |
|||
\tn : the number of the record to dump. If missing, all the file is dumped |
|||
\tw : warning and strict off. If your dump fail, try -w option. It it works, then, the file is iso2709, but a buggy one ! |
|||
SAMPLE : ./dumpmarc.pl -file /home/paul/koha.dev/local/npl -n 1 |
|||
EOF |
|||
; |
|||
die; |
|||
} |
|||
|
|||
my $batch = MARC::Batch->new( 'USMARC', $input_marc_file ); |
|||
$batch->warnings_off() unless $nowarning; |
|||
$batch->strict_off() unless $nowarning; |
|||
my $i=1; |
|||
while ( my $record = $batch->next() ) { |
|||
print "\nNUMBER $i =>\n".$record->as_formatted() if ($i eq $number || $number eq 0); |
|||
$i++; |
|||
} |
|||
print "\n==================\n$i record parsed\n"; |
@ -1,148 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use C4::Context; |
|||
use Getopt::Long; |
|||
use C4::Biblio; |
|||
|
|||
# |
|||
# script that checks zebradir structure & create directories & mandatory files if needed |
|||
# |
|||
# |
|||
|
|||
$|=1; # flushes output |
|||
|
|||
print "Zebra directory =>".C4::Context->zebraconfig('biblioserver')->{directory}."\n"; |
|||
print "Koha directory =>".C4::Context->config('intranetdir')."\n"; |
|||
|
|||
my $zebradir = C4::Context->zebraconfig('biblioserver')->{directory}; |
|||
my $kohadir = C4::Context->config('intranetdir'); |
|||
my $directory; |
|||
my $skip_export; |
|||
my $keep_export; |
|||
GetOptions( |
|||
'd:s' => \$directory, |
|||
's' => \$skip_export, |
|||
'k' => \$keep_export, |
|||
); |
|||
|
|||
$directory = "export" unless $directory; |
|||
|
|||
my $created_dir_or_file = 0; |
|||
print "====================\n"; |
|||
print "checking directories & files\n"; |
|||
print "====================\n"; |
|||
unless (-d "$zebradir") { |
|||
system("mkdir -p $zebradir"); |
|||
print "created $zebradir\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
unless (-d "$zebradir/lock") { |
|||
mkdir "$zebradir/lock"; |
|||
print "created $zebradir/lock\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
unless (-d "$zebradir/register") { |
|||
mkdir "$zebradir/register"; |
|||
print "created $zebradir/register\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
unless (-d "$zebradir/shadow") { |
|||
mkdir "$zebradir/shadow"; |
|||
print "created $zebradir/shadow\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
unless (-d "$zebradir/tab") { |
|||
mkdir "$zebradir/tab"; |
|||
print "created $zebradir/tab\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
|
|||
unless (-d "$zebradir/etc") { |
|||
mkdir "$zebradir/etc"; |
|||
print "created $zebradir/etc\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
|
|||
unless (-f "$zebradir/tab/record.abs") { |
|||
system("cp -f $kohadir/zebraplugin/zebradb/biblios/tab/record_for_unimarc.abs $zebradir/tab/record.abs"); |
|||
print "copied record.abs\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
unless (-f "$zebradir/tab/sort-string-utf.chr") { |
|||
system("cp -f $kohadir/zebraplugin/zebradb/biblios/tab/sort-string-utf.chr $zebradir/tab/sort-string-utf.chr"); |
|||
print "copied sort-string-utf.chr\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
unless (-f "$zebradir/tab/word-phrase-utf.chr") { |
|||
system("cp -f $kohadir/zebraplugin/zebradb/biblios/tab/word-phrase-utf.chr $zebradir/tab/word-phrase-utf.chr"); |
|||
print "copied word-phase-utf.chr\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
unless (-f "$zebradir/tab/bib1.att") { |
|||
system("cp -f $kohadir/zebraplugin/zebradb/biblios/tab/bib1.att $zebradir/tab/bib1.att"); |
|||
print "copied bib1.att\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
|
|||
unless (-f "$zebradir/etc/zebra-biblios.cfg") { |
|||
system("cp -f $kohadir/zebraplugin/etc/zebra-biblios.cfg $zebradir/etc/zebra-biblios.cfg"); |
|||
print "copied zebra-biblios.cfg\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
unless (-f "$zebradir/etc/ccl.properties") { |
|||
system("cp -f $kohadir/zebraplugin/etc/ccl.properties $zebradir/etc/ccl.properties"); |
|||
print "copied ccl.properties\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
unless (-f "$zebradir/etc/pqf.properties") { |
|||
system("cp -f $kohadir/zebraplugin/etc/pqf.properties $zebradir/etc/pqf.properties"); |
|||
print "copied pqf.properties\n"; |
|||
$created_dir_or_file++; |
|||
} |
|||
|
|||
if ($created_dir_or_file) { |
|||
print "created : $created_dir_or_file directories & files\n"; |
|||
} else { |
|||
print "file & directories OK\n"; |
|||
} |
|||
|
|||
if ($skip_export) { |
|||
print "====================\n"; |
|||
print "SKIPPING biblio export\n"; |
|||
print "====================\n"; |
|||
} else { |
|||
print "====================\n"; |
|||
print "exporting biblios\n"; |
|||
print "====================\n"; |
|||
mkdir "$directory" unless (-d $directory); |
|||
open(OUT,">:utf8","$directory/export") or die $!; |
|||
my $dbh=C4::Context->dbh; |
|||
my $sth; |
|||
$sth=$dbh->prepare("select biblionumber from biblioitems order by biblionumber"); |
|||
$sth->execute(); |
|||
my $i=0; |
|||
while (my ($biblionumber) = $sth->fetchrow) { |
|||
my $record = MARCgetbiblio($dbh,$biblionumber); |
|||
print "."; |
|||
print "\r$i" unless ($i++ %100); |
|||
print OUT $record->as_usmarc(); |
|||
} |
|||
close(OUT); |
|||
} |
|||
|
|||
print "====================\n"; |
|||
print "REINDEXING zebra\n"; |
|||
print "====================\n"; |
|||
system("zebraidx -g iso2709 -c $zebradir/etc/zebra-biblios.cfg -d biblios update $directory"); |
|||
system("zebraidx -g iso2709 -c $zebradir/etc/zebra-biblios.cfg -d biblios commit"); |
|||
|
|||
print "====================\n"; |
|||
print "CLEANING\n"; |
|||
print "====================\n"; |
|||
if ($k) { |
|||
print "NOTHING cleaned : the $directory has been kept. You can re-run this script with the -s parameter if you just want to rebuild zebra after changing the record.abs or another zebra config file\n"; |
|||
} else { |
|||
system("rm -rf $zebradir"); |
|||
print "directory $zebradir deleted\n"; |
|||
} |
|||
} |
@ -1,47 +0,0 @@ |
|||
#!/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::AuthoritiesMarc; |
|||
use Time::HiRes qw(gettimeofday); |
|||
|
|||
use Getopt::Long; |
|||
my ( $input_marc_file, $number) = ('',0); |
|||
my ($version,$confirm); |
|||
GetOptions( |
|||
'h' => \$version, |
|||
'c' => \$confirm, |
|||
); |
|||
|
|||
if ($version || ($confirm eq '')) { |
|||
print <<EOF |
|||
Script that compare the datas in the DB and the setting of MARC structure |
|||
It show all fields/subfields that are in the MARC DB but NOT in any tab (= fields used but not visible) Usually, this means you made an error in your MARC editor. Sometimes, this is something normal. |
|||
|
|||
Enter $0 -c to run this script (the -c being here only to "confirm" |
|||
EOF |
|||
;# |
|||
exit; |
|||
}#/ |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
print "Checking\n"; |
|||
my $sth = $dbh->prepare("SELECT count(*), tag, subfieldcode, frameworkcode FROM marc_subfield_table, marc_biblio WHERE marc_biblio.bibid = marc_subfield_table.bibid group by frameworkcode,tag,subfieldcode"); |
|||
$sth->execute; |
|||
my $sth2 = $dbh->prepare("select tab,liblibrarian,kohafield from marc_subfield_structure where tagfield=? and tagsubfield=? and frameworkcode=?"); |
|||
while (my ($total,$tag,$subfield,$frameworkcode) = $sth->fetchrow) { |
|||
$sth2->execute($tag,$subfield,$frameworkcode); |
|||
my ($tab,$liblibrarian,$kohafield) = $sth2->fetchrow; |
|||
if ($tab eq -1 && $kohafield ne "biblio.biblionumber" && $kohafield ne "biblioitems.biblioitemnumber" && $kohafield ne "items.itemnumber") { |
|||
print "Tab ignore for framework $frameworkcode, $tag\$$subfield - $liblibrarian (used $total times)\n"; |
|||
} |
|||
} |
|||
|
|||
print "Done\n"; |
@ -1,53 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
# small script that import an iso2709 file into koha 2.0 |
|||
|
|||
use strict; |
|||
|
|||
# Koha modules used |
|||
use MARC::File::USMARC; |
|||
use MARC::Record; |
|||
use MARC::Batch; |
|||
use C4::Context; |
|||
use C4::Biblio; |
|||
use Time::HiRes qw(gettimeofday); |
|||
|
|||
use Getopt::Long; |
|||
my ( $input_marc_file, $number) = ('',0); |
|||
my ($confirm); |
|||
GetOptions( |
|||
'c' => \$confirm, |
|||
); |
|||
|
|||
unless ($confirm) { |
|||
print <<EOF |
|||
|
|||
script to write files for zebra DB reindexing. Once it's done, run zebraidx update biblios |
|||
|
|||
run the script with -c to confirm the reindexing. |
|||
|
|||
EOF |
|||
;#' |
|||
die; |
|||
} |
|||
|
|||
$|=1; # flushes output |
|||
|
|||
my $dbh = C4::Context->dbh; |
|||
my $cgidir = C4::Context->intranetdir."/"; |
|||
|
|||
my $starttime = gettimeofday; |
|||
my $sth = $dbh->prepare("select biblionumber from biblio"); |
|||
$sth->execute; |
|||
my $i=0; |
|||
while ((my $biblionumber) = $sth->fetchrow) { |
|||
my $record = GetMarcBiblio($biblionumber); |
|||
my $filename = $cgidir."/tmp/BIBLIO".$biblionumber.".iso2709"; |
|||
open F,">:utf8", $filename; |
|||
eval {print F $record->as_usmarc(); }; |
|||
warn "ERROR: writing biblio $biblionumber failed" if $@; |
|||
close F; |
|||
$i++; |
|||
print "\r$i" unless ($i % 100); |
|||
} |
|||
my $timeneeded = gettimeofday - $starttime; |
|||
print "\n$i MARC record done in $timeneeded seconds\n"; |
@ -1,21 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
use strict; |
|||
use ZOOM; |
|||
|
|||
my $query="Introduction"; |
|||
warn "QUERY : $query"; |
|||
my $Zconn; |
|||
eval { |
|||
$Zconn = new ZOOM::Connection('localhost:2100/Koha'); |
|||
}; |
|||
$Zconn->option(cqlfile => "/home/paul/koha.dev/head/zebra/pqf.properties"); |
|||
my $q = new ZOOM::Query::CQL2RPN( $query, $Zconn); |
|||
# warn "Q : $q"; |
|||
my $rs= $Zconn->search($q); |
|||
my $n = $rs->size()-1; |
|||
print "found ".($n+1)." results"; |
|||
for my $i (0..$n) { |
|||
my $rec = $rs->record($i); |
|||
print $rec->render(); |
|||
} |
|||
# warn "ERROR : ".$Zconn->errcode(); |
@ -0,0 +1,8 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
use ExtUtils::Installed; |
|||
my $instmod = ExtUtils::Installed->new(); |
|||
foreach my $module ($instmod->modules()) { |
|||
my $version = $instmod->version($module) || "???"; |
|||
print "$module -- $version\n"; |
|||
} |
@ -0,0 +1,19 @@ |
|||
#!/usr/bin/perl -w |
|||
# Remove a perl module |
|||
use ExtUtils::Packlist; |
|||
use ExtUtils::Installed; |
|||
|
|||
$ARGV[0] or die "Usage: $0 Module::Name\n"; |
|||
|
|||
my $mod = $ARGV[0]; |
|||
|
|||
my $inst = ExtUtils::Installed->new(); |
|||
|
|||
foreach my $item (sort($inst->files($mod))) { |
|||
print "removing $item\n"; |
|||
unlink $item; |
|||
} |
|||
|
|||
my $packfile = $inst->packlist($mod)->packlist_file(); |
|||
print "removing $packfile\n"; |
|||
unlink $packfile; |
@ -1,92 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
#----------------------------------- |
|||
# Script Name: rebuild_marc_newframework.pl |
|||
# Script Version: 0.1.0 |
|||
# Date: 20/04/2006 |
|||
##If you change your framework for marc mapping use this script to recreate marc records in your db |
|||
## Then drop the old framework and install the new one.New frameworks are being introduced with Koha3.0 |
|||
##Re-export all your marc and recreate Zebra db. |
|||
##Writen by Tumer Garip tgarip@neu.edu.tr |
|||
|
|||
|
|||
|
|||
use strict; |
|||
BEGIN { |
|||
# find Koha's Perl modules |
|||
# test carefully before changing this |
|||
use FindBin; |
|||
eval { require "$FindBin::Bin/kohalib.pl" }; |
|||
} |
|||
|
|||
use C4::Context; |
|||
use C4::Biblio; |
|||
use MARC::Record; |
|||
use MARC::File::USMARC; |
|||
use MARC::File::XML; |
|||
|
|||
my $dbh=C4::Context->dbh; |
|||
use Time::HiRes qw(gettimeofday); |
|||
|
|||
##Write the corresponding new mappings below. this one maps old 090$c$d to new 09o$c$d and 952 holdings of NEU to 95k values |
|||
##Adjust this mapping list to your own needs |
|||
my %mapping_list = ( |
|||
'090cd' =>'09ocd', |
|||
'952abcdefpruvxyz'=>'95kkbcfazpw9d4ye', |
|||
); |
|||
|
|||
my $starttime = gettimeofday; |
|||
my $sth=$dbh->prepare("SELECT biblionumber,marc FROM biblioitems "); |
|||
$sth->execute; |
|||
|
|||
my $update=$dbh->prepare("update biblioitems set marc=?,marcxml=? where biblionumber=?"); |
|||
|
|||
my $b=0; |
|||
my $timeneeded; |
|||
while (my ($biblionumber, $marc) = $sth->fetchrow) { |
|||
|
|||
my $record=MARC::File::USMARC::decode($marc); |
|||
|
|||
foreach my $key (keys %mapping_list){ |
|||
my $tag=substr($key,0,3); |
|||
my $newtag=substr($mapping_list{$key},0,3); |
|||
my @subf; |
|||
my @newsub; |
|||
for (my $i=3; $i<length($key); $i++){ |
|||
push @subf,substr($key,$i,1); |
|||
push @newsub,substr($mapping_list{$key},$i,1); |
|||
}## |
|||
|
|||
foreach my $field ($record->field($tag)){ |
|||
my $notnew=1; |
|||
my $addedfield; |
|||
for (my $r=0; $r<@subf; $r++){ |
|||
if ($field->subfield($subf[$r]) && $notnew){ |
|||
$addedfield=MARC::Field->new($newtag,$field->indicator(1),$field->indicator(2),$newsub[$r]=>$field->subfield($subf[$r])); |
|||
$notnew=0; |
|||
}elsif ($field->subfield($subf[$r])){ |
|||
$addedfield->update($newsub[$r]=>$field->subfield($subf[$r])); |
|||
}## a subfield exists |
|||
}## all subfields added |
|||
$record->delete_field($field); |
|||
$record->add_fields($addedfield); |
|||
}##foreach field found |
|||
##Now update-db |
|||
$update->execute($record->as_usmarc,$record->as_xml_record,$biblionumber); |
|||
|
|||
}##foreach $key |
|||
$timeneeded = gettimeofday - $starttime unless ($b % 10000); |
|||
print "$b in $timeneeded s\n" unless ($b % 10000); |
|||
print "." unless ($b % 500); |
|||
$b++; |
|||
}##while biblionumber |
|||
|
|||
##Dont forget to export all new marc records and build your zebra db |
|||
|
|||
|
|||
# $timeneeded = gettimeofday - $starttime unless ($i % 30000); |
|||
# print "$i in $timeneeded s\n" unless ($i % 30000); |
|||
# print "." unless ($i % 500); |
|||
# $i++; |
|||
|
|||
|
|||
$dbh->disconnect(); |
@ -1,5 +1,6 @@ |
|||
#!/usr/bin/perl |
|||
|
|||
# check the current SAX Parser |
|||
use XML::SAX::ParserFactory; |
|||
$parser = XML::SAX::ParserFactory->parser(); |
|||
print $parser; |
|||
print "$parser\n"; |
|||
|
@ -0,0 +1,22 @@ |
|||
#!/usr/bin/perl |
|||
use XML::SAX; |
|||
my $parser = XML::SAX::ParserFactory->parser( |
|||
Handler => MySAXHandler->new |
|||
); |
|||
binmode STDOUT, ":utf8"; |
|||
print "\x{65}\x{301}\n"; |
|||
use Encode; $parser->parse_string(encode_utf8("<xml>\x{65}\x{301}</xml>")); |
|||
$parser->parse_string("<xml>\xEF\xBB\xBF\x{65}\x{301}</xml>"); |
|||
|
|||
package MySAXHandler; |
|||
|
|||
use base qw(XML::SAX::Base); |
|||
sub start_document { |
|||
my ($self, $doc) = @_; |
|||
# process document start event |
|||
} |
|||
|
|||
sub start_element { |
|||
my ($self, $el) = @_; |
|||
# process element start event |
|||
} |
@ -1,164 +0,0 @@ |
|||
#!/usr/bin/perl -w |
|||
|
|||
use strict; |
|||
BEGIN { |
|||
# find Koha's Perl modules |
|||
# test carefully before changing this |
|||
use FindBin; |
|||
eval { require "$FindBin::Bin/kohalib.pl" }; |
|||
} |
|||
use C4::Context; |
|||
use Getopt::Long; |
|||
|
|||
my %opt = (); |
|||
GetOptions( |
|||
\%opt, |
|||
qw/head_dir=s rel_2_2_dir=s help/ |
|||
) or die "\nHouston, we got a problem\n"; |
|||
|
|||
if (exists $opt{help}) { |
|||
print <<FIN; |
|||
Sync the Koha plugin with the appropriate files from HEAD. Assumes |
|||
that you've set up your Koha install to use CVS symlinked to the |
|||
normal locations. |
|||
|
|||
Usage: sync_koha_plugin.pl --head_dir=<cvs head directory> |
|||
--rel_2_2_dir=<cvs rel_2_2 directory> |
|||
[--help] |
|||
|
|||
--head_dir: is the directory where your Koha HEAD cvs is checked out. |
|||
|
|||
--rel_2_2_dir: is the directory where your Koha rel_2_2 cvs is checked |
|||
out and symlinked to your Koha install directories. |
|||
|
|||
--help: show this help |
|||
|
|||
FIN |
|||
|
|||
exit(0); |
|||
} |
|||
# Configurable Variables |
|||
foreach my $option (qw/head_dir rel_2_2_dir/) { |
|||
if (not exists $opt{$option}) { |
|||
die 'option "', $option, '" is mandatory', "\n"; |
|||
} |
|||
|
|||
if (not -d $opt{$option}) { |
|||
die '"', $opt{$option}, '" must be an existing directory', "\n"; |
|||
} |
|||
|
|||
if (not $opt{$option} =~ m{^/}) { |
|||
die '--', $option, ' must be an absolute path', "\n"; |
|||
} |
|||
} |
|||
|
|||
## Modules |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/C4/Biblio.pm', |
|||
$opt{rel_2_2_dir}.'/C4/' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/C4/Context.pm', |
|||
$opt{rel_2_2_dir}.'/C4/' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/C4/SearchMarc.pm', |
|||
$opt{rel_2_2_dir}.'/C4/' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/C4/Log.pm', |
|||
$opt{rel_2_2_dir}.'/C4/' |
|||
); |
|||
|
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/C4/Review.pm', |
|||
$opt{rel_2_2_dir}.'/C4/' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/misc/plugin/Search.pm', |
|||
$opt{rel_2_2_dir}.'/C4/' |
|||
); |
|||
|
|||
## Intranet |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/cataloguing/addbiblio.pl', |
|||
$opt{rel_2_2_dir}.'/acqui.simple/addbiblio.pl' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/cataloguing/additem.pl', |
|||
$opt{rel_2_2_dir}.'/acqui.simple/' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/catalogue/detail.pl', |
|||
$opt{rel_2_2_dir}.'/' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/catalogue/MARCdetail.pl', |
|||
$opt{rel_2_2_dir}.'/' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/catalogue/ISBDdetail.pl', |
|||
$opt{rel_2_2_dir}.'/' |
|||
); |
|||
|
|||
# OPAC |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/opac/opac-detail.pl', |
|||
$opt{rel_2_2_dir}.'/opac/' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/opac/opac-MARCdetail.pl', |
|||
$opt{rel_2_2_dir}.'/opac/' |
|||
); |
|||
system( |
|||
'cp', |
|||
$opt{head_dir}.'/opac/opac-ISBDdetail.pl', |
|||
$opt{rel_2_2_dir}.'/opac/' |
|||
); |
|||
|
|||
## Add the symlink necessary due to changes in the dir structure |
|||
system( |
|||
'ln', |
|||
'-s', |
|||
$opt{rel_2_2_dir}.'/koha-tmpl/intranet-tmpl/npl/en/acqui.simple', |
|||
$opt{rel_2_2_dir}.'/koha-tmpl/intranet-tmpl/npl/en/cataloguing' |
|||
); |
|||
|
|||
## Add the 'record.abs' symlink |
|||
system( |
|||
'ln', |
|||
'-s', |
|||
$opt{head_dir}.'/misc/zebra/usmarc/collection.abs', |
|||
$opt{head_dir}.'/misc/zebra/usmarc/record.abs' |
|||
); |
|||
|
|||
## Create symlink from intranet/zebra to head zebra directory |
|||
system( |
|||
'ln', |
|||
'-s', |
|||
$opt{head_dir}.'/misc/zebra/usmarc', |
|||
C4::Context->config("intranetdir").'/zebra' |
|||
); |
|||
|
|||
print "Finished\n\nRemember, you still need to: |
|||
|
|||
1. Edit moredetail.tmpl and detail.tmpl to allow for deletions |
|||
|
|||
2. add <option value=''>Relevance</option> to the search |
|||
pages to sort by relevance by default |
|||
|
|||
\n"; |
|||
|
@ -1,46 +0,0 @@ |
|||
#!/usr/bin/perl |
|||
# script that correct the marcxml from in biblioitems |
|||
# Written by TG on 10/04/2006 |
|||
use strict; |
|||
BEGIN { |
|||
# find Koha's Perl modules |
|||
# test carefully before changing this |
|||
use FindBin; |
|||
eval { require "$FindBin::Bin/kohalib.pl" }; |
|||
} |
|||
|
|||
# Koha modules used |
|||
|
|||
use C4::Context; |
|||
use C4::Biblio; |
|||
use MARC::Record; |
|||
use MARC::File::USMARC; |
|||
use MARC::File::XML; |
|||
use Time::HiRes qw(gettimeofday); |
|||
|
|||
my $starttime = gettimeofday; |
|||
my $timeneeded; |
|||
my $dbh = C4::Context->dbh; |
|||
my $sth=$dbh->prepare("select biblionumber,marc from biblioitems "); |
|||
$sth->execute(); |
|||
$dbh->do("LOCK TABLES biblioitems WRITE"); |
|||
my $i=0; |
|||
my $sth2 = $dbh->prepare("UPDATE biblioitems set marcxml=? where biblionumber=?" ); |
|||
|
|||
|
|||
while (my ($biblionumber,$marc)=$sth->fetchrow ){ |
|||
|
|||
my $record = MARC::File::USMARC::decode($marc); |
|||
my $xml=$record->as_xml_record(); |
|||
$sth2->execute($xml,$biblionumber); |
|||
|
|||
print "." unless ($i % 100); |
|||
$timeneeded = gettimeofday - $starttime unless ($i % 5000); |
|||
print "$i records in $timeneeded s\n" unless ($i % 5000); |
|||
$i++; |
|||
} |
|||
$dbh->do("UNLOCK TABLES "); |
|||
$timeneeded = gettimeofday - $starttime ; |
|||
print "$i records in $timeneeded s\n" ; |
|||
|
|||
END; |
Loading…
Reference in new issue