From 1f349f1a921e4cb809d46486964811a32b42b238 Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 4 Jul 2003 13:24:52 +0000 Subject: [PATCH] Checking that all fields mapped to the item marc field (995 in UNIMARC) are mapped to a field in items SQL-table. Previously, you had a warning only if fields mapped to item SQL-table was in more than 1 item marc field. --- admin/checkmarc.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/admin/checkmarc.pl b/admin/checkmarc.pl index 359fc35af0..7b3cc9a2f1 100755 --- a/admin/checkmarc.pl +++ b/admin/checkmarc.pl @@ -68,6 +68,7 @@ if ($res && $res2 && ($res eq $res2) && $tab==-1 && $tab2==-1) { } # checks all item fields are in the same tag and in tab 10 + $sth = $dbh->prepare("select tagfield,tab,kohafield from marc_subfield_structure where kohafield like \"items.%\""); $sth->execute; my $field; @@ -81,6 +82,14 @@ while (($res,$res2,$field) = $sth->fetchrow) { $subtotal++; } } +$sth = $dbh->prepare("select kohafield from marc_subfield_structure where tagfield=$tagfield"); +$sth->execute; +while (($res2) = $sth->fetchrow) { + if (!$res2 || $res2 =~ /^items/) { + } else { + $subtotal++; + } +} if ($subtotal eq 0) { $template->param(itemfields => 0); } else { @@ -91,7 +100,6 @@ if ($subtotal eq 0) { $sth = $dbh->prepare("select tagfield,tab,authorised_value from marc_subfield_structure where kohafield = \"biblioitems.itemtype\""); $sth->execute; ($res,$res2,$field) = $sth->fetchrow; -warn "==> $res / $res2 / $field"; if ($res && $res2>=0 && $field eq "itemtypes") { $template->param(itemtype => 0); } else { -- 2.39.5