Bugzilla – Attachment 38439 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
Bug-12747---Add-extra-column-in-Z3950-search.patch (text/plain), 9.50 KB, created by
Charles Farmer
on 2015-04-23 17:31:21 UTC
(
hide
)
Description:
Bug 12747 - Add extra column in Z3950 search
Filename:
MIME Type:
Creator:
Charles Farmer
Created:
2015-04-23 17:31:21 UTC
Size:
9.50 KB
patch
obsolete
>From 02fba6d726b5c4e3d1211b9603b8cacb21206b57 Mon Sep 17 00:00:00 2001 >From: charles <charles@inlibro.com> >Date: Thu, 23 Apr 2015 11:25:56 -0400 >Subject: [PATCH] Bug 12747 - Add extra column in Z3950 search > >This patch permits to add an extra column in Z3950 search result. >The system preference AdditionalFieldsInZ3950ResultSearch maps which MARC field/subfields are displayed in the column. > >Testing: > >I Apply the patch >II Run updatedatabase.pl > >ACQUISITIONS >0) Enter a field/subfield in the AdditionalFieldsInZ3950ResultSearch; >1) Create a new basket or use an existing one; >2) In -Add order to basket-, click "From an external source"; >3) Select some search targets and enter a subject heading ex. house; >4) Click Search bouton; >5) Validate "Additional fields" column with the field/subfield value. > >CATALOGUING >0) shares same syspref as above >1) Go to cataloguing, click New from z3950 >2) fill to result in a successful search >3) validate column Addition Fields > >sponsored by the CCSR ( http://www.ccsr.qc.ca ) >--- > C4/Breeding.pm | 39 ++++++++++++++++++++++ > ...47-additional_fields_in_Z3950_search_result.sql | 1 + > installer/data/mysql/sysprefs.sql | 2 ++ > .../prog/en/modules/acqui/z3950_search.tt | 13 ++++++++ > .../en/modules/admin/preferences/cataloguing.pref | 4 +++ > .../prog/en/modules/cataloguing/z3950_search.tt | 13 ++++++++ > 6 files changed, 72 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_12747-additional_fields_in_Z3950_search_result.sql > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 18bf03b..a2cf6e6 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -222,6 +222,19 @@ sub Z3950Search { > $oConnection[$_]->destroy(); > } > >+ @servers = (); >+ foreach my $id (@id) { >+ push @servers, {id => $id}; >+ } >+ >+ my $pref_addnumber = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch'); >+ $pref_addnumber =~ s/\s+//g; >+ if ($pref_addnumber){ >+ $template->param( >+ additionalFields => '1', >+ ); >+ } >+ > $template->param( > breeding_loop => \@breeding_loop, > servers => \@servers, >@@ -340,6 +353,32 @@ sub _add_rowdata { > } > $row->{date}//= $row->{date2}; > $row->{isbn}=_isbn_replace($row->{isbn}); >+ >+ my $pref_addnumber = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch'); >+ $pref_addnumber =~ s/\s+//g; >+ my @addnumber_array = split /;/, $pref_addnumber; >+ my @addnumberfields; >+ foreach (@addnumber_array) { >+ my $length = length($_); >+ my $adTag = substr($_, 0, 3); >+ my $row_field = 'field_'.$adTag; >+ if ($record->field($adTag)) { >+ my $field = $record->field($adTag); >+ my $fieldContent=''; >+ if ($length > 3){ >+ my $adSubfield; >+ for (my $i=0; $i<$length-3; $i++){ >+ $adSubfield = substr($_, 3+$i, 1); >+ $fieldContent = $fieldContent.$field->subfield($adSubfield).' '; >+ } >+ push(@addnumberfields, $_); >+ $row->{$_} = $fieldContent; >+ } >+ } >+ } >+ >+ $row->{'addnumberfields'} = \@addnumberfields; >+ > return $row; > } > >diff --git a/installer/data/mysql/atomicupdate/bug_12747-additional_fields_in_Z3950_search_result.sql b/installer/data/mysql/atomicupdate/bug_12747-additional_fields_in_Z3950_search_result.sql >new file mode 100644 >index 0000000..2a6013f >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_12747-additional_fields_in_Z3950_search_result.sql >@@ -0,0 +1 @@ >+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('AdditionalFieldsInZ3950ResultSearch', '', 'NULL', 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index be44611..2bc5c38 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -6,6 +6,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'), > ('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'), > ('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'), >+('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'), >+('AddPatronLists','categorycode','categorycode|category_type','Allow user to choose what list to pick up from when adding patrons','Choice'), > ('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'), > ('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option. Example: eng|fre|ita','Textarea'), > ('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >index 9b89e91..046e402 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >@@ -168,6 +168,9 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > <th>Author</th> > <th>ISBN</th> > <th>LCCN</th> >+ [% IF additionalFields %] >+ <th>Additional fields</th> >+ [% END %] > <th>Preview</th> > <th> </th> > </tr></thead> >@@ -180,6 +183,16 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > <td>[% breeding_loo.author %]</td> > <td>[% breeding_loo.isbn %]</td> > <td>[% breeding_loo.lccn %]</td> >+ [% IF additionalFields %] >+ <td> >+ <dl> >+ [% FOREACH addnumberfield IN breeding_loo.addnumberfields %] >+ <dt>[% addnumberfield %]:</dt> >+ <dd>[% breeding_loo.$addnumberfield %]</dd> >+ [% END %] >+ </dl> >+ </td> >+ [% END %] > <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> |Â <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" title="Card" rel="gb_page_center[600,500]">Card</a></td> > <td><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode %]&breedingid=[% breeding_loo.breedingid %]&booksellerid=[% booksellerid %]&basketno=[% basketno %]">Order</a></td> > >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..a879d32 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 semicolon as delimiter ex: <code>082ab</code>;<code>090ab</code>)" >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt >index 79e8015..1ef8ed1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt >@@ -185,6 +185,9 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > <th>Edition</th> > <th>ISBN</th> > <th>LCCN</th> >+ [% IF additionalFields %] >+ <th>Additional fields</th> >+ [% END %] > <th>MARC</th> > <th>Card</th> > <th> </th> >@@ -200,6 +203,16 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > <td>[% breeding_loo.edition %]</td> > <td>[% breeding_loo.isbn %]</td> > <td>[% breeding_loo.lccn %]</td> >+ [% IF additionalFields %] >+ <td> >+ <dl> >+ [% FOREACH addnumberfield IN breeding_loo.addnumberfields %] >+ <dt>[% addnumberfield %]:</dt> >+ <dd>[% breeding_loo.$addnumberfield %]</dd> >+ [% END %] >+ </dl> >+ </td> >+ [% END %] > <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td> > <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> > <td><a href="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a></td> >-- >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