View | Details | Raw Unified | Return to bug 11297
Collapse All | Expand All

(-)a/C4/Breeding.pm (+8 lines)
Lines 156-161 sub Z3950Search { Link Here
156
    );
156
    );
157
    my @servers = $rs->all;
157
    my @servers = $rs->all;
158
    foreach my $server ( @servers ) {
158
    foreach my $server ( @servers ) {
159
        if(my $attributes = $server->{attributes}){
160
            $zquery = "$attributes $zquery";
161
        }
159
        $oConnection[$s] = _create_connection( $server );
162
        $oConnection[$s] = _create_connection( $server );
160
        $oResult[$s] =
163
        $oResult[$s] =
161
            $server->{servertype} eq 'zed'?
164
            $server->{servertype} eq 'zed'?
Lines 534-539 sub Z3950SearchAuth { Link Here
534
    my $record;
537
    my $record;
535
    my @serverhost;
538
    my @serverhost;
536
    my @servername;
539
    my @servername;
540
    my @server_attributes = ();
537
    my @breeding_loop = ();
541
    my @breeding_loop = ();
538
542
539
    my @oConnection;
543
    my @oConnection;
Lines 619-630 sub Z3950SearchAuth { Link Here
619
            $serverhost[$s] = $server->{host};
623
            $serverhost[$s] = $server->{host};
620
            $servername[$s] = $server->{servername};
624
            $servername[$s] = $server->{servername};
621
            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
625
            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
626
            $server_attributes[$s] = $server->{attributes};
622
            $s++;
627
            $s++;
623
        }    ## while fetch
628
        }    ## while fetch
624
    }    # foreach
629
    }    # foreach
625
    my $nremaining  = $s;
630
    my $nremaining  = $s;
626
631
627
    for ( my $z = 0 ; $z < $s ; $z++ ) {
632
    for ( my $z = 0 ; $z < $s ; $z++ ) {
633
        if(my $attributes = $server_attributes[$z]){
634
            $query = "$attributes $query";
635
        }
628
        $oResult[$z] = $oConnection[$z]->search_pqf($query);
636
        $oResult[$z] = $oConnection[$z]->search_pqf($query);
629
    }
637
    }
630
638
(-)a/Koha/Schema/Result/Z3950server.pm (-2 / +10 lines)
Lines 120-125 __PACKAGE__->table("z3950servers"); Link Here
120
  data_type: 'mediumtext'
120
  data_type: 'mediumtext'
121
  is_nullable: 1
121
  is_nullable: 1
122
122
123
=head2 attributes
124
125
  data_type: 'varchar'
126
  is_nullable: 1
127
  size: 255
128
123
=cut
129
=cut
124
130
125
__PACKAGE__->add_columns(
131
__PACKAGE__->add_columns(
Lines 167-172 __PACKAGE__->add_columns( Link Here
167
  { data_type => "mediumtext", is_nullable => 1 },
173
  { data_type => "mediumtext", is_nullable => 1 },
168
  "add_xslt",
174
  "add_xslt",
169
  { data_type => "mediumtext", is_nullable => 1 },
175
  { data_type => "mediumtext", is_nullable => 1 },
176
  "attributes",
177
  { data_type => "varchar", is_nullable => 1, size => 255 },
170
);
178
);
171
179
172
=head1 PRIMARY KEY
180
=head1 PRIMARY KEY
Lines 182-189 __PACKAGE__->add_columns( Link Here
182
__PACKAGE__->set_primary_key("id");
190
__PACKAGE__->set_primary_key("id");
183
191
184
192
185
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-09-01 10:16:04
193
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-07-07 12:23:15
186
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q0y03nGYIt0eDIVui0UUdw
194
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jyVvIir/Xm1d4t11W2XwZA
187
195
188
196
189
# You can replace this text with custom code or comments, and it will be preserved on regeneration
197
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/admin/z3950servers.pl (-1 / +1 lines)
Lines 66-72 if( $op eq 'delete_confirmed' && $id ) { Link Here
66
    $id = 0;
66
    $id = 0;
67
} elsif ( $op eq 'add_validated' ) {
67
} elsif ( $op eq 'add_validated' ) {
68
    my @fields=qw/host port db userid password rank syntax encoding timeout
68
    my @fields=qw/host port db userid password rank syntax encoding timeout
69
        recordtype checked servername servertype sru_options sru_fields
69
        recordtype checked servername servertype sru_options sru_fields attributes
70
        add_xslt/;
70
        add_xslt/;
71
    my $formdata = _form_data_hashref( $input, \@fields );
71
    my $formdata = _form_data_hashref( $input, \@fields );
72
    if( $id ) {
72
    if( $id ) {
(-)a/installer/data/mysql/atomicupdate/Bug11297_z3950servers_attributes.sql (+1 lines)
Line 0 Link Here
1
 ALTER TABLE z3950servers ADD COLUMN attributes VARCHAR(255) after add_xslt;
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 2320-2325 CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets u Link Here
2320
  `sru_options` varchar(255) default NULL, -- options like sru=get, sru_version=1.1; will be passed to the server via ZOOM
2320
  `sru_options` varchar(255) default NULL, -- options like sru=get, sru_version=1.1; will be passed to the server via ZOOM
2321
  `sru_fields` mediumtext default NULL, -- contains the mapping between the Z3950 search fields and the specific SRU server indexes
2321
  `sru_fields` mediumtext default NULL, -- contains the mapping between the Z3950 search fields and the specific SRU server indexes
2322
  `add_xslt` mediumtext default NULL, -- zero or more paths to XSLT files to be processed on the search results
2322
  `add_xslt` mediumtext default NULL, -- zero or more paths to XSLT files to be processed on the search results
2323
  `attributes` VARCHAR(255) default NULL, -- additionnal attributes passed to PQF queries
2323
  PRIMARY KEY  (`id`)
2324
  PRIMARY KEY  (`id`)
2324
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2325
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2325
2326
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt (-2 / +6 lines)
Lines 152-157 Link Here
152
        </li>
152
        </li>
153
        <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" />
153
        <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" />
154
        </li>
154
        </li>
155
        <li><label for="attributes">Attributes (additional PQF attributes added to each query): </label><input type="text" name="attributes" id="attributes" size="30" value="[% server.attributes %]" />
156
        </li>
157
155
158
156
        <li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>
159
        <li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>
157
        <select name="syntax" id="syntax">
160
        <select name="syntax" id="syntax">
Lines 228-234 Link Here
228
        You searched for [% searchfield %]
231
        You searched for [% searchfield %]
229
    [% END %]
232
    [% END %]
230
    <table id="serverst">
233
    <table id="serverst">
231
        <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Preselected</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th></th>
234
235
        <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Preselected</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th>Attributes</th><th>Options</th>
232
        </tr></thead>
236
        </tr></thead>
233
        <tbody>
237
        <tbody>
234
        [% FOREACH loo IN loop %]
238
        [% FOREACH loo IN loop %]
Lines 241-246 Link Here
241
                <span>Authority</span>
245
                <span>Authority</span>
242
                [% END %]
246
                [% END %]
243
            </td>
247
            </td>
248
            <td>[% loo.attributes %]</td>
244
            <td>
249
            <td>
245
                <div class="dropdown">
250
                <div class="dropdown">
246
                    <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#">
251
                    <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#">
247
- 

Return to bug 11297