Koha/C4/SIP/interactive_item_dump.pl
Jonathan Druart c6e488f4af Bug 17196: Move marcxml out of the biblioitems table
Two discussions on koha-devel lead to the same conclusion:
biblioitems.marcxml should be moved out this table
- biblio and biblioitems
http://lists.koha-community.org/pipermail/koha-devel/2013-April/039239.html
- biblioitems.marcxml & biblioitems.marc / HUGE performance issue !
http://lists.koha-community.org/pipermail/koha-devel/2016-July/042821.html

There are several goals to do it:
- Performance
As Paul Poulain wrote, a simple query like
  SELECT publicationyear, count(publicationyear) FROM biblioitems GROUP BY publicationyear;
takes more than 10min on a DB with more than 1M bibliographic records
but only 3sec (!) on the same DB without the biblioitems.marcxml field
Note that priori to this patch set, the biblioitems.marcxml was not
retrieved systematically, but was, at least, in
C4::Acquisition::GetOrdersByBiblionumber and C4::Acquisition::GetOrders
- Flexibility
Storing the marcxml in a specific table would allow use to store several
kind of metadata (USMARC, MARCXML, MIJ, etc.) and different formats (marcflavour)
- Clean code
It would be a first step toward Koha::MetadataRecord for bibliographic
records (not done in this patch set).

Test plan:
- Update the DBIC Schema
- Add / Edit / Delete / Import / Export bibliographic records
- Add items
- Reindex records using ES
- Confirm that the following scripts still work:
    * misc/cronjobs/delete_records_via_leader.pl
    * misc/migration_tools/build_oai_sets.pl
- Look at the reading history at the OPAC (opac-readingrecord.pl)
- At the OPAC, click on a tag, you must see the result

Note: Changes in Koha/OAI/Server/ListRecords.pm is planned on bug 15108.

Signed-off-by: Mason James <mtj@kohaaloha.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Zeno Tajoli <z.tajoli@cineca.it>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-01-13 13:49:26 +00:00

44 lines
1.2 KiB
Perl
Executable file

#!/usr/bin/perl
#
use warnings;
use strict;
use C4::SIP::ILS::Item;
use Data::Dumper;
my $compare = (@ARGV) ? shift : 0;
while (1) {
print "Enter item barcode: ";
my $in = <>;
defined($in) or last;
chomp($in);
last unless $in;
my $item = C4::SIP::ILS::Item->new($in);
unless ($item) {
print "No item ($in)";
next;
}
for (qw(marc marcxml)) { # Letting it just in case but should not longer be useful
$item->{$_} = 'suppressed...';
}
my $queue = $item->hold_queue();
print "Item ($in): ", Dumper($item);
print "hold_queue: ", Dumper($queue);
my $holdernumber;
if ($queue and scalar(@$queue)) {
$holdernumber = $queue->[0]->{borrowernumber};
print "first borrowernumber: $holdernumber\n";
}
if ($compare) {
print "Enter patron barcode: ";
my $barcode = <>;
defined($barcode) or next;
chomp($barcode);
next unless $barcode;
my $x = ILS::Item::_barcode_to_borrowernumber($barcode) || 'UNDEF';
print " converts to: $x\n";
printf " compares as: %s\n",
($item->barcode_is_borrowernumber($barcode,$holdernumber) ? 'TRUE' : 'FALSE');
}
}