X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=admin%2Fcheckmarc.pl;h=8734441f1b70daa2d4d8cbe218f58cf43e30ad9c;hb=6bad4db6a76d719ad6ac7fec2d4c7ec87ec8aa95;hp=6721b2c439071c26c5cd6530619e636401304b3a;hpb=3864b9f0850a7922055ec17cc1163d575620fd65;p=koha_fer diff --git a/admin/checkmarc.pl b/admin/checkmarc.pl index 6721b2c439..8734441f1b 100755 --- a/admin/checkmarc.pl +++ b/admin/checkmarc.pl @@ -14,11 +14,12 @@ # 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., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA +# 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. use strict; +#use warnings; FIXME - Bug 2505 use C4::Output; use C4::Auth; use CGI; @@ -33,7 +34,7 @@ my ($template, $borrowernumber, $cookie) query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => {parameters => 1}, + flagsrequired => {parameters => 'parameters_remaining_permissions'}, debug => 1, }); @@ -168,6 +169,7 @@ while (($res,$res2,$field) = $sth->fetchrow) { } else { $template->param(holdingbranch => 1); $total++; + last; #MR } } @@ -208,7 +210,7 @@ if ($res) { $total++; } -# verify that all of a field's subfields (except the ones explicitly ignore) +# verify that all of a field's subfields (except the ones explicitly ignored) # are in the same tab $sth = $dbh->prepare("SELECT tagfield, frameworkcode, frameworktext, GROUP_CONCAT(DISTINCT tab) AS tabs FROM marc_subfield_structure @@ -224,6 +226,24 @@ if (scalar(@$inconsistent_tabs) > 0) { $template->param(tab_info => $inconsistent_tabs); } +# verify that authtypecodes used in the framework +# are defined in auth_types +$sth = $dbh->prepare("SELECT frameworkcode, frameworktext, tagfield, tagsubfield, authtypecode + FROM marc_subfield_structure + LEFT JOIN biblio_framework USING (frameworkcode) + WHERE authtypecode IS NOT NULL + AND authtypecode <> '' + AND tab > '-1' + AND authtypecode NOT IN (SELECT authtypecode FROM auth_types) + ORDER BY frameworkcode, tagfield, tagsubfield"); +$sth->execute; +my $invalid_authtypecodes = $sth->fetchall_arrayref({}); +if (scalar(@$invalid_authtypecodes) > 0) { + $total++; + $template->param(invalid_authtypecodes => 1); + $template->param(authtypecode_info => $invalid_authtypecodes); +} + $template->param(total => $total, );