@@ -, +, @@ --- C4/Biblio.pm | 32 ++----- C4/Suggestions.pm | 39 +++----- acqui/duplicatesearch.pl | 80 ++++++++-------- .../prog/en/modules/acqui/duplicatesearch.tt | 98 ++++++++++---------- 4 files changed, 115 insertions(+), 134 deletions(-) --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -3812,32 +3812,20 @@ sub FindBiblios { $query .= " WHERE 1 "; my @query_params = (); - if ( defined $title ) { - if ( $title eq ""){ - - } else { - $query .= " AND biblio.title LIKE ? "; - $title =~ s/\s+/%/g; - push @query_params, "%$title%"; - } + if ( defined $title and $title ne "" ) { + $query .= " AND biblio.title LIKE ? "; + $title =~ s/\s+/%/g; + push @query_params, "%$title%"; } - if ( defined $author ) { - if( $author eq ""){ - - } else { - $query .= " AND biblio.author LIKE ? "; - push @query_params, "%$author%"; - } + if ( defined $author and $author ne "" ) { + $query .= " AND biblio.author LIKE ? "; + push @query_params, "%$author%"; } - if ( defined $isbn) { - if ( $isbn eq ""){ - - } else { - $query .= " AND biblioitems.isbn LIKE ? "; - push @query_params, "%$isbn%"; - } + if ( defined $isbn and $isbn ne "" ) { + $query .= " AND biblioitems.isbn LIKE ? "; + push @query_params, "%$isbn%"; } my $sth = $dbh->prepare($query); --- a/C4/Suggestions.pm +++ a/C4/Suggestions.pm @@ -485,36 +485,27 @@ sub FindSuggestions { my $title = $params{title}; my $author = $params{author}; my $isbn = $params{isbn}; - my $querysug="SELECT title, author, isbn, STATUS, suggestionid FROM suggestions"; - $querysug .=" WHERE 1"; + my $querysug = qq{ + SELECT title, author, isbn, STATUS, suggestionid + FROM suggestions + WHERE 1 + }; my @query_sug = (); - if ( defined $title ) { - if ( $title eq ""){ - - } else { - $querysug .= " AND suggestions.title LIKE ? "; - $title =~ s/\s+/%/g; - push @query_sug, "%$title%"; - } + if ( defined $title and $title ne "" ) { + $querysug .= " AND suggestions.title LIKE ? "; + $title =~ s/\s+/%/g; + push @query_sug, "%$title%"; } - if ( defined $author ) { - if( $author eq ""){ - - } else { - $querysug .= " AND suggestions.author LIKE ? "; - push @query_sug, "%$author%"; - } + if ( defined $author and $author ne "" ) { + $querysug .= " AND suggestions.author LIKE ? "; + push @query_sug, "%$author%"; } - if ( defined $isbn) { - if ( $isbn eq ""){ - - } else { - $querysug .= " AND suggestions.isbn LIKE ? "; - push @query_sug, "%$isbn%"; - } + if ( defined $isbn and $isbn ne "" ) { + $querysug .= " AND suggestions.isbn LIKE ? "; + push @query_sug, "%$isbn%"; } my $sth = $dbh->prepare($querysug); $sth->execute( @query_sug ); --- a/acqui/duplicatesearch.pl +++ a/acqui/duplicatesearch.pl @@ -30,8 +30,7 @@ This script is used to search duplicate orders, suggestions and catalog records =cut -use strict; -use warnings; +use Modern::Perl; use CGI; use C4::Auth; # get_template_and_user use C4::Output; @@ -41,11 +40,11 @@ use C4::Biblio; use C4::Debug; use C4::Search; -my $input = new CGI; -my $title = $input->param( 'title'); -my $author = $input->param('author'); -my $isbn = $input->param('isbn'); -my $op = $input->param('op'); +my $input = new CGI; +my $title = $input->param('title'); +my $author = $input->param('author'); +my $isbn = $input->param('isbn'); +my $op = $input->param('op'); # getting the template my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -54,52 +53,55 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { acquisition => 'group_manage', acquisition => 'order_manage', acquisition => 'order_receive' }, - debug => 1, + flagsrequired => { + acquisition => 'group_manage', + acquisition => 'order_manage', + acquisition => 'order_receive' + }, + debug => 1, } ); - -if ($op eq "result"){ - my ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) = GetHistory( - title => $title, - author => $author, - isbn => $isbn, - name => undef, - from_placed_on => undef, - to_placed_on => undef, - basket => undef, - booksellerinvoicenumber => undef, - ); +if ( $op eq "result" ) { + my ( $order_loop, $total_qty, $total_price, $total_qtyreceived ) = + GetHistory( + title => $title, + author => $author, + isbn => $isbn, + name => undef, + from_placed_on => undef, + to_placed_on => undef, + basket => undef, + booksellerinvoicenumber => undef, + ); my $sugg_loop = FindSuggestions( - title => $title, - author => $author, - isbn => $isbn, - ); + title => $title, + author => $author, + isbn => $isbn, + ); my $bib_loop = FindBiblios( - title => $title, - author => $author, - isbn => $isbn - ); - + title => $title, + author => $author, + isbn => $isbn + ); $template->param( - result => 1, - orders_loop => $order_loop, - sugg_loop => $sugg_loop, - bib_loop => $bib_loop, - numresults_order => scalar(@$order_loop), - numresults_sugg => scalar(@$sugg_loop), - numresults_bib => scalar(@$bib_loop), + result => 1, + orders_loop => $order_loop, + sugg_loop => $sugg_loop, + bib_loop => $bib_loop, + numresults_order => scalar(@$order_loop), + numresults_sugg => scalar(@$sugg_loop), + numresults_bib => scalar(@$bib_loop), ); } $template->param( - title => $title, + title => $title, author => $author, - isbn => $isbn, + isbn => $isbn, ); output_html_with_http_headers $input, $cookie, $template->output; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicatesearch.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicatesearch.tt @@ -38,77 +38,77 @@ $(function(){
Basket Name | -Order Number | -Summary | -Vendor | +Basket Name | +Order Number | +Summary | +Vendor |
---|---|---|---|---|---|---|---|
[% orders_loo.basketname %] | -[% orders_loo.ordernumber %] | -[% orders_loo.title |html %] [% orders_loo.author %] |
- [% orders_loo.name %] | +[% orders_loo.basketname %] | +[% orders_loo.ordernumber %] | +[% orders_loo.title |html %] [% orders_loo.author %] |
+ [% orders_loo.name %] |
Title | Author | ISBN | -
---|---|---|
[% bib_loo.title %] | +||
[% bib_loo.title %] | [% bib_loo.author %] | [% bib_loo.isbn %] | -