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 2413-2418 CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets u Link Here
2413
  `sru_options` varchar(255) default NULL, -- options like sru=get, sru_version=1.1; will be passed to the server via ZOOM
2413
  `sru_options` varchar(255) default NULL, -- options like sru=get, sru_version=1.1; will be passed to the server via ZOOM
2414
  `sru_fields` mediumtext default NULL, -- contains the mapping between the Z3950 search fields and the specific SRU server indexes
2414
  `sru_fields` mediumtext default NULL, -- contains the mapping between the Z3950 search fields and the specific SRU server indexes
2415
  `add_xslt` mediumtext default NULL, -- zero or more paths to XSLT files to be processed on the search results
2415
  `add_xslt` mediumtext default NULL, -- zero or more paths to XSLT files to be processed on the search results
2416
  `attributes` VARCHAR(255) default NULL, -- additionnal attributes passed to PQF queries
2416
  PRIMARY KEY  (`id`)
2417
  PRIMARY KEY  (`id`)
2417
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2418
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2418
2419
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt (-2 / +6 lines)
Lines 143-148 Link Here
143
        </li>
143
        </li>
144
        <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" />
144
        <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" />
145
        </li>
145
        </li>
146
        <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 %]" />
147
        </li>
148
146
149
147
        <li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>
150
        <li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>
148
        <select name="syntax" id="syntax">
151
        <select name="syntax" id="syntax">
Lines 219-225 Link Here
219
        You searched for [% searchfield %]
222
        You searched for [% searchfield %]
220
    [% END %]
223
    [% END %]
221
    <table id="serverst">
224
    <table id="serverst">
222
        <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>
225
226
        <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>
223
        </tr></thead>
227
        </tr></thead>
224
        <tbody>
228
        <tbody>
225
        [% FOREACH loo IN loop %]
229
        [% FOREACH loo IN loop %]
Lines 232-237 Link Here
232
                <span>Authority</span>
236
                <span>Authority</span>
233
                [% END %]
237
                [% END %]
234
            </td>
238
            </td>
239
            <td>[% loo.attributes %]</td>
235
            <td>
240
            <td>
236
                <div class="dropdown">
241
                <div class="dropdown">
237
                    <a class="btn btn-mini dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#">
242
                    <a class="btn btn-mini dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#">
238
- 

Return to bug 11297