Bugzilla – Attachment 106851 Details for
Bug 15933
Add cataloguing plugin to search for existing publishers in other records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15933: Add cataloguing plugin to search for existing publishers in other records
Bug-15933-Add-cataloguing-plugin-to-search-for-exi.patch (text/plain), 3.48 KB, created by
Owen Leonard
on 2020-07-13 19:27:58 UTC
(
hide
)
Description:
Bug 15933: Add cataloguing plugin to search for existing publishers in other records
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-07-13 19:27:58 UTC
Size:
3.48 KB
patch
obsolete
>From 76f59753b759ce367b1f9861511becad767137ea Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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. >--- > cataloguing/value_builder/marc21_field_260b.pl | 59 ++++++++++++++++++++++++++ > koha-tmpl/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 <http://www.gnu.org/licenses>. >+ >+=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 = " >+<script> >+ function Focus$function_name(event) { >+ var tagfield = jQuery( this ); >+ tagfield.autocomplete({ >+ source: '/cgi-bin/koha/cataloguing/ysearch.pl?table=biblioitems&field=publishercode', >+ minLength: 3, >+ select: function( event, ui ) { >+ tagfield.val( ui.item.fieldvalue ); >+ return false; >+ } >+ }) >+ .data( 'ui-autocomplete' )._renderItem = function( ul, item ) { >+ return jQuery( '<li></li>' ) >+ .data( 'ui-autocomplete-item', item ) >+ .append( '<a>' + item.fieldvalue + '</a>' ) >+ .appendTo( ul ); >+ }; >+ return 1; >+ } >+</script> >+"; >+ 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.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15933
:
106851
|
110110
|
110126
|
110835