From 4443f9828c99f34f2d76fabbff5edbec1f9b5335 Mon Sep 17 00:00:00 2001 From: Slava Shishkin Date: Sun, 24 Apr 2022 00:51:00 +0300 Subject: [PATCH] Bug 28269: Add feature to search Acquisitions Orders by ISSN - add search form field for ISSN number - add search logic including ISSN variations search if SearchWithISSNVariations preference is set Signed-off-by: KIT Library Germany Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- C4/Acquisition.pm | 22 +++++++++++++++++++ acqui/histsearch.pl | 1 + .../prog/en/includes/filter-orders.inc | 1 + 3 files changed, 24 insertions(+) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index bf8a215573..cd2df080f3 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -2085,6 +2085,7 @@ sub GetHistory { my $title = $params{title}; my $author = $params{author}; my $isbn = $params{isbn}; + my $issn = $params{issn}; my $ean = $params{ean}; my $name = $params{name}; my $internalnote = $params{internalnote}; @@ -2126,6 +2127,20 @@ sub GetHistory { } } + #get variation of issn + my @issn_params; + my @issns; + if ($issn){ + if ( C4::Context->preference("SearchWithISSNVariations") ){ + @issns = C4::Koha::GetVariationsOfISSN( $issn ); + push @issn_params, ('?') x @issns; + } + unless (@issns){ + push @issns, $issn; + push @issn_params, '?'; + } + } + my $dbh = C4::Context->dbh; my $query =" SELECT @@ -2204,6 +2219,13 @@ sub GetHistory { } } + if ( @issns ) { + $query .= " AND ( biblioitems.issn LIKE " . join (" OR biblioitems.issn LIKE ", @issn_params ) . ")"; + foreach my $isn (@issns){ + push @query_params, "%$isn%"; + } + } + if ( $ean ) { $query .= " AND biblioitems.ean = ? "; push @query_params, "$ean"; diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl index e1bdb3851f..ff00c28442 100755 --- a/acqui/histsearch.pl +++ b/acqui/histsearch.pl @@ -75,6 +75,7 @@ my $filters = { title => scalar $input->param('title'), author => scalar $input->param('author'), isbn => scalar $input->param('isbn'), + issn => scalar $input->param('issn'), name => scalar $input->param('name'), internalnote => scalar $input->param('internalnote'), vendornote => scalar $input->param('vendornote'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc index 2ba0802684..84db77943d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc @@ -6,6 +6,7 @@
  • +
  • [% IF Koha.Preference('marcflavour') == 'UNIMARC' %]
  • [% END %] -- 2.39.5