From 6c34c8b650c1894a7696fc26de72d25ce94f2b5d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 8 Sep 2014 12:28:41 -0300 Subject: [PATCH] Bug 7817: (followup) add test on MARC bibliographic framework test Signed-off-by: Tomas Cohen Arazi --- admin/checkmarc.pl | 15 ++++++++ .../prog/en/modules/admin/checkmarc.tt | 34 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/admin/checkmarc.pl b/admin/checkmarc.pl index a01ccc849d..fbd1252a5d 100755 --- a/admin/checkmarc.pl +++ b/admin/checkmarc.pl @@ -244,6 +244,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, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/checkmarc.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/checkmarc.tt index d93ada7cbf..de9129e7d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/checkmarc.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/checkmarc.tt @@ -222,6 +222,40 @@ all authority types used in the frameworks are defined [% END %] + + [% IF ( permanent_location_mapped ) %] + + items.permanent_location mapped + The following mappings exist for items.permanent_location, and they shouldn't. + + + + + + + + [% FOREACH mapped_perm_loc IN mapped_permanent_location %] + + + [% IF ( mapped_perm_loc.frameworkcode ) %] + + [% ELSE %] + + [% END %] + + + + [% END %] +
Framework codeFramework descriptionTagSubfield
[% mapped_perm_loc.frameworkcode %][% mapped_perm_loc.frameworktext %]Default framework[% mapped_perm_loc.tagfield %][% mapped_perm_loc.tagsubfield %]
+ + + [% ELSE %] + + OK + items.permanent_location is not mapped on the frameworks + + [% END %] + [% IF ( total ) %] -- 2.39.5