From f90afe5c22445fb47430f629491d09762beeb3f8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 13 Jul 2020 17:42:36 +0000 Subject: [PATCH] Bug 15933: Add cataloguing plugin to search for existing publishers in other records This patch adds a new cataloging plugin for MARC21 installations, marc21_field-260b.pl. When enabled it provides autocomplete for publisher name, pulling existing data from biblioitems.publishercode. To test, apply the patch and enable the plugin: - Go to Administration -> MARC bibliographic framework -> MARC structure -> 260 -> Edit subfields -> Subfield b -> Other options. - Set "Plugin" to marc21_field_260b.pl. - Go to Cataloging and edit or create a record. - Under tab 2 click the field for 260$b. Start typing a publisher name. A dropdown should appear with matching publishers. - Selecting one of the results should populate the form field with that information. Signed-off-by: Sally Signed-off-by: Katrin Fischer Also works with 264$b. Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart --- .../value_builder/marc21_field_260b.pl | 59 +++++++++++++++++++ .../intranet-tmpl/prog/css/addbiblio.css | 4 ++ 2 files changed, 63 insertions(+) create mode 100644 cataloguing/value_builder/marc21_field_260b.pl diff --git a/cataloguing/value_builder/marc21_field_260b.pl b/cataloguing/value_builder/marc21_field_260b.pl new file mode 100644 index 0000000000..406feb4122 --- /dev/null +++ b/cataloguing/value_builder/marc21_field_260b.pl @@ -0,0 +1,59 @@ +#!/usr/bin/perl + +# Copyright 2020 Athens County Public Libraries +# +# 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 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. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +=head1 SYNOPSIS + +This plugin is used to fill 260$a with a value already existing in +biblioitems.publishercode + +=cut + +use Modern::Perl; +use C4::Context; + +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; + + my $res = " + +"; + return $res; +}; + +return { builder => $builder }; diff --git a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css index 1b642eced3..baf3f2138d 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css +++ b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css @@ -349,3 +349,7 @@ tbody tr.active td { width: 16em; } } + +.ui-autocomplete { + z-index: 2000; +} -- 2.39.5