X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=acqui%2Fcheck_uniqueness.pl;h=b665b34c3a424a7a61a11af4fb9abd6d34513a0a;hb=075ef09f48b66df7766c22e1c9ecf1d3cf7a039a;hp=626004868a3b88b7fd85e1bfa5de7ac46e6ff3cb;hpb=b93e6df3a1b7051bc92220cf6bd829c2229bfa70;p=srvgit diff --git a/acqui/check_uniqueness.pl b/acqui/check_uniqueness.pl index 626004868a..b665b34c3a 100755 --- a/acqui/check_uniqueness.pl +++ b/acqui/check_uniqueness.pl @@ -4,18 +4,18 @@ # # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . # This script search in items table if a value for a given field exists. # It is used in check_additem (additem.js) @@ -31,19 +31,19 @@ use Modern::Perl; -use CGI; -use JSON; -use C4::Output; -use C4::Items; +use CGI qw ( -utf8 ); +use JSON qw( to_json ); +use C4::Output qw( output_with_http_headers ); +use C4::Items qw( SearchItems ); -my $input = new CGI; -my @field = $input->param('field'); -my @value = $input->param('value'); +my $input = CGI->new; +my @field = $input->multi_param('field[]'); +my @value = $input->multi_param('value[]'); my $r = {}; my $i = 0; for ( my $i=0; $i<@field; $i++ ) { - my $items = C4::Items::SearchItems($field[$i], $value[$i]); + my ($items) = C4::Items::SearchItems({ field => $field[$i], query => $value[$i]}); if ( @$items ) { push @{ $r->{$field[$i]} }, $value[$i];