Bugzilla – Attachment 38286 Details for
Bug 12747
Add configurable extra column in Z3950 search result
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12747 - Add extra column in Z3950 search result
Bug-12747---Add-extra-column-in-Z3950-search-resul.patch (text/plain), 4.02 KB, created by
Charles Farmer
on 2015-04-21 15:57:42 UTC
(
hide
)
Description:
Bug 12747 - Add extra column in Z3950 search result
Filename:
MIME Type:
Creator:
Charles Farmer
Created:
2015-04-21 15:57:42 UTC
Size:
4.02 KB
patch
obsolete
>From 90e197d6a4f02b0700c8e53b4298bf588f886691 Mon Sep 17 00:00:00 2001 >From: charles <charles@inlibro.com> >Date: Mon, 20 Apr 2015 17:24:29 -0400 >Subject: [PATCH] Bug 12747 - Add extra column in Z3950 search result > >This patch uses the standard field syntax (ex: 023$ab), allows writing fields without mentionning subfields and uses whitespace as a field separator instead of semicolon. > >sponsored by the CCSR ( http://www.ccsr.qc.ca ) >--- > C4/Breeding.pm | 56 ++++++++++++++++++++++ > .../en/modules/admin/preferences/cataloguing.pref | 4 ++ > 2 files changed, 60 insertions(+) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 252d03b..2de5cc7 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -25,6 +25,7 @@ use C4::Biblio; > use C4::Koha; > use C4::Charset; > use MARC::File::USMARC; >+use MARC::Field; > use C4::ImportBatch; > use C4::AuthoritiesMarc; #GuessAuthTypeCode, FindDuplicateAuthority > use C4::Languages; >@@ -222,6 +223,23 @@ sub Z3950Search { > $oConnection[$_]->destroy(); > } > >+<<<<<<< HEAD >+======= >+ my @servers = (); >+ foreach my $id (@id) { >+ push @servers, {id => $id}; >+ } >+ >+ my $pref_addnumber = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch'); >+ $pref_addnumber =~ s/^\s+|\s+$//g; >+ $pref_addnumber =~ s/\h+/ /g; >+ if ($pref_addnumber){ >+ $template->param( >+ additionalFields => '1', >+ ); >+ } >+ >+>>>>>>> c4c12ed... Bug 12747 - Add extra column in Z3950 search result > $template->param( > breeding_loop => \@breeding_loop, > servers => \@servers, >@@ -340,6 +358,44 @@ sub _add_rowdata { > } > $row->{date}//= $row->{date2}; > $row->{isbn}=_isbn_replace($row->{isbn}); >+ >+ my $pref_addnumber = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch'); >+ $pref_addnumber =~ s/^\s+|\s+$//g; >+ $pref_addnumber =~ s/\h+/ /g; >+ my @addnumber_array = split / /, $pref_addnumber; >+ my @addnumberfields; >+ foreach (@addnumber_array) { >+ my $length = length($_); >+ my $adTag = substr($_, 0, 3); >+ if ($record->field($adTag)) { >+ my $field = $record->field($adTag); >+ my $fieldContent=''; >+ if ($length > 3){ >+ my $adSubfield; >+ for (my $i=0; $i<$length-4; $i++){ # 4 because 3 digits, 1 dollar sign ($) >+ $adSubfield = substr($_, 4+$i, 1); >+ $fieldContent = $fieldContent.$field->subfield($adSubfield).' '; >+ } >+ push(@addnumberfields, $_); >+ $row->{$_} = $fieldContent; >+ } >+ else { >+ if($adTag <= 10){ >+ my $data = $field->data(); >+ push(@addnumberfields, $_); >+ $row->{$_} = $data; >+ } >+ else { >+ my $subfields_text = $field->as_string(); >+ push(@addnumberfields, $_); >+ $row->{$_} = $subfields_text; >+ } >+ } >+ } >+ } >+ >+ $row->{'addnumberfields'} = \@addnumberfields; >+ > return $row; > } > >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 bc35aad..c200c2b 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 >@@ -215,3 +215,7 @@ Cataloging: > 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. Note that this preference has no effect if UseQueryParser is on. >+ - >+ - Determines the MARC field/subfields >+ - pref: AdditionalFieldsInZ3950ResultSearch >+ - "are displayed in 'Additional fields' column in the result of a search Z3950 (use whitespace as delimiter ex: <code>082$ab</code> <code>090$ab</code>)" >-- >1.9.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 12747
:
30713
|
36823
|
37836
|
37893
|
38221
|
38233
|
38240
|
38286
|
38439
|
38440
|
38456
|
38457
|
38458
|
38460
|
41313
|
41317
|
41318
|
41319
|
58424
|
58425
|
58426
|
60965
|
66586
|
66587
|
66588
|
66589
|
67314
|
67315
|
68214
|
68215
|
69297
|
72706
|
72896
|
72897
|
72898
|
72979
|
72980
|
72981
|
73930
|
73955
|
74035
|
74037
|
74038
|
74039
|
74040
|
74783
|
74784
|
74785
|
74786
|
74787
|
75096
|
77729
|
78270
|
78271
|
78272
|
78687
|
78688
|
79349
|
79350
|
79351