Bugzilla – Attachment 120154 Details for
Bug 28166
Optionally add MARC fields to authority search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28166: optionally add marc fields to authority search
Bug-28166-optionally-add-marc-fields-to-authority-.patch (text/plain), 14.60 KB, created by
Mark Hofstetter
on 2021-04-25 09:29:10 UTC
(
hide
)
Description:
Bug 28166: optionally add marc fields to authority search
Filename:
MIME Type:
Creator:
Mark Hofstetter
Created:
2021-04-25 09:29:10 UTC
Size:
14.60 KB
patch
obsolete
>From b2dddce0083e30a399bc76973148ae8498e81676 Mon Sep 17 00:00:00 2001 >From: Mark Hofstetter <mark@hofstetter.at> >Date: Sun, 25 Apr 2021 10:33:07 +0200 >Subject: [PATCH] Bug 28166: optionally add marc fields to authority search > >this patch creates a new syspref: AdditionalFieldsInZ3950AuthResultSearch, analogous to AdditionalFieldsInZ3950ResultSearch > >if this syspref is populated with with comma separated marc fields (eg '100, 400') those fields are displayed in in the z3950_auth_search > >C4/Breeding.pm was slightly modified to be able to use "_add_custom_field_rowdata" to add the additonal fields > >koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt was modified to display the "Addtional fields" conditionally > >testing: >- add set values to AdditionalFieldsInZ3950AuthResultSearch the should show up in the auth_search >- AdditionalFieldsInZ3950ResultSearch should also be tested as it is also concerned >--- > C4/Breeding.pm | 19 +++-- > ...lFieldsInZ3950ResultAuthSearch_syspref.sql | 7 ++ > .../admin/preferences/cataloguing.pref | 78 +++++++++---------- > .../modules/cataloguing/z3950_auth_search.tt | 17 +++- > 4 files changed, 73 insertions(+), 48 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_28166-add_AdditionalFieldsInZ3950ResultAuthSearch_syspref.sql > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 6b103b3cdb..d00f4714e1 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -364,15 +364,17 @@ sub _add_rowdata { > $row->{date}//= $row->{date2}; > $row->{isbn}=_isbn_replace($row->{isbn}); > >- $row = _add_custom_field_rowdata($row, $record); >- >+ $row = _add_custom_field_rowdata( >+ $row, >+ $record, >+ C4::Context->preference('AdditionalFieldsInZ3950ResultSearch')) >+ if C4::Context->preference('AdditionalFieldsInZ3950ResultSearch'); > return $row; > } > > 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; >@@ -618,8 +620,6 @@ sub Z3950SearchAuth { > my $heading; > my $heading_authtype_code; > $heading_authtype_code = GuessAuthTypeCode($marcrecord); >- next if ( not defined $heading_authtype_code ) ; >- > $heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marcrecord }); > > my $breedingid = ImportBreedingAuth( $marcrecord, $serverhost[$k], $encoding[$k], $heading ); >@@ -629,6 +629,13 @@ sub Z3950SearchAuth { > $row_data{heading} = $heading; > $row_data{authid} = $authid; > $row_data{heading_code} = $heading_authtype_code; >+ my $pref_newtags = >+ C4::Context->preference('AdditionalFieldsInZ3950ResultAuthSearch'); >+ if ($pref_newtags) { >+ my $row = {}; >+ $row = _add_custom_field_rowdata($row, $marcrecord, $pref_newtags); >+ $row_data{row} = $row; >+ } > push( @breeding_loop, \%row_data ); > } > else { >diff --git a/installer/data/mysql/atomicupdate/bug_28166-add_AdditionalFieldsInZ3950ResultAuthSearch_syspref.sql b/installer/data/mysql/atomicupdate/bug_28166-add_AdditionalFieldsInZ3950ResultAuthSearch_syspref.sql >new file mode 100644 >index 0000000000..7c4d074d83 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_28166-add_AdditionalFieldsInZ3950ResultAuthSearch_syspref.sql >@@ -0,0 +1,7 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( "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 auth search Z3950', 'Free')" ); >+ >+ # Always end with this (adjust the bug info) >+ NewVersion( $DBversion, XXXXX, "Description"); >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index 5ffd9a22f3..44a3386d49 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >@@ -9,39 +9,31 @@ Cataloging: > - > - pref: advancedMARCeditor > choices: >- 1: "Don't display" >- 0: Display >+ yes: "Don't display" >+ no: Display > - descriptions of fields and subfields in the MARC editor. > - > - pref: EasyAnalyticalRecords > choices: >- 1: Display >- 0: "Don't display" >+ yes: Display >+ no: "Don't display" > - "easy ways to create analytical record relationships." > - > - pref: EnableAdvancedCatalogingEditor > default: 0 > choices: >- 1: Enable >- 0: "Don't enable" >+ yes: Enable >+ no: "Don't enable" > - the advanced cataloging editor. > - "<br/> <strong>NOTE:</strong>" > - Currently does not include support for UNIMARC or NORMARC fixed fields. >- - >- - "When saving in a MARC/MARCXML file in the advanced cataloging editor or exporting from the detail page in the staff interface, use the" >- - pref: DefaultSaveRecordFileID >- default: biblionumber >- choices: >- controlnumber: "control number" >- biblionumber: "bibliographic record number" >- - "in the file name." > Spine labels: > - > - When using the quick spine label printer, > - pref: SpineLabelAutoPrint > choices: >- 1: do >- 0: "don't" >+ yes: do >+ no: "don't" > - automatically pop up a print dialog. > - > - "Include the following fields on a quick-printed spine label:" >@@ -51,8 +43,8 @@ Cataloging: > - > - pref: SpineLabelShowPrintOnBibDetails > choices: >- 1: Display >- 0: "Don't display" >+ yes: Display >+ no: "Don't display" > - buttons on the bibliographic details page to print item spine labels. > - > Record structure: >@@ -63,7 +55,7 @@ Cataloging: > - > - "Fill in the default country code for field 008 Range 15-17 of MARC21 - Place of publication, production, or execution. (See <a href='http://www.loc.gov/marc/countries/countries_code.html'>MARC Code List for Countries</a>):" > - pref: DefaultCountryField008 >- - " Empty defaults to ||| - No attempt to code." >+ - " Empty defaults to xxu for United States." > - > - Interpret and store MARC records in the > - pref: marcflavour >@@ -76,8 +68,8 @@ Cataloging: > - Use the item type of the > - pref: item-level_itypes > choices: >- 1: specific item >- 0: bibliographic record >+ yes: specific item >+ no: bibliographic record > - as the authoritative item type (for determining circulation and fines rules, for displaying an item type icon on either opac detail or results page, etc). > - > - Map the MARC subfields >@@ -102,8 +94,8 @@ Cataloging: > - > - pref: z3950NormalizeAuthor > choices: >- 1: Copy >- 0: "Don't copy" >+ yes: Copy >+ no: "Don't copy" > - authors from the UNIMARC > - pref: z3950AuthorAuthFields > class: multi >@@ -121,8 +113,8 @@ Cataloging: > - When a new item is added, > - pref: PrefillItem > choices: >- 1: the new item is prefilled with last created item values. >- 0: the new item is not prefilled with last created item values. >+ yes: the new item is prefilled with last created item values. >+ no: the new item is not prefilled with last created item values. > - > - "Define a list of subfields to use when prefilling items (separated by space):" > - pref: SubfieldsToUseWhenPrefill >@@ -171,8 +163,8 @@ Cataloging: > - > - pref: UseControlNumber > choices: >- 1: Use >- 0: "Don't use" >+ yes: Use >+ no: "Don't use" > - record control number ($w subfields) and control number (001) for linking of bibliographic records. > - > - Use >@@ -185,8 +177,8 @@ Cataloging: > - > - pref: hide_marc > choices: >- 1: "Don't display" >- 0: Display >+ yes: "Don't display" >+ no: Display > - MARC tag numbers, subfield codes and indicators in MARC views. > - > - pref: LabelMARCView >@@ -211,8 +203,8 @@ Cataloging: > - > - pref: OpacSuppression > choices: >- 1: Hide >- 0: "Don't hide" >+ yes: Hide >+ no: "Don't hide" > - bibliographic records marked as suppressed from OPAC search results. > - <br />Restrict the suppression to IP addresses outside of the IP range > - pref: OpacSuppressionByIPRange >@@ -221,8 +213,8 @@ Cataloging: > - <br />Redirect the opac detail page for suppressed records to > - pref: OpacSuppressionRedirect > choices: >- 1: "an explanatory page ('This record is blocked')." >- 0: "the 404 error page ('Not found')." >+ yes: "an explanatory page ('This record is blocked')." >+ no: "the 404 error page ('Not found')." > - "<br />Display the following message on the redirect page for suppressed bibliographic records:" > - pref: OpacSuppressionMessage > type: textarea >@@ -230,8 +222,8 @@ Cataloging: > - > - pref: SeparateHoldings > choices: >- 1: Separate >- 0: "Don't separate" >+ yes: Separate >+ no: "Don't separate" > - "items display into two tabs, where the first tab contains items whose" > - pref: SeparateHoldingsBranch > choices: >@@ -248,8 +240,8 @@ Cataloging: > - > - pref: AcquisitionDetails > choices: >- 1: Display >- 0: "Don't display" >+ yes: Display >+ no: "Don't display" > - acquisition details on the bibliographic record detail page. > - > - "Show the following fields for deleted records after a merge:" >@@ -265,19 +257,23 @@ Cataloging: > - When matching on ISBN with the record import tool, > - pref: AggressiveMatchOnISBN > choices: >- 1: "do" >- 0: "don't" >+ yes: "do" >+ no: "don't" > - attempt to match aggressively by trying all variations of the ISBNs in the imported record as a phrase in the ISBN fields of already cataloged records. > - > - Display the MARC field/subfields > - pref: AdditionalFieldsInZ3950ResultSearch > - " in the 'Additional fields' column of Z39.50 search results (use comma as delimiter e.g.: \"<code>001, 082$ab, 090$ab</code>\")" >+ - >+ - Display the MARC field/subfields in Auth Search >+ - pref: AdditionalFieldsInZ3950ResultAuthSearch >+ - " in the 'Additional fields' column of Z39.50 auth search results (use comma as delimiter e.g.: \"<code>100, 400</code>\")" > - > - When matching on ISSN with the record import tool, > - pref: AggressiveMatchOnISSN > choices: >- 1: "do" >- 0: "don't" >+ yes: "do" >+ no: "don't" > - attempt to match aggressively by trying all variations of the ISSNs in the imported record as a phrase in the ISSN fields of already cataloged records. > > Exporting: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt >index ace0b4fcc6..12b24ef11e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt >@@ -80,7 +80,10 @@ > <th>Server</th> > <th>Heading</th> > <th>Authority Type</th> >- <th class="noExport">Actions</th> >+ [% IF Koha.Preference('AdditionalFieldsInZ3950ResultAuthSearch') != '' %] >+ <th>Additional fields</th> >+ [% END %] >+ <th>Actions</th> > </tr></thead> > <tbody>[% FOREACH breeding_loo IN breeding_loop %] > [% IF ( breeding_loo.breedingid ) %] >@@ -88,6 +91,18 @@ > <td>[% breeding_loo.server | html %]</td> > <td>[% breeding_loo.heading | html %]</td> > <td>[% breeding_loo.heading_code | html %]</td> >+ [% IF Koha.Preference('AdditionalFieldsInZ3950ResultAuthSearch') != '' %] >+ <td> >+ <dl> >+ [% FOREACH addnumberfield IN breeding_loo.row.addnumberfields %] >+ [% FOREACH string IN breeding_loo.row.$addnumberfield %] >+ <dt>[% addnumberfield | html %]:</dt> >+ <dd>[% string | html %]</dd> >+ [% END %] >+ [% END %] >+ </dl> >+ </td> >+ [% END %] > <td class="actions"> > <div class="btn-group dropup"> > <a class="btn btn-default btn-xs z3950actions" href="#">MARC</a><button class="btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button> >-- >2.20.1
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 28166
:
120139
|
120154
|
120155
|
148749
|
148755
|
148778
|
150590
|
150594
|
150595
|
150596
|
150601
|
153431
|
156166
|
156167
|
156550
|
156551
|
157646
|
157647