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

(-)a/C4/Auth.pm (+1 lines)
Lines 412-417 sub get_template_and_user { Link Here
412
            OPACMobileUserCSS         => "". C4::Context->preference("OPACMobileUserCSS"),
412
            OPACMobileUserCSS         => "". C4::Context->preference("OPACMobileUserCSS"),
413
            OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"),
413
            OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"),
414
            OpacAuthorities           => C4::Context->preference("OpacAuthorities"),
414
            OpacAuthorities           => C4::Context->preference("OpacAuthorities"),
415
            OpacZ3950                 => C4::Context->preference("OpacZ3950"),
415
            OPACBaseURL               => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} .
416
            OPACBaseURL               => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} .
416
                   ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"),
417
                   ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"),
417
            opac_css_override         => $ENV{'OPAC_CSS_OVERRIDE'},
418
            opac_css_override         => $ENV{'OPAC_CSS_OVERRIDE'},
(-)a/admin/z3950servers.pl (-9 / +13 lines)
Lines 40-46 sub StringSearch { Link Here
40
        $searchstring = '';
40
        $searchstring = '';
41
    }
41
    }
42
42
43
    my $query    = "SELECT host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype";
43
    my $query    = "SELECT host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype,opac";
44
    $query      .= " FROM z3950servers";
44
    $query      .= " FROM z3950servers";
45
    if ( $searchstring ne '' ) { $query .= " WHERE (name like ?)" }
45
    if ( $searchstring ne '' ) { $query .= " WHERE (name like ?)" }
46
    $query      .= " ORDER BY rank,name";
46
    $query      .= " ORDER BY rank,name";
