From ed932be618da24b226cd6404eb2f526886dbd781 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 11 May 2016 14:19:41 +0000 Subject: [PATCH] Bug 16493: acq matching on title and author When you order from a staged file you're getting duplicate warnings that are inaccurate. For example, when you order a file of 50 DVDs for example and they don't have ISBNs they're matching on the books. And then you have to order them one by one. This patch replaces the use of FindDuplicates with Koha's match point system. This means you can select from the same match points defined and used in the batch record importer, or you can opt to skip matching altogether! Test Plan: 1) Import a record with a title, isbn and author. 2) Delete the from the record and stage it again 3) Attempt to add it to a basket via the staged record 4) You should note the gives you the "No records imported" message 5) Apply this patch 6) Create a matcher for ISBN 7) Create a matcher for Author/Title 8) Attempt to add the record to your basket using the ISBN matcher 8) Koha should find no match and import the record to the basket 9) Stage the record again 10) Attempt to add the record to your basket using the Title/Author matcher 11) You should recieve the "No records imported" message. Signed-off-by: Barbara Fondren Signed-off-by: Nicole C Engard Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall --- acqui/addorderiso2709.pl | 11 ++++-- .../prog/en/modules/acqui/addorderiso2709.tt | 35 ++++++++++++++++--- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 9a7739c3b2..adcf507ac6 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -31,7 +31,6 @@ use C4::Auth; use C4::Output; use C4::ImportBatch; use C4::Matcher; -use C4::Search qw/FindDuplicate/; use C4::Acquisition; use C4::Biblio; use C4::Items; @@ -140,6 +139,7 @@ if ($op eq ""){ my @discount = $input->multi_param('discount'); my @sort1 = $input->multi_param('sort1'); my @sort2 = $input->multi_param('sort2'); + my $matcher_id = $input->multi_param('matcher_id'); my $active_currency = Koha::Acquisition::Currencies->get_active; for my $biblio (@$biblios){ # Check if this import_record_id was selected @@ -157,7 +157,14 @@ if ($op eq ""){ # 1st insert the biblio, or find it through matcher unless ( $biblionumber ) { - $duplinbatch=$import_batch_id and next if FindDuplicate($marcrecord); + if ($matcher_id) { + my $matcher = C4::Matcher->fetch($matcher_id); + my @matches = $matcher->get_matches( $marcrecord, my $max_matches = 1 ); + if ( @matches ) { + $duplinbatch = $import_batch_id; + next; + } + } # add the biblio my $bibitemnum; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index c7b04cf290..63425a71c0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -189,10 +189,37 @@
- Check all - Uncheck all - - +
+
+ Select all + | + Clear all + | + + + + + | + + + + +
+
+ -- 2.39.5