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

(-)a/C4/Breeding.pm (+8 lines)
Lines 158-163 sub Z3950Search { Link Here
158
    );
158
    );
159
    my @servers = $rs->all;
159
    my @servers = $rs->all;
160
    foreach my $server ( @servers ) {
160
    foreach my $server ( @servers ) {
161
        if(my $attributes = $server->{attributes}){
162
            $zquery = "$attributes $zquery";
163
        }
161
        $oConnection[$s] = _create_connection( $server );
164
        $oConnection[$s] = _create_connection( $server );
162
        $oResult[$s] =
165
        $oResult[$s] =
163
            $server->{servertype} eq 'zed'?
166
            $server->{servertype} eq 'zed'?
Lines 536-541 sub Z3950SearchAuth { Link Here
536
    my $record;
539
    my $record;
537
    my @serverhost;
540
    my @serverhost;
538
    my @servername;
541
    my @servername;
542
    my @server_attributes = ();
539
    my @breeding_loop = ();
543
    my @breeding_loop = ();
540
544
541
    my @oConnection;
545
    my @oConnection;
Lines 621-632 sub Z3950SearchAuth { Link Here
621
            $serverhost[$s] = $server->{host};
625
            $serverhost[$s] = $server->{host};
622
            $servername[$s] = $server->{servername};
626
            $servername[$s] = $server->{servername};
623
            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
627
            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
628
            $server_attributes[$s] = $server->{attributes};
624
            $s++;
629
            $s++;
625
        }    ## while fetch
630
        }    ## while fetch
626
    }    # foreach
631
    }    # foreach
627
    my $nremaining  = $s;
632
    my $nremaining  = $s;
628
633
629
    for ( my $z = 0 ; $z < $s ; $z++ ) {
634
    for ( my $z = 0 ; $z < $s ; $z++ ) {
635
        if(my $attributes = $server_attributes[$z]){
636
            $query = "$attributes $query";
637
        }
630
        $oResult[$z] = $oConnection[$z]->search_pqf($query);
638
        $oResult[$z] = $oConnection[$z]->search_pqf($query);
631
    }
639
    }
632
640
(-)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 2379-2384 CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets u Link Here
2379
  `sru_options` varchar(255) default NULL, -- options like sru=get, sru_version=1.1; will be passed to the server via ZOOM
2379
  `sru_options` varchar(255) default NULL, -- options like sru=get, sru_version=1.1; will be passed to the server via ZOOM
2380
  `sru_fields` mediumtext default NULL, -- contains the mapping between the Z3950 search fields and the specific SRU server indexes
2380
  `sru_fields` mediumtext default NULL, -- contains the mapping between the Z3950 search fields and the specific SRU server indexes
2381
  `add_xslt` mediumtext default NULL, -- zero or more paths to XSLT files to be processed on the search results
2381
  `add_xslt` mediumtext default NULL, -- zero or more paths to XSLT files to be processed on the search results
2382
  `attributes` VARCHAR(255) default NULL, -- additionnal attributes passed to PQF queries
2382
  PRIMARY KEY  (`id`)
2383
  PRIMARY KEY  (`id`)
2383
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2384
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2384
2385
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt (-2 / +5 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>Options</th>
225
        <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>
226
        </tr></thead>
224
        <tbody>
227
        <tbody>
225
        [% FOREACH loo IN loop %]
228
        [% FOREACH loo IN loop %]
Lines 232-237 Link Here
232
                <span>Authority</span>
235
                <span>Authority</span>
233
                [% END %]
236
                [% END %]
234
            </td>
237
            </td>
238
            <td>[% loo.attributes %]</td>
235
            <td><a href="[% loo.script_name %]?op=edit&amp;id=[% loo.id %]">Edit</a> <a href="[% loo.script_name %]?op=add&amp;id=[% loo.id %]">Copy</a> <a href="javascript:void(0);" onclick="ConfirmDelete('[% loo.servername | replace("['\"]","") %]','[% loo.id %]');">Delete</a></td>
239
            <td><a href="[% loo.script_name %]?op=edit&amp;id=[% loo.id %]">Edit</a> <a href="[% loo.script_name %]?op=add&amp;id=[% loo.id %]">Copy</a> <a href="javascript:void(0);" onclick="ConfirmDelete('[% loo.servername | replace("['\"]","") %]','[% loo.id %]');">Delete</a></td>
236
            </tr>
240
            </tr>
237
        [% END %]
241
        [% END %]
238
- 

Return to bug 11297