Bug 21921: Add date publication year to biblio Z39.50 search form
authorJosef Moravec <josef.moravec@gmail.com>
Fri, 30 Nov 2018 09:06:22 +0000 (09:06 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 17 Feb 2020 13:44:23 +0000 (13:44 +0000)
Test plan:

1) Apply the patch
2) Have a Z39.50 endpoint with attr 31 defined - Library of Congress
supports this
3) Try to find some biblio records through Z39.50 using the new field
"Publication year"

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/Breeding.pm
cataloguing/z3950_search.pl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt

index a93189c..5d2f49b 100644 (file)
@@ -258,6 +258,7 @@ sub _bib_build_query {
         controlnumber => '@attr 1=12 "#term" ',
         srchany => '@attr 1=1016 "#term" ',
         stdid   => '@attr 1=1007 "#term" ',
+        publicationyear => '@attr 1=31 "#term" '
     };
 
     return _build_query( $pars, $qry_build );
index dcc2581..e4fce45 100755 (executable)
@@ -42,6 +42,7 @@ my $dewey         = $input->param('dewey');
 my $controlnumber = $input->param('controlnumber');
 my $stdid         = $input->param('stdid');
 my $srchany       = $input->param('srchany');
+my $publicationyear = $input->param('publicationyear');
 my $op            = $input->param('op')||'';
 
 my $page            = $input->param('current_page') || 1;
@@ -68,6 +69,7 @@ $template->param(
     biblionumber => $biblionumber,
     dewey        => $dewey,
     subject      => $subject,
+    publicationyear => $publicationyear,
 );
 
 if ( $op ne "do_search" ) {
@@ -111,6 +113,7 @@ my $pars= {
         controlnumber => $controlnumber,
         stdid => $stdid,
         srchany => $srchany,
+        publicationyear => $publicationyear,
 };
 Z3950Search($pars, $template);
 output_html_with_http_headers $input, $cookie, $template->output;
index e020742..0029dc2 100644 (file)
@@ -31,6 +31,8 @@
                                 <li>
                                     <label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author | html %]" /></li>
                                 <li>
+                                    <label for="publicationyear">Publication year: </label> <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear | html %]" /></li>
+                                <li>
                                     <label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
                                 <li>
                                     <label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li>
@@ -88,6 +90,7 @@
                         You searched for:
                         [% IF ( title ) %]<em>Title: </em><span class="term">[% title | html %]</span> [% END %]
                         [% IF ( author ) %]<em>Author: </em><span class="term">[% author | html %]</span> [% END %]
+                        [% IF ( publicationyear ) %]<em>Publication year: </em><span class="term">[% publicationyear | html %]</span> [% END %]
                         [% IF ( isbn ) %]<em>ISBN: </em><span class="term">[% isbn | html %]</span> [% END %]
                         [% IF ( issn ) %]<em>ISSN: </em><span class="term">[% issn | html %]</span> [% END %]
                         [% IF ( lccall ) %]<em>LC call number: </em><span class="term">[% lccall | html %]</span> [% END %]
                             <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
                             <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
                             <input type="hidden" id="author" name="author" value="[% author | html %]" />
+                            <input type="hidden" id="publicationyear" name="publicationyear" value="[% publicationyear | html %]" />
                             <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
                             <input type="hidden" id="dewey" name="dewey" value="[% dewey | html %]" />
                             <input type="hidden" id="stdid" name="stdid" value="[% stdid | html %]" />