X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=admin%2Fcheckmarc.pl;h=3f5f61b6b4834583e358d6a60c88147290d6d7e8;hb=fb98450172cbd446768375cd9374962447df7cfe;hp=8734441f1b70daa2d4d8cbe218f58cf43e30ad9c;hpb=37328c709ecb1e8868c4dd8ce344e844647d8715;p=koha.git diff --git a/admin/checkmarc.pl b/admin/checkmarc.pl index 8734441f1b..3f5f61b6b4 100755 --- a/admin/checkmarc.pl +++ b/admin/checkmarc.pl @@ -5,24 +5,23 @@ # # 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 . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Output; use C4::Auth; -use CGI; +use CGI qw ( -utf8 ); use C4::Context; use C4::Biblio; @@ -30,11 +29,11 @@ use C4::Biblio; my $input = new CGI; my ($template, $borrowernumber, $cookie) - = get_template_and_user({template_name => "admin/checkmarc.tmpl", + = get_template_and_user({template_name => "admin/checkmarc.tt", query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => {parameters => 'parameters_remaining_permissions'}, + flagsrequired => { parameters => 'manage_marc_frameworks' }, debug => 1, }); @@ -244,6 +243,21 @@ if (scalar(@$invalid_authtypecodes) > 0) { $template->param(authtypecode_info => $invalid_authtypecodes); } +# checks items.permanent_location is not mapped +$sth = $dbh->prepare("SELECT frameworkcode, frameworktext, tagfield, tagsubfield + FROM marc_subfield_structure + LEFT JOIN biblio_framework USING (frameworkcode) + WHERE kohafield='permanent_location' OR + kohafield='items.permanent_location'"); +$sth->execute; +my $permanent_location_mapped = $sth->fetchall_arrayref({}); +if (scalar(@$permanent_location_mapped) > 0) { + $total++; + $template->param(permanent_location_mapped => 1); + $template->param(mapped_permanent_location => $permanent_location_mapped); +} + + $template->param(total => $total, );