Lines 93-106 if ( $op eq 'add_form' ) { Link Here
93
    if ($searchfield) {
93
    if ($searchfield) {
94
        my $dbh = C4::Context->dbh;
94
        my $dbh = C4::Context->dbh;
95
        my $sth = $dbh->prepare(
95
        my $sth = $dbh->prepare(
96
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"
96
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype,opac from z3950servers where (name = ?) order by rank,name"
97
        );
97
        );
98
        $sth->execute($searchfield);
98
        $sth->execute($searchfield);
99
        $data = $sth->fetchrow_hashref;
99
        $data = $sth->fetchrow_hashref;
100
        $sth->finish;
100
        $sth->finish;
101
    }
101
    }
102
    $template->param( $_ => $data->{$_} )
102
    $template->param( $_ => $data->{$_} )
103
      for (qw( host port db userid password checked rank timeout encoding ));
103
      for (qw( host port db userid password checked rank timeout encoding opac ));
104
    $template->param( $_ . $data->{$_} => 1 ) for (qw( syntax recordtype ));
104
    $template->param( $_ . $data->{$_} => 1 ) for (qw( syntax recordtype ));
105
105
106
    # END $OP eq ADD_FORM
106
    # END $OP eq ADD_FORM
Lines 113-119 if ( $op eq 'add_form' ) { Link Here
113
	my $checked = $input->param('checked') ? 1 : 0;
113
	my $checked = $input->param('checked') ? 1 : 0;
114
	if ($sth->rows) {
114
	if ($sth->rows) {
115
        $template->param(confirm_update => 1);
115
        $template->param(confirm_update => 1);
116
             $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=? where name=?");
116
             $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=?,opac=? where name=?");
117
		$sth->execute($input->param('host'),
117
		$sth->execute($input->param('host'),
118
		      $input->param('port'),
118
		      $input->param('port'),
119
		      $input->param('db'),
119
		      $input->param('db'),
Lines 126-131 if ( $op eq 'add_form' ) { Link Here
126
              $input->param('encoding'),
126
              $input->param('encoding'),
127
              $input->param('timeout'),
127
              $input->param('timeout'),
128
              $input->param('recordtype'),
128
              $input->param('recordtype'),
129
              ($input->param('opac') || 0),
129
		      $input->param('searchfield'),
130
		      $input->param('searchfield'),
130
		      );
131
		      );
131
	} 
132
	} 
Lines 133-147 if ( $op eq 'add_form' ) { Link Here
133
        $template->param(confirm_add => 1);
134
        $template->param(confirm_add => 1);
134
		$sth=$dbh->prepare(
135
		$sth=$dbh->prepare(
135
		  "INSERT INTO z3950servers " .
136
		  "INSERT INTO z3950servers " .
136
              "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype) " .
137
              "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype,opac) " .
137
               "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" );
138
               "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" );
138
        $sth->execute(
139
        $sth->execute(
139
            $input->param('host'),     $input->param('port'),
140
            $input->param('host'),     $input->param('port'),
140
            $input->param('db'),       $input->param('userid'),
141
            $input->param('db'),       $input->param('userid'),
141
            $input->param('password'), $input->param('searchfield'),
142
            $input->param('password'), $input->param('searchfield'),
142
            $checked,                  $input->param('rank'),
143
            $checked,                  $input->param('rank'),
143
            $input->param('syntax'),   $input->param('encoding'),
144
            $input->param('syntax'),   $input->param('encoding'),
144
            $input->param('timeout'),  $input->param('recordtype')
145
            $input->param('timeout'),  $input->param('recordtype'),
146
            ($input->param('opac') || 0),
145
        );
147
        );
146
    }
148
    }
147
    $sth->finish;
149
    $sth->finish;
Lines 154-160 if ( $op eq 'add_form' ) { Link Here
154
    my $dbh = C4::Context->dbh;
156
    my $dbh = C4::Context->dbh;
155
157
156
    my $sth2 = $dbh->prepare(
158
    my $sth2 = $dbh->prepare(
157
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"
159
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype,opac from z3950servers where (name = ?) order by rank,name"
158
    );
160
    );
159
    $sth2->execute($searchfield);
161
    $sth2->execute($searchfield);
160
    my $data = $sth2->fetchrow_hashref;
162
    my $data = $sth2->fetchrow_hashref;
Lines 171-176 if ( $op eq 'add_form' ) { Link Here
171
        syntax     => $data->{'syntax'},
173
        syntax     => $data->{'syntax'},
172
        timeout    => $data->{'timeout'},
174
        timeout    => $data->{'timeout'},
173
        recordtype => $data->{'recordtype'},
175
        recordtype => $data->{'recordtype'},
176
        opac       => $data->{'opac'},
174
        encoding   => $data->{'encoding'}
177
        encoding   => $data->{'encoding'}
175
    );
178
    );
176
179
Lines 203-209 if ( $op eq 'add_form' ) { Link Here
203
			rank => $results->[$i]{'rank'},
206
			rank => $results->[$i]{'rank'},
204
			syntax => $results->[$i]{'syntax'},
207
			syntax => $results->[$i]{'syntax'},
205
			encoding => $results->[$i]{'encoding'},
208
			encoding => $results->[$i]{'encoding'},
206
      timeout => $results->[$i]{'timeout'},
209
            timeout => $results->[$i]{'timeout'},
210
            opac => $results->[$i]{'opac'},
207
            recordtype => $results->[$i]{'recordtype'});
211
            recordtype => $results->[$i]{'recordtype'});
208
		push @loop, \%row;
212
		push @loop, \%row;
209
213
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 424-427 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
424
('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'),
424
('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'),
425
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
425
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
426
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
426
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
427
('OPACZ3950','0','','Allow patrons to search for bibliographic records in other libraries via Z39.50.','YesNo')
427
;
428
;
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 7824-7829 if ( CheckVersion($DBversion) ) { Link Here
7824
    SetVersion($DBversion);
7824
    SetVersion($DBversion);
7825
}
7825
}
7826
7826
7827
$DBversion = "XXX";
7828
if(CheckVersion($DBversion)) {
7829
    $dbh->do("ALTER TABLE z3950servers ADD COLUMN opac TINYINT(1);");
7830
    $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')");
7831
    print "Add opac column to z3950servers table.\nAdd OPACZ3950 preference.\n";
7832
    SetVersion($DBversion);
7833
}
7834
7827
7835
7828
=head1 FUNCTIONS
7836
=head1 FUNCTIONS
7829
7837
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 338-343 OPAC: Link Here
338
                  no: "Don't allow"
338
                  no: "Don't allow"
339
            - patrons to search your authority records.
339
            - patrons to search your authority records.
340
        -
340
        -
341
            - pref: OpacZ3950
342
              choices:
343
                  yes: Allow
344
                  no: "Don't allow"
345
            - patrons to search for bibliographic records in other libraries via Z39.50.
346
        -
341
            - pref: opacbookbag
347
            - pref: opacbookbag
342
              choices:
348
              choices:
343
                  yes: Allow
349
                  yes: Allow
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt (-2 / +10 lines)
Lines 137-142 Link Here
137
                                <input type="checkbox" name="checked" id="checked" value="1" />
137
                                <input type="checkbox" name="checked" id="checked" value="1" />
138
                        [% END %]
138
                        [% END %]
139
                </li>
139
                </li>
140
        <li><label for="opac">OPAC (Shown in OPAC Z39.50 search): </label>
141
        [% IF ( opac ) %]
142
            <input type="checkbox" size="1" name="opac" id="opac" value="1" checked="" />
143
        [% ELSE %]
144
            <input type="checkbox" size="1" name="opac" id="opac" value="1" />
145
        [% END %]
146
        </li>
140
		<li><label for="rank">Rank (display order): </label>	<input type="text" name="rank" id="rank" size="4" value="[% rank %]" onblur="isNum(this)" />
147
		<li><label for="rank">Rank (display order): </label>	<input type="text" name="rank" id="rank" size="4" value="[% rank %]" onblur="isNum(this)" />
141
		</li>	
148
		</li>	
