@@ -, +, @@ server searches. I) Apply the patch Keyword (Any) : egypt @attr 4=1 --- C4/Breeding.pm | 8 ++++++++ Koha/Schema/Result/Z3950server.pm | 12 ++++++++++-- admin/z3950servers.pl | 2 +- .../mysql/atomicupdate/Bug11297_z3950servers_attributes.sql | 1 + installer/data/mysql/kohastructure.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/z3950servers.tt | 7 ++++++- 6 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/Bug11297_z3950servers_attributes.sql --- a/C4/Breeding.pm +++ a/C4/Breeding.pm @@ -156,6 +156,9 @@ sub Z3950Search { ); my @servers = $rs->all; foreach my $server ( @servers ) { + if(my $attributes = $server->{attributes}){ + $zquery = "$attributes $zquery"; + } $oConnection[$s] = _create_connection( $server ); $oResult[$s] = $server->{servertype} eq 'zed'? @@ -532,6 +535,7 @@ sub Z3950SearchAuth { my $record; my @serverhost; my @servername; + my @server_attributes = (); my @breeding_loop = (); my @oConnection; @@ -617,12 +621,16 @@ sub Z3950SearchAuth { $serverhost[$s] = $server->{host}; $servername[$s] = $server->{servername}; $encoding[$s] = ($server->{encoding}?$server->{encoding}:"iso-5426"); + $server_attributes[$s] = $server->{attributes}; $s++; } ## while fetch } # foreach my $nremaining = $s; for ( my $z = 0 ; $z < $s ; $z++ ) { + if(my $attributes = $server_attributes[$z]){ + $query = "$attributes $query"; + } $oResult[$z] = $oConnection[$z]->search_pqf($query); } --- a/Koha/Schema/Result/Z3950server.pm +++ a/Koha/Schema/Result/Z3950server.pm @@ -120,6 +120,12 @@ __PACKAGE__->table("z3950servers"); data_type: 'mediumtext' is_nullable: 1 +=head2 attributes + + data_type: 'varchar' + is_nullable: 1 + size: 255 + =cut __PACKAGE__->add_columns( @@ -167,6 +173,8 @@ __PACKAGE__->add_columns( { data_type => "mediumtext", is_nullable => 1 }, "add_xslt", { data_type => "mediumtext", is_nullable => 1 }, + "attributes", + { data_type => "varchar", is_nullable => 1, size => 255 }, ); =head1 PRIMARY KEY @@ -182,8 +190,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-09-01 10:16:04 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q0y03nGYIt0eDIVui0UUdw +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-07-07 12:23:15 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jyVvIir/Xm1d4t11W2XwZA # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/admin/z3950servers.pl +++ a/admin/z3950servers.pl @@ -66,7 +66,7 @@ if( $op eq 'delete_confirmed' && $id ) { $id = 0; } elsif ( $op eq 'add_validated' ) { my @fields=qw/host port db userid password rank syntax encoding timeout - recordtype checked servername servertype sru_options sru_fields + recordtype checked servername servertype sru_options sru_fields attributes add_xslt/; my $formdata = _form_data_hashref( $input, \@fields ); if( $id ) { --- a/installer/data/mysql/atomicupdate/Bug11297_z3950servers_attributes.sql +++ a/installer/data/mysql/atomicupdate/Bug11297_z3950servers_attributes.sql @@ -0,0 +1, @@ + ALTER TABLE z3950servers ADD COLUMN attributes VARCHAR(255) after add_xslt; --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -2323,6 +2323,7 @@ CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets u `sru_options` varchar(255) default NULL, -- options like sru=get, sru_version=1.1; will be passed to the server via ZOOM `sru_fields` mediumtext default NULL, -- contains the mapping between the Z3950 search fields and the specific SRU server indexes `add_xslt` mediumtext default NULL, -- zero or more paths to XSLT files to be processed on the search results + `attributes` VARCHAR(255) default NULL, -- additionnal attributes passed to PQF queries PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -83,6 +83,9 @@
  • +
  • +
  • +