Bugzilla – Attachment 67355 Details for
Bug 17457
Use SearchWithISBNVariations in acquisition advanced search (histsearch.pl)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17457 - Adv. Acquisition search with ISBN variations
Bug-17457---Adv-Acquisition-search-with-ISBN-varia.patch (text/plain), 2.07 KB, created by
David Bourgault
on 2017-09-25 20:24:03 UTC
(
hide
)
Description:
Bug 17457 - Adv. Acquisition search with ISBN variations
Filename:
MIME Type:
Creator:
David Bourgault
Created:
2017-09-25 20:24:03 UTC
Size:
2.07 KB
patch
obsolete
>From 3b2a457df44d5cd05cc8da0668ea28ab5a2fa41a Mon Sep 17 00:00:00 2001 >From: David Bourgault <david.bourgault@inlibro.com> >Date: Mon, 25 Sep 2017 16:22:51 -0400 >Subject: [PATCH] Bug 17457 - Adv. Acquisition search with ISBN variations > >Advanced acquisition search will now follow the "SearchWithISBNVariations" system preference. > >Test plan : >0) Make sure you have orders pending or completed >1) Enable SearchWithISBNVariations if it is not enabled >2) Search for one of your orders by its ISBN, it should appear >3) Search for the same order by a variation of its ISBN, I used this website to find it : http://www.hahnlibrary.net/libraries/isbncalc.html >You should not get a result. >4) Apply patch >5) Repeat step 2-3. You should get a hit both times. >--- > C4/Acquisition.pm | 25 ++++++++++++++++++++++--- > 1 file changed, 22 insertions(+), 3 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 7639fef..456ea86 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2282,6 +2282,22 @@ sub GetHistory { > my $total_qtyreceived = 0; > my $total_price = 0; > >+ #get variation of isbn >+ my @params; >+ my @isbns; >+ if ($isbn){ >+ if ( C4::Context->preference("SearchWithISBNVariations") ){ >+ @isbns = C4::Koha::GetVariationsOfISBN( $isbn ); >+ foreach my $isb (@isbns){ >+ push @params, '?'; >+ } >+ } >+ unless (@isbns){ >+ push @isbns, $isbn; >+ push @params, '?'; >+ } >+ } >+ > my $dbh = C4::Context->dbh; > my $query =" > SELECT >@@ -2349,10 +2365,13 @@ sub GetHistory { > push @query_params, "%$author%"; > } > >- if ( $isbn ) { >- $query .= " AND biblioitems.isbn LIKE ? "; >- push @query_params, "%$isbn%"; >+ if ( @isbns ) { >+ $query .= " AND ( biblioitems.isbn LIKE " . join (" OR biblioitems.isbn LIKE ", @params ) . ")"; >+ foreach my $isbn (@isbns){ >+ push @query_params, "%$isbn%"; >+ } > } >+ > if ( $ean ) { > $query .= " AND biblioitems.ean = ? "; > push @query_params, "$ean"; >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17457
:
67355
|
67416
|
67417
|
67418
|
67820
|
70279
|
70910