@@ -, +, @@ a remote Koha instance. --- C4/Auth.pm | 1 + admin/z3950servers.pl | 22 +- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 8 + .../prog/en/modules/admin/preferences/opac.pref | 6 + .../prog/en/modules/admin/z3950servers.tt | 12 +- koha-tmpl/opac-tmpl/ccsr/en/css/datatables.css | 10 +- koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc | 1 + koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 1 + .../opac-tmpl/prog/en/modules/opac-z3950-search.tt | 253 +++++++++++++++ opac/opac-z3950-search.pl | 323 ++++++++++++++++++++ 11 files changed, 622 insertions(+), 16 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/opac-z3950-search.tt create mode 100755 opac/opac-z3950-search.pl --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -412,6 +412,7 @@ sub get_template_and_user { OPACMobileUserCSS => "". C4::Context->preference("OPACMobileUserCSS"), OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"), OpacAuthorities => C4::Context->preference("OpacAuthorities"), + OpacZ3950 => C4::Context->preference("OpacZ3950"), OPACBaseURL => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} . ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"), opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, --- a/admin/z3950servers.pl +++ a/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,recordtype"; + my $query = "SELECT host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype,opac"; $query .= " FROM z3950servers"; if ( $searchstring ne '' ) { $query .= " WHERE (name like ?)" } $query .= " ORDER BY rank,name"; @@ -93,14 +93,14 @@ if ( $op eq 'add_form' ) { if ($searchfield) { my $dbh = C4::Context->dbh; 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" +"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype,opac from z3950servers where (name = ?) order by rank,name" ); $sth->execute($searchfield); $data = $sth->fetchrow_hashref; $sth->finish; } $template->param( $_ => $data->{$_} ) - for (qw( host port db userid password checked rank timeout encoding )); + for (qw( host port db userid password checked rank timeout encoding opac )); $template->param( $_ . $data->{$_} => 1 ) for (qw( syntax recordtype )); # END $OP eq ADD_FORM @@ -113,7 +113,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=?,recordtype=? where name=?"); + $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=?,opac=? where name=?"); $sth->execute($input->param('host'), $input->param('port'), $input->param('db'), @@ -126,6 +126,7 @@ if ( $op eq 'add_form' ) { $input->param('encoding'), $input->param('timeout'), $input->param('recordtype'), + ($input->param('opac') || 0), $input->param('searchfield'), ); } @@ -133,15 +134,16 @@ 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,recordtype) " . - "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); + "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype,opac) " . + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); $sth->execute( $input->param('host'), $input->param('port'), $input->param('db'), $input->param('userid'), $input->param('password'), $input->param('searchfield'), $checked, $input->param('rank'), $input->param('syntax'), $input->param('encoding'), - $input->param('timeout'), $input->param('recordtype') + $input->param('timeout'), $input->param('recordtype'), + ($input->param('opac') || 0), ); } $sth->finish; @@ -154,7 +156,7 @@ if ( $op eq 'add_form' ) { my $dbh = C4::Context->dbh; 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" +"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype,opac from z3950servers where (name = ?) order by rank,name" ); $sth2->execute($searchfield); my $data = $sth2->fetchrow_hashref; @@ -171,6 +173,7 @@ if ( $op eq 'add_form' ) { syntax => $data->{'syntax'}, timeout => $data->{'timeout'}, recordtype => $data->{'recordtype'}, + opac => $data->{'opac'}, encoding => $data->{'encoding'} ); @@ -203,7 +206,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'}, + opac => $results->[$i]{'opac'}, recordtype => $results->[$i]{'recordtype'}); push @loop, \%row; --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -424,4 +424,5 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('yuipath','local','local|http://yui.yahooapis.com/2.5.1/build','Insert the path to YUI libraries, choose local if you use koha offline','Choice'), ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), ('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') +('OPACZ3950','0','','Allow patrons to search for bibliographic records in other libraries via Z39.50.','YesNo') ; --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -7824,6 +7824,14 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "XXX"; +if(CheckVersion($DBversion)) { + $dbh->do("ALTER TABLE z3950servers ADD COLUMN opac TINYINT(1);"); + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('OPACZ3950','0','','Allow patrons to search for bibliographic records in other libraries via Z39.50.','YesNo')"); + print "Add opac column to z3950servers table.\nAdd OPACZ3950 preference.\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -338,6 +338,12 @@ OPAC: no: "Don't allow" - patrons to search your authority records. - + - pref: OpacZ3950 + choices: + yes: Allow + no: "Don't allow" + - patrons to search for bibliographic records in other libraries via Z39.50. + - - pref: opacbookbag choices: yes: Allow --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -137,6 +137,13 @@ [% END %] +
Target | Hostname/Port | Database | Userid | Password | Checked | Rank | Syntax | Encoding | Timeout | Record type | + | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Target | Hostname/Port | Database | Userid | Password | Checked | Rank | Syntax | Encoding | Timeout | Record type | OPAC | [% loo.name %] | [% loo.host %]:[% loo.port %] | [% loo.db %] | [% loo.userid %] | [% loo.password %] | [% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %] | [% loo.rank %] | -[% loo.syntax %] | [% loo.encoding %] | [% loo.timeout %] | [% loo.recordtype %] | Edit | Delete | +[% loo.syntax %] | [% loo.encoding %] | [% loo.timeout %] | [% loo.recordtype %] | [% loo.opac %] | Edit | Delete | [% END %]
Server | +Title | +Author | +Date | +Edition | +ISBN | +LCCN | +MARC | +Card | ++ |
---|---|---|---|---|---|---|---|---|---|
[% breeding_loo.server %] | +[% breeding_loo.title |html %] | +[% breeding_loo.author %] | +[% breeding_loo.date %] | +[% breeding_loo.edition %] | +[% breeding_loo.isbn %] | +[% breeding_loo.lccn %] | +MARC | +Card | +Show | +
Nothing found.
+ + [% END %] +[% END %] + +