142
		<li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>	
149
		<li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>	
Lines 289-294 Link Here
289
                <li><strong>Encoding: </strong>[% encoding %]</li>
296
                <li><strong>Encoding: </strong>[% encoding %]</li>
290
                <li><strong>Timeout: </strong>[% timeout %]</li>
297
                <li><strong>Timeout: </strong>[% timeout %]</li>
291
                <li><strong>Record type: </strong>[% recordtype %]</li>
298
                <li><strong>Record type: </strong>[% recordtype %]</li>
299
                <li><strong>OPAC: </strong>[% opac %]</li>
292
	</ul>                <form action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="submit" value="Delete this server" /></form>  <form action="[% script_name %]" method="post"><input type="submit" value="Do not delete" /></form>
300
	</ul>                <form action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="submit" value="Delete this server" /></form>  <form action="[% script_name %]" method="post"><input type="submit" value="Do not delete" /></form>
293
301
294
302
Lines 314-320 Link Here
314
                You searched for [% searchfield %]
322
                You searched for [% searchfield %]
315
        [% END %]
323
        [% END %]
316
<table id="serverst">
324
<table id="serverst">
317
                <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th>&nbsp;</th><th>&nbsp;</th>
325
    <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th>OPAC</th><th>&nbsp;</th><th>&nbsp;</th>
318
                </tr></thead>
326
                </tr></thead>
319
                <tbody>[% FOREACH loo IN loop %]
327
                <tbody>[% FOREACH loo IN loop %]
320
                [% UNLESS ( loop.odd ) %]
328
                [% UNLESS ( loop.odd ) %]
Lines 324-330 Link Here
324
                [% END %]
332
                [% END %]
325
<td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td>
333
<td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td>
326
334
327
<td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td><td>[% loo.recordtype %]</td><td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&amp;searchfield=[% loo.name |url %]">Delete</a></td>                </tr>
335
<td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td><td>[% loo.recordtype %]</td><td>[% loo.opac %]</td><td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&amp;searchfield=[% loo.name |url %]">Delete</a></td>                </tr>
328
                [% END %]</tbody>
336
                [% END %]</tbody>
329
</table>
337
</table>
330
338
(-)a/koha-tmpl/opac-tmpl/ccsr/en/css/datatables.css (-5 / +5 lines)
Lines 3-25 input.search_init { Link Here
3
}
3
}
4
.sorting_asc {
4
.sorting_asc {
5
    padding-right: 19px;
5
    padding-right: 19px;
6
    background: url("../../img/asc.gif") no-repeat scroll right center #EEEEEE;
6
    background: url("../../images/asc.gif") no-repeat scroll right center #EEEEEE;
7
}
7
}
8
.sorting_desc {
8
.sorting_desc {
9
    padding-right: 19px;
9
    padding-right: 19px;
10
    background: url("../../img/desc.gif") no-repeat scroll right center #EEEEEE;
10
    background: url("../../images/desc.gif") no-repeat scroll right center #EEEEEE;
11
}
11
}
12
.sorting {
12
.sorting {
13
    padding-right: 19px;
13
    padding-right: 19px;
14
    background: url("../../img/ascdesc.gif") no-repeat scroll right center #EEEEEE;
14
    background: url("../../images/ascdesc.gif") no-repeat scroll right center #EEEEEE;
15
}
15
}
16
.sorting_asc_disabled {
16
.sorting_asc_disabled {
17
    padding-right: 19px;
17
    padding-right: 19px;
18
    background: url("../../img/datatables/sort_asc_disabled.png") no-repeat scroll right center #EEEEEE;
18
    background: url("../../images/datatables/sort_asc_disabled.png") no-repeat scroll right center #EEEEEE;
19
}
19
}
20
.sorting_desc_disabled {
20
.sorting_desc_disabled {
21
    padding-right: 19px;
21
    padding-right: 19px;
22
    background: url("../../img/datatables/sort_desc_disabled.png") no-repeat scroll right center #EEEEEE;
22
    background: url("../../images/datatables/sort_desc_disabled.png") no-repeat scroll right center #EEEEEE;
23
}
23
}
24
.sorting_disabled {
24
.sorting_disabled {
25
    padding-right: 19px;
25
    padding-right: 19px;
(-)a/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc (+1 lines)
Lines 195-200 Link Here
195
[% IF Koha.Preference( 'UseCourseReserves' ) == 1 %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>[% END %]
195
[% IF Koha.Preference( 'UseCourseReserves' ) == 1 %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>[% END %]
196
[% IF ( OpacBrowser ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a>[% END %]
196
[% IF ( OpacBrowser ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a>[% END %]
197
[% IF ( OpacAuthorities ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>[% END %]
197
[% IF ( OpacAuthorities ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>[% END %]
198
[% IF ( OpacZ3950 ) %]<span class="pipe"> | </span><a target="_blank" href="/cgi-bin/koha/opac-z3950-search.pl">Z39.50 Search</a>[% END %]
198
[% IF ( opacuserlogin && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>[% END %]
199
[% IF ( opacuserlogin && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>[% END %]
199
[% IF ( TagsEnabled ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a>[% END %]
200
[% IF ( TagsEnabled ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a>[% END %]
200
[% IF ( OpacCloud ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a>[% END %]
201
[% IF ( OpacCloud ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a>[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc (+1 lines)
Lines 134-139 Link Here
134
[% IF Koha.Preference( 'UseCourseReserves' ) == 1 %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>[% END %]
134
[% IF Koha.Preference( 'UseCourseReserves' ) == 1 %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a>[% END %]
135
[% IF ( OpacBrowser ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a>[% END %]
135
[% IF ( OpacBrowser ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a>[% END %]
136
[% IF ( OpacAuthorities ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>[% END %]
136
[% IF ( OpacAuthorities ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>[% END %]
137
[% IF ( OpacZ3950 ) %]<span class="pipe"> | </span><a target="_blank" href="/cgi-bin/koha/opac-z3950-search.pl">Z39.50 Search</a>[% END %]
137
[% IF ( opacuserlogin && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>[% END %]
138
[% IF ( opacuserlogin && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>[% END %]
138
[% IF ( TagsEnabled ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a>[% END %]
139
[% IF ( TagsEnabled ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a>[% END %]
139
[% IF ( OpacCloud ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a>[% END %]
140
[% IF ( OpacCloud ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a>[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-z3950-search.tt (+253 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
Koha &rsaquo; Z39.50 Search Results</title>
3
4
<!-- greybox.inc -->
5
<script type="text/javascript">                            
6
    var GB_ROOT_DIR = "[% themelang %]/lib/greybox/";                               
7
</script>
8
<script type="text/javascript" src="[% themelang %]/lib/greybox/AJS.js"></script>
9
<script type="text/javascript" src="[% themelang %]/lib/greybox/AJS_fx.js"></script>
10
<script type="text/javascript" src="[% themelang %]/lib/greybox/gb_scripts.js"></script>
11
<link href="[% themelang %]/lib/greybox/gb_styles.css" rel="stylesheet" type="text/css" />
12
<!-- /greybox.inc -->
13
14
[% INCLUDE 'doc-head-close.inc' %]
15
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
16
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
17
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
18
<script type="text/javascript">
19
//<![CDATA[
20
    var MSG_DT_FIRST = _("First");
21
    var MSG_DT_LAST = _("Last");
22
    var MSG_DT_NEXT = _("Next");
23
    var MSG_DT_PREVIOUS = _("Previous");
24
    var MSG_DT_EMPTY_TABLE = _("No data available in table");
25
    var MSG_DT_INFO = _("Showing _START_ to _END_ of _TOTAL_");
26
    var MSG_DT_INFO_EMPTY = _("No entries to show");
27
    var MSG_DT_INFO_FILTERED = _("(filtered from _MAX_ total entries)");
28
    var MSG_DT_LENGTH_MENU = _("Show _MENU_ entries");
29
    var MSG_DT_LOADING_RECORDS = _("Loading...");
30
    var MSG_DT_PROCESSING = _("Processing...");
31
    var MSG_DT_SEARCH = _("Search:");
32
    var MSG_DT_ZERO_RECORDS = _("No matching records found");
33
    var CONFIG_EXCLUDE_ARTICLES_FROM_SORT = _("a an the");
34
//]]>
35
</script>
36
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
37
38
<script type="text/javascript">
39
//<![CDATA[
40
function closemenu(){
41
    $(".linktools").hide();
42
    $("tr").removeClass("selected");
43
}
44
$(document).ready(function(){
45
    $("#CheckAll").click(function(){
46
        $(".checkboxed").checkCheckboxes();
47
        return false;
48
    });
49
    $("#CheckNone").click(function(){
50
        $(".checkboxed").unCheckCheckboxes();
51
        return false;
52
    });
53
    /* Inline edit/delete links */
54
    $("td").click(function(event){
55
        var $tgt = $(event.target);
56
        $(".linktools").hide();
57
        $("tr").removeClass("selected");
58
        var row = $(this).parent();
59
        row.addClass("selected");
60
61
        if($tgt.is("a")||$tgt.is(":nth-child(7)")||$tgt.is(":nth-child(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){
62
            return true;
63
        } else {
64
            var position = $(this).offset();
65
            var top = position.top+5;
66
            var left = position.left+5;
67
            $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
68
        }
69
    });
70
    $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
71
        "sDom": 't',
72
        "aoColumnDefs": [
73
            { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false },
74
            { "aTargets": [ 1 ], "sType": "nsb-nse" },
75
        ],
76
        "aaSorting": [[ 1, "asc" ]],
77
        "bPaginate": false
78
    }));
79
    $("form[name='f']").submit(function(){
80
        if ($('input[type=checkbox]').filter(':checked').length == 0) {
81
            alert(_("Please choose at least one Z39.50 target"));
82
            return false;
83
        } else
84
            return true;
85
    });
86
});
87
88
[% IF ( total_pages ) %]
89
function validate_goto_page(){
90
    var page = $('#goto_page').val();
91
    if(isNaN(page)) {
92
        alert(_("The page entered is not a number."));
93
        return false;
94
    }
95
    else if(page < 1 || page > [% total_pages %] ) {
96
        alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
97
        return false;
98
    }
99
    else {
100
        return true;
101
    }
102
}
103
[% END %]
104
105
//]]>
106
</script>
107
<style type="text/css">
108
.linktools { background-color:#FFF;border-top:1px solid #DDD; border-left: 1px solid #DDD; border-right: 1px solid #666; border-bottom:1px solid #666;display: none; white-space: nowrap;}
109
.linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
110
.linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
111
tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }
112
</style>
113
      [% IF ( opsearch ) %]
114
   <style type="text/css">
115
	   #custom-doc { width:53em;*width:51.72em;min-width:689px; margin:auto; text-align:left; }
116
   </style>
117
</head>
118
<body>
119
120
<div id="custom-doc" class="yui-t7">
121
[% ELSE %]
122
</head>
123
<body style="padding:.5em;">
124
<div>
125
[% END %]
126
      <div id="bd">
127
	  [% IF ( opsearch ) %]
128
<h2>Z39.50 Search Points</h2>
129
    <form method="post" action="opac-z3950-search.pl" name="f" class="checkboxed">
130
    <input type="hidden" name="op" id="op" value="do_search" />
131
	<div class="yui-g">
132
    <div class="yui-u first">
133
	    <fieldset class="rows"> 
134
		 <ol><li><label for="title">Title: </label> <input type="text" id="title"  name="title" value="[% title %]" /></li>
135
		 <li><label for="isbn">ISBN/ISSN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
136
		 <li><label for="lccall">LC Call Number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
137
		 <li><label for="controlnumber">Control No.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
138
		 <li><label for="srchany">Raw (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li></ol>
139
  		</fieldset>
140
	    </div>
141
    <div class="yui-u">
142
	<fieldset class="rows">		 <ol><li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author %]" /><!--  <label for="Keyword">Keyword</label> <input type="text" name="keyword" value="" /> --></li>
143
 		 <li> <label for="subject">Subject Heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
144
  		 <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
145
		 <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li></ol>
146
    </fieldset>
147
	    </div>
148
</div>
149
<div class="yui-g">
150
<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select all</a></span><span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></span></h2>
151
152
    [% FOREACH serverloo IN serverloop %]
153
        <p> 
154
            [% IF ( serverloo.checked ) %]
155
                <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" checked="checked" />
156
            [% ELSE %]
157
                <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" />
158
            [% END %]
159
            <label for="z3950_[% serverloo.id %]">[% serverloo.name %]</label>  
160
161
        </p>
162
    [% END %]
163
        </div>
164
    <fieldset class="action"><input type="submit"  class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
165
    </form>
166
167
168
[% ELSE %]
169
    <h2>Results</h2>
170
    [% IF ( breeding_loop ) %]
171
    <table id="resultst">
172
<thead>    <tr>
173
        <th>Server</th>
174
        <th>Title</th>
175
        <th>Author</th>
176
        <th>Date</th>
177
        <th>Edition</th>
178
        <th>ISBN</th>
179
        <th>LCCN</th>
180
        <th>MARC</th>
181
        <th>Card</th>
182
		<th>&nbsp;</th>
183
    </tr></thead>
184
    <tbody>[% FOREACH breeding_loo IN breeding_loop %]
185
        [% IF ( breeding_loo.biblionumber ) %]
186
187
	    <tr id="row[% breeding_loo.biblionumber %]">
188
	        <td>[% breeding_loo.server %] <div class="linktools">
189
                <a href="http://[% breeding_loo.host %]/cgi-bin/koha/opac-showmarc.pl?id=[% breeding_loo.biblionumber %]" rel="gb_page_center[600,500]">Preview MARC</a> 
190
                <a href="http://[% breeding_loo.host %]/cgi-bin/koha/opac-showmarc.pl?viewas=card&amp;id=[% breeding_loo.biblionumber %]" rel="gb_page_center[600,500]">Preview Card</a> 
191
                <a target="_blank" href="http://[% breeding_loo.host %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% breeding_loo.biblionumber %]">Show</a> 
192
                <a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td>
193
            <td>[% breeding_loo.title |html %]</td>
194
            <td>[% breeding_loo.author %]</td>
195
            <td>[% breeding_loo.date %]</td>
196
            <td>[% breeding_loo.edition %]</td>
197
            <td>[% breeding_loo.isbn %]</td>
198
            <td>[% breeding_loo.lccn %]</td>
199
            <td><a href="http://[% breeding_loo.host %]/cgi-bin/koha/opac-showmarc.pl?id=[% breeding_loo.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td>
200
            <td><a href="http://[% breeding_loo.host %]/cgi-bin/koha/opac-showmarc.pl?viewas=card&amp;id=[% breeding_loo.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
201
            <td><a target="_blank" href="http://[% breeding_loo.host %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% breeding_loo.biblionumber %]">Show</a></td>
202
        </tr>
203
        [% END %]
204
    [% END %]</tbody>
205
</table>
206
207
    <form method="post" action="opac-z3950-search.pl" id="page_form" name="page_form" class="checkboxed">
208
        <input type="hidden" name="op" id="op" value="do_search" />
209
        <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
210
        <input type="hidden" id="title"  name="title" value="[% title %]" />
211
        <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
212
        <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
213
        <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber %]" />
214
        <input type="hidden" id="srchany" name="srchany" value="[% srchany %]" />
215
        <input type="hidden" id="author" name="author" value="[% author %]" />
216
        <input type="hidden" id="subject" name="subject" value="[% subject %]" />
217
        <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
218
        <input type="hidden" id="stdid" name="stdid" value="[% stdid %]" />
219
        
220
        [% FOREACH server IN servers %]
221
        <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
222
        [% END %]
223
224
        [% IF ( show_prevbutton ) %]
225
            <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
226
        [% END %]
227
        Page [% current_page %] / [% total_pages %]
228
        [% IF ( show_nextbutton ) %]
229
            <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
230
        [% END %]
231
        <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" />
232
    </form>
233
234
    [% ELSE %]
235
        [% IF ( emptyserverlist ) %]
236
            You didn't select any Z39.50 target.
237
        [% ELSE %]
238
            [% FOREACH errcon IN errconn %]
239
                Connection failed to [% errcon.server %]
240
            [% END %]
241
        [% END %]
242
	<p>Nothing found.</p>
243
	<p><form method="get" action="/cgi-bin/koha/opac-z3950-search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode %]"/><input type="submit" value="Try Another Search"/></form></p>
244
    [% END %]
245
[% END %]
246
247
	</div>
248
</div>
249
[% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
250
251
</body>
252
</html>
253
(-)a/opac/opac-z3950-search.pl (-1 / +323 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# This is a completely new Z3950 clients search using async ZOOM -TG 02/11/06
4
# Copyright 2000-2002 Katipo Communications
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it under the
9
# terms of the GNU General Public License as published by the Free Software
10
# Foundation; either version 2 of the License, or (at your option) any later
11
# version.
12
#
13
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License along
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21
use strict;
22
use warnings;
23
use CGI;
24
25
use C4::Auth;
26
use C4::Output;
27
use C4::Biblio;
28
use C4::Context;
29
use C4::Koha;
30
use C4::Charset;
31
use ZOOM;
32
33
my $input        = new CGI;
34
my $dbh          = C4::Context->dbh;
35
my $error         = $input->param('error');
36
my $title         = $input->param('title');
37
my $author        = $input->param('author');
38
my $isbn          = $input->param('isbn');
39
my $issn          = $input->param('issn');
40
my $lccn          = $input->param('lccn');
41
my $lccall        = $input->param('lccall');
42
my $subject       = $input->param('subject');
43
my $dewey         = $input->param('dewey');
44
my $controlnumber	= $input->param('controlnumber');
45
my $stdid			= $input->param('stdid');
46
my $srchany			= $input->param('srchany');
47
my $random        = $input->param('random') || rand(1000000000); # this var is not useful anymore just kept for rel2_2 compatibility
48
my $op            = $input->param('op');
49
50
my $page            = $input->param('current_page') || 1;
51
$page = $input->param('goto_page') if $input->param('changepage_goto');
52
my $show_next = 0;
53
my $total_pages = 0;
54
55
my $numberpending;
56
my $attr = '';
57
my $term;
58
my $host;
59
my $server;
60
my $database;
61
my $port;
62
my $marcdata;
63
my @encoding;
64
my @results;
65
my $count;
66
my $record;
67
my $oldbiblio;
68
my $errmsg;
69
my @serverloop = ();
70
my @serverhost;
71
my @servername;
72
my @breeding_loop = ();
73
74
my $DEBUG = 0;    # if set to 1, many debug message are send on syslog.
75
76
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
77
        template_name   => "opac-z3950-search.tt",
78
        query           => $input,
79
        type            => "opac",
80
        authnotrequired => 1,
81
        debug           => 1,
82
});
83
84
$template->param(
85
    isbn         => $isbn,
86
    issn         => $issn,
87
    lccn         => $lccn,
88
    lccall       => $lccall,
89
    title        => $title,
90
    author       => $author,
91
    controlnumber=> $controlnumber,
92
    stdid		 => $stdid,
93
    srchany		 => $srchany,
94
    dewey        => $dewey,
95
    subject      => $subject,
96
);
97
98
if ( $op ne "do_search" ) {
99
    my $sth = $dbh->prepare("select id,host,name,checked from z3950servers where opac=1 order by host;");
100
    $sth->execute();
101
    my $serverloop = $sth->fetchall_arrayref( {} );
102
    $template->param(
103
        serverloop   => $serverloop,
104
        opsearch     => "search",
105
    );
106
    output_html_with_http_headers $input, $cookie, $template->output;
107
}
108
else {
109
    my @id = $input->param('id');
110
111
    if ( not defined @id ) {
112
        # empty server list -> report and exit
113
        $template->param( emptyserverlist => 1 );
114
        output_html_with_http_headers $input, $cookie, $template->output;
115
        exit;
116
    }
117
118
    my @oConnection;
119
    my @oResult;
120
    my @errconn;
121
    my $s = 0;
122
    my $query;
123
    my $nterms;
124
    if ($isbn || $issn) {
125
        $term=$isbn if ($isbn);
126
        $term=$issn if ($issn);
127
        $term =~ s/"/\\"/;
128
        $query .= " \@or \@attr 1=8 \"$term\" \@attr 1=7 \"$term\" ";
129
        $nterms++;
130
    }
131
    if ($title) {
132
        utf8::decode($title);
133
        $title =~ s/"/\\"/;
134
        $query .= " \@attr 1=4 \"$title\" ";
135
        $nterms++;
136
    }
137
    if ($author) {
138
        utf8::decode($author);
139
        $author =~ s/"/\\"/;
140
        $query .= " \@attr 1=1003 \"$author\" ";
141
        $nterms++;
142
    }
143
    if ($dewey) {
144
        $dewey =~ s/"/\\"/;
145
        $query .= " \@attr 1=16 \"$dewey\" ";
146
        $nterms++;
147
    }
148
    if ($subject) {
149
        utf8::decode($subject);
150
        $subject =~ s/"/\\"/;
151
        $query .= " \@attr 1=21 \"$subject\" ";
152
        $nterms++;
153
    }
154
	if ($lccn) {	
155
        $lccn =~ s/"/\\"/;
156
        $query .= " \@attr 1=9 \"$lccn\" ";
157
        $nterms++;
158
    }
159
    if ($lccall) {
160
        $lccall =~ s/"/\\"/;
161
        $query .= " \@attr 1=16 \@attr 2=3 \@attr 3=1 \@attr 4=1 \@attr 5=1 \@attr 6=1 \"$lccall\" ";
162
        $nterms++;
163
    }
164
    if ($controlnumber) {
165
        $controlnumber =~ s/"/\\"/;
166
        $query .= " \@attr 1=12 \"$controlnumber\" ";
167
        $nterms++;
168
    }
169
    if ($stdid) {
170
        $stdid =~ s/"/\\"/;
171
        $query .= " \@attr 1=1007 \"$stdid\" ";
172
        $nterms++;
173
    }
174
    if ($srchany) {
175
        $srchany =~ s/"/\\"/;
176
        $query .= " \@attr 1=1016 \"$srchany\" ";
177
        $nterms++;
178
    }
179
for my $i (1..$nterms-1) {
180
    $query = "\@and " . $query;
181
}
182
warn "query ".$query  if $DEBUG;
183
184
    foreach my $servid (@id) {
185
        my $sth = $dbh->prepare("select * from z3950servers where id=?");
186
        $sth->execute($servid);
187
        while ( $server = $sth->fetchrow_hashref ) {
188
            warn "serverinfo ".join(':',%$server) if $DEBUG;
189
            my $option1      = new ZOOM::Options();
190
            $option1->option('async' => 1);
191
            $option1->option('elementSetName', 'F');
192
            $option1->option('databaseName', $server->{db});
193
            $option1->option('user',         $server->{userid}  ) if $server->{userid};
194
            $option1->option('password',     $server->{password}) if $server->{password};
195
            $option1->option('preferredRecordSyntax', $server->{syntax});
196
            $oConnection[$s] = create ZOOM::Connection($option1)
197
              || $DEBUG
198
              && warn( "" . $oConnection[$s]->errmsg() );
199
            warn( "server data", $server->{name}, $server->{port} ) if $DEBUG;
200
            $oConnection[$s]->connect( $server->{host}, $server->{port} )
201
              || $DEBUG
202
              && warn( "" . $oConnection[$s]->errmsg() );
203
            $serverhost[$s] = $server->{host};
204
            $servername[$s] = $server->{name};
205
            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
206
            $s++;
207
        }    ## while fetch
208
    }    # foreach
209
    my $nremaining  = $s;
210
    my $firstresult = 1;
211
212
    for ( my $z = 0 ; $z < $s ; $z++ ) {
213
        warn "doing the search" if $DEBUG;
214
        $oResult[$z] = $oConnection[$z]->search_pqf($query)
215
          || $DEBUG
216
          && warn( "somthing went wrong: " . $oConnection[$s]->errmsg() );
217
218
        # $oResult[$z] = $oConnection[$z]->search_pqf($query);
219
    }
220
221
  AGAIN:
222
    my $k;
223
    my $event;
224
    while ( ( $k = ZOOM::event( \@oConnection ) ) != 0 ) {
225
        $event = $oConnection[ $k - 1 ]->last_event();
226
        warn( "connection ", $k - 1, ": event $event (",
227
            ZOOM::event_str($event), ")\n" )
228
          if $DEBUG;
229
        last if $event == ZOOM::Event::ZEND;
230
    }
231
232
    if ( $k != 0 ) {
233
        $k--;
234
        warn $serverhost[$k] if $DEBUG;
235
        my ( $error, $errmsg, $addinfo, $diagset ) =
236
          $oConnection[$k]->error_x();
237
        if ($error) {
238
            if ($error =~ m/^(10000|10007)$/ ) {
239
                push(@errconn, {'server' => $serverhost[$k]});
240
            }
241
            $DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n";
242
        }
243
        else {
244
            my $numresults = $oResult[$k]->size();
245
            my $i;
246
            my $result = '';
247
            if ( $numresults > 0  and $numresults >= (($page-1)*20)) {
248
                $show_next = 1 if $numresults >= ($page*20);
249
                $total_pages = int($numresults/20)+1 if $total_pages < ($numresults/20);
250
                for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
251
                    my $rec = $oResult[$k]->record($i);
252
                    if ($rec) {
253
                        my $marcrecord;
254
                        $marcdata   = $rec->raw();
255
256
                        my ($charset_result, $charset_errors);
257
                        ($marcrecord, $charset_result, $charset_errors) = 
258
                          MarcToUTF8Record($marcdata, C4::Context->preference('marcflavour'), $encoding[$k]);
259
####WARNING records coming from Z3950 clients are in various character sets MARC8,UTF8,UNIMARC etc
260
## In HEAD i change everything to UTF-8
261
# In rel2_2 i am not sure what encoding is so no character conversion is done here
262
##Add necessary encoding changes to here -TG
263
264
                        SetUTF8Flag($marcrecord);
265
266
                        my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" );
267
                        $oldbiblio->{isbn}   =~ s/ |-|\.//g if $oldbiblio->{isbn};
268
                        # pad | and ( with spaces to allow line breaks in the html
269
                        $oldbiblio->{isbn} =~ s/\|/ \| /g if $oldbiblio->{isbn};
270
                        $oldbiblio->{isbn} =~ s/\(/ \(/g if $oldbiblio->{isbn};
271
272
                        $oldbiblio->{issn} =~ s/ |-|\.//g if $oldbiblio->{issn};
273
                        # pad | and ( with spaces to allow line breaks in the html
274
                        $oldbiblio->{issn} =~ s/\|/ \| /g if $oldbiblio->{issn};
275
                        $oldbiblio->{issn} =~ s/\(/ \(/g if $oldbiblio->{issn};
276
                        my %row_data;
277
                        $row_data{server}       = $servername[$k];
278
                        $row_data{host}         = $serverhost[$k];
279
                        $row_data{isbn}         = $oldbiblio->{isbn};
280
                        $row_data{lccn}         = $oldbiblio->{lccn};
281
                        $row_data{title}        = $oldbiblio->{title};
282
                        $row_data{author}       = $oldbiblio->{author};
283
                        $row_data{date}         = $oldbiblio->{copyrightdate};
284
                        $row_data{edition}      = $oldbiblio->{editionstatement};
285
                        $row_data{biblionumber} = $oldbiblio->{biblionumber};
286
                        push( @breeding_loop, \%row_data );
287
		            
288
                    } else {
289
                        push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'biblionumber'=>-1});
290
                    } # $rec
291
                }
292
            }    #$numresults
293
        }
294
    }    # if $k !=0
295
    $numberpending = $nremaining - 1;
296
    
297
    my @servers = ();
298
    foreach my $id (@id) {
299
        push(@servers,{id => $id});
300
    }
301
    
302
    $template->param(
303
        breeding_loop => \@breeding_loop,
304
        server        => $servername[$k],
305
        numberpending => $numberpending,
306
        errconn       => \@errconn,
307
        current_page => $page,
308
        servers => \@servers,
309
        total_pages => $total_pages,
310
    );
311
    $template->param(show_nextbutton=>1) if $show_next;
312
    $template->param(show_prevbutton=>1) if $page != 1;
313
    
314
    output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0;
315
316
    #  	print  $template->output  if $firstresult !=1;
317
    $firstresult++;
318
319
  MAYBE_AGAIN:
320
    if ( --$nremaining > 0 ) {
321
        goto AGAIN;
322
    }
323
}    ## if op=search

Return to bug 11361