@@ -, +, @@
---
C4/Breeding.pm | 10 +++++++---
installer/data/mysql/atomicupdate/bug_28166.pl | 17 +++++++++++++++++
installer/data/mysql/mandatory/sysprefs.sql | 1 +
.../modules/admin/preferences/authorities.pref | 4 ++++
.../en/modules/cataloguing/z3950_auth_search.tt | 16 ++++++++++++++++
5 files changed, 45 insertions(+), 3 deletions(-)
create mode 100755 installer/data/mysql/atomicupdate/bug_28166.pl
--- a/C4/Breeding.pm
+++ a/C4/Breeding.pm
@@ -314,7 +314,8 @@ sub _handle_one_result {
$row->{server} = $servhref->{servername};
$row->{breedingid} = $breedingid;
$row->{isbn}=_isbn_replace($row->{isbn});
- $row = _add_custom_field_rowdata($row, $marcrecord);
+ my $pref_newtags = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch');
+ $row = _add_custom_field_rowdata($row, $marcrecord, $pref_newtags);
}
return ( $row, $error );
}
@@ -345,8 +346,7 @@ sub _do_xslt_proc {
sub _add_custom_field_rowdata
{
- my ( $row, $record ) = @_;
- my $pref_newtags = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch');
+ my ( $row, $record, $pref_newtags ) = @_;
my $pref_flavour = C4::Context->preference('MarcFlavour');
$pref_newtags =~ s/^\s+|\s+$//g;
@@ -602,6 +602,10 @@ sub Z3950SearchAuth {
$row_data{heading} = $heading;
$row_data{authid} = $authid;
$row_data{heading_code} = $heading_authtype_code;
+ $row_data{row} = _add_custom_field_rowdata(
+ { %row_data }, $marcrecord,
+ C4::Context->preference('AdditionalFieldsInZ3950ResultAuthSearch')
+ ) if C4::Context->preference('AdditionalFieldsInZ3950ResultAuthSearch');
push( @breeding_loop, \%row_data );
}
else {
--- a/installer/data/mysql/atomicupdate/bug_28166.pl
+++ a/installer/data/mysql/atomicupdate/bug_28166.pl
@@ -0,0 +1,17 @@
+use Modern::Perl;
+
+return {
+ bug_number => "28166",
+ description => "Add system preference for additional columns for Z39.50 authority search results",
+ up => sub {
+ my ($args) = @_;
+ my ($dbh, $out) = @$args{qw(dbh out)};
+ # Do you stuffs here
+ $dbh->do(q{INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
+('AdditionalFieldsInZ3950ResultAuthSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of an authority Z39.50 search', 'Free')
+});
+ # Print useful stuff here
+ # sysprefs
+ say $out "Added new system preference 'AdditionalFieldsInZ3950ResultAuthSearch'";
+ },
+};
--- a/installer/data/mysql/mandatory/sysprefs.sql
+++ a/installer/data/mysql/mandatory/sysprefs.sql
@@ -11,6 +11,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
('ActionLogsTraceDepth', '0', '', 'Sets the maximum depth of the action logs stack trace', 'Integer'),
('AdditionalContentsEditor','tinymce','tinymce|codemirror','Choose tool for editing News.', 'Choice'),
+('AdditionalFieldsInZ3950ResultAuthSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of an authority Z39.50 search', 'Free'),
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
('AddressForFailedOverdueNotices', '', NULL, 'Destination email for failed overdue notices. If left empty then it will fallback to the first defined address in the following list: Library ReplyTo, Library Email, ReplytoDefault and KohaAdminEmailAddress', 'free'),
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref
@@ -75,6 +75,10 @@ Authorities:
default: "Work cat."
type: textarea
class: code
+ -
+ - Display the MARC field/subfields
+ - pref: AdditionalFieldsInZ3950ResultAuthSearch
+ - " in the 'Additional fields' column of Z39.50 search results (use comma as delimiter e.g.: \"001, 035$a
\")"
Linker:
-
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt
@@ -1,6 +1,7 @@
[% USE raw %]
[% USE Asset %]
[% PROCESS 'i18n.inc' %]
+[% USE Koha %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]