Bugzilla – Attachment 19957 Details for
Bug 10096
Add a Z39.50 interface for authority searching
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10096 [FOLLOW-UP] - Add a z39.50 interface for authority searching
Bug-10096-FOLLOW-UP---Add-a-z3950-interface-for-au.patch (text/plain), 14.19 KB, created by
David Cook
on 2013-07-26 05:59:24 UTC
(
hide
)
Description:
Bug 10096 [FOLLOW-UP] - Add a z39.50 interface for authority searching
Filename:
MIME Type:
Creator:
David Cook
Created:
2013-07-26 05:59:24 UTC
Size:
14.19 KB
patch
obsolete
>From a798c53730fb7b341e6337fee2e2ca64267d7716 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 13 May 2013 11:46:09 +1000 >Subject: [PATCH] Bug 10096 [FOLLOW-UP] - Add a z39.50 interface for authority > searching > >This patch adds the "recordtype" column to the "z3950servers" table. > >The value in this column (biblio or authority) then controls whether >the z3950 server shows up in a bibliographic search (through the >Acq and Cataloguing modules) or in an authority search (through >the Authorities module). > >I also edited the z3950 management console to show this value >and allow users to edit it. The default value is "biblio", since >the vast majority of z3950 targets will be bibliographic. However, >there is an option to add/edit a z3950 target as a source of >authority records. > >Test Plan: > >1) Apply both patches >2) Run updatedatabase.pl (after setting your KOHA_CONF and PERL5 >environmental variables) >3) Use the test plan from the 1st patch > >N.B. Make sure that your Z39.50 client target has a Record Type >of Authority, otherwise it won't display when you're doing a >Z3950 search for authorities. > >Signed-off-by: Mason James <mtj@kohaaloha.com> >--- > acqui/z3950_search.pl | 2 +- > admin/z3950servers.pl | 22 +++++++++++-------- > cataloguing/z3950_auth_search.pl | 2 +- > cataloguing/z3950_search.pl | 2 +- > installer/data/mysql/kohastructure.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 ++++++ > .../prog/en/modules/admin/z3950servers.tt | 19 +++++++++++++++- > .../en/modules/cataloguing/z3950_auth_search.tt | 2 +- > 8 files changed, 42 insertions(+), 15 deletions(-) > >diff --git a/acqui/z3950_search.pl b/acqui/z3950_search.pl >index 647db8c..f9c1ab5 100755 >--- a/acqui/z3950_search.pl >+++ b/acqui/z3950_search.pl >@@ -93,7 +93,7 @@ $template->param( > ); > > if ( $op ne "do_search" ) { >- my $sth = $dbh->prepare("select id,host,name,checked from z3950servers order by host"); >+ my $sth = $dbh->prepare("select id,host,name,checked from z3950servers where recordtype <> 'authority' order by host"); > $sth->execute(); > my $serverloop = $sth->fetchall_arrayref( {} ); > $template->param( >diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl >index 87711c1..c1e657c 100755 >--- a/admin/z3950servers.pl >+++ b/admin/z3950servers.pl >@@ -40,7 +40,7 @@ sub StringSearch { > $searchstring = ''; > } > >- my $query = "SELECT host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout"; >+ my $query = "SELECT host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype"; > $query .= " FROM z3950servers"; > if ( $searchstring ne '' ) { $query .= " WHERE (name like ?)" } > $query .= " ORDER BY rank,name"; >@@ -91,7 +91,7 @@ if ($op eq 'add_form') { > my $data; > if ($searchfield) { > my $dbh = C4::Context->dbh; >- my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout from z3950servers where (name = ?) order by rank,name"); >+ my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"); > $sth->execute($searchfield); > $data=$sth->fetchrow_hashref; > $sth->finish; >@@ -99,7 +99,7 @@ if ($op eq 'add_form') { > $template->param( $_ => $data->{$_} ) > for ( qw( host port db userid password checked rank timeout encoding ) ); > $template->param( $_ . $data->{$_} => 1) >- for ( qw( syntax ) ); >+ for ( qw( syntax recordtype ) ); > # END $OP eq ADD_FORM > ################## ADD_VALIDATE ################################## > # called by add_form, used to insert/modify data in DB >@@ -110,7 +110,7 @@ if ($op eq 'add_form') { > my $checked = $input->param('checked') ? 1 : 0; > if ($sth->rows) { > $template->param(confirm_update => 1); >- $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=? where name=?"); >+ $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=? where name=?"); > $sth->execute($input->param('host'), > $input->param('port'), > $input->param('db'), >@@ -122,6 +122,7 @@ if ($op eq 'add_form') { > $input->param('syntax'), > $input->param('encoding'), > $input->param('timeout'), >+ $input->param('recordtype'), > $input->param('searchfield'), > ); > } >@@ -129,8 +130,8 @@ if ($op eq 'add_form') { > $template->param(confirm_add => 1); > $sth=$dbh->prepare( > "INSERT INTO z3950servers " . >- "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout) " . >- "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); >+ "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype) " . >+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); > $sth->execute( > $input->param( 'host' ), > $input->param( 'port' ), >@@ -142,7 +143,8 @@ if ($op eq 'add_form') { > $input->param( 'rank' ), > $input->param( 'syntax' ), > $input->param( 'encoding' ), >- $input->param( 'timeout' ) ); >+ $input->param( 'timeout' ), >+ $input->param( 'recordtype' ) ); > } > $sth->finish; > # END $OP eq ADD_VALIDATE >@@ -152,7 +154,7 @@ if ($op eq 'add_form') { > $template->param(delete_confirm => 1); > my $dbh = C4::Context->dbh; > >- my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout from z3950servers where (name = ?) order by rank,name"); >+ my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"); > $sth2->execute($searchfield); > my $data=$sth2->fetchrow_hashref; > $sth2->finish; >@@ -166,6 +168,7 @@ if ($op eq 'add_form') { > rank => $data->{'rank'}, > syntax => $data->{'syntax'}, > timeout => $data->{'timeout'}, >+ recordtype => $data->{'recordtype'}, > encoding => $data->{'encoding'} ); > > # END $OP eq DELETE_CONFIRM >@@ -197,7 +200,8 @@ if ($op eq 'add_form') { > rank => $results->[$i]{'rank'}, > syntax => $results->[$i]{'syntax'}, > encoding => $results->[$i]{'encoding'}, >- timeout => $results->[$i]{'timeout'}); >+ timeout => $results->[$i]{'timeout'}, >+ recordtype => $results->[$i]{'recordtype'}); > push @loop, \%row; > > } >diff --git a/cataloguing/z3950_auth_search.pl b/cataloguing/z3950_auth_search.pl >index 11a8b10..9fbddbd 100755 >--- a/cataloguing/z3950_auth_search.pl >+++ b/cataloguing/z3950_auth_search.pl >@@ -70,7 +70,7 @@ $template->param( > ); > > if ( $op ne "do_search" ) { >- my $sth = $dbh->prepare("SELECT id,host,name,checked FROM z3950servers ORDER BY rank, name"); >+ my $sth = $dbh->prepare("SELECT id,host,name,checked FROM z3950servers WHERE recordtype = 'authority' ORDER BY rank, name"); > $sth->execute(); > my $serverloop = $sth->fetchall_arrayref( {} ); > $template->param( >diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl >index 8534190..a754c45 100755 >--- a/cataloguing/z3950_search.pl >+++ b/cataloguing/z3950_search.pl >@@ -74,7 +74,7 @@ $template->param( > ); > > if ( $op ne "do_search" ) { >- my $sth = $dbh->prepare("SELECT id,host,name,checked FROM z3950servers ORDER BY rank, name"); >+ my $sth = $dbh->prepare("SELECT id,host,name,checked FROM z3950servers WHERE recordtype <> 'authority' ORDER BY rank, name"); > $sth->execute(); > my $serverloop = $sth->fetchall_arrayref( {} ); > $template->param( >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 8a8b70f..d57c2db 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2280,6 +2280,7 @@ CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets u > `type` enum('zed','opensearch') NOT NULL default 'zed', > `encoding` text default NULL, -- characters encoding provided by this target > `description` text NOT NULL, -- unused in Koha >+ `recordtype` varchar(45) NOT NULL default 'biblio', -- server contains bibliographic or authority records > PRIMARY KEY (`id`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 74aeb3e..9c4a11d 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7067,6 +7067,13 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q{ALTER TABLE `z3950servers` ADD COLUMN `recordtype` VARCHAR(45) NOT NULL DEFAULT 'biblio';}); >+ print "Upgrade to $DBversion done (Bug 10096 - Add a Z39.50 interface for authority searching)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >index 4bfdecd..81df25d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >@@ -240,6 +240,20 @@ > <li><label for="timeout">Timeout (0 its like not set): </label> > <input type="text" name="timeout" id="timeout" size="4" value="[% timeout %]" onblur="isNum(this)" /> seconds > </li> >+ <li><label for="recordtype">Record type: </label> >+ <select name="recordtype" id="recordtype"> >+ [% IF ( recordtypebiblio ) %] >+ <option value="biblio" selected="selected">Bibliographic</option> >+ [% ELSE %] >+ <option value="biblio">Bibliographic</option> >+ [% END %] >+ [% IF ( recordtypeauthority ) %] >+ <option value="authority" selected="selected">Authority</option> >+ [% ELSE %] >+ <option value="authority">Authority</option> >+ [% END %] >+ </select> >+ </li> > </ol> > </fieldset> > >@@ -276,6 +290,7 @@ > <li><strong>Syntax: </strong>[% syntax %]</li> > <li><strong>Encoding: </strong>[% encoding %]</li> > <li><strong>Timeout: </strong>[% timeout %]</li> >+ <li><strong>Record type: </strong>[% recordtype %]</li> > </ul> <form action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="submit" value="Delete this server" /></form> <form action="[% script_name %]" method="post"><input type="submit" value="Do not delete" /></form> > > >@@ -301,7 +316,7 @@ > You searched for [% searchfield %] > [% END %] > <table id="serverst"> >- <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th> </th><th> </th> >+ <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th> </th><th> </th> > </tr></thead> > <tbody>[% FOREACH loo IN loop %] > [% UNLESS ( loop.odd ) %] >@@ -309,7 +324,7 @@ > [% ELSE %] > <tr> > [% END %] >-<td><a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td> <td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td><td><a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&searchfield=[% loo.name |url %]">Delete</a></td> </tr> >+<td><a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td> <td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td><td>[% loo.recordtype %]</td><td><a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&searchfield=[% loo.name |url %]">Delete</a></td> </tr> > [% END %]</tbody> > </table> > >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 ff7c320..42a23f8 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 >@@ -109,7 +109,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > <div class="yui-u first"> > <fieldset class="rows"> > <ol> >- <li><label for="srchany">Raw (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li> >+ <li><label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li> > <li><label for="nameany">Name (any): </label> <input type="text" id="nameany" name="nameany" value="" /></li> > <li><label for="authorany">Author (any): </label> <input type="text" id="authorany" name="authorany" value="" /></li> > <li><label for="authorpersonal">Author (personal): </label> <input type="text" id="authorpersonal" name="authorpersonal" value="" /></li> >-- >1.7.7.4
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 10096
:
18001
|
18011
|
18108
|
18648
|
18789
|
18790
|
18791
|
19957
|
19958
|
19959
|
19960
|
20927
|
20928
|
20929
|
21611
|
21612
|
21762
|
21763