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

(-)a/C4/Auth.pm (+1 lines)
Lines 562-567 sub get_template_and_user { Link Here
562
            OPACURLOpenInNewWindow                => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
562
            OPACURLOpenInNewWindow                => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
563
            OPACUserCSS                           => "" . C4::Context->preference("OPACUserCSS"),
563
            OPACUserCSS                           => "" . C4::Context->preference("OPACUserCSS"),
564
            OpacAuthorities                       => C4::Context->preference("OpacAuthorities"),
564
            OpacAuthorities                       => C4::Context->preference("OpacAuthorities"),
565
            OpacZ3950                             => C4::Context->preference("OpacZ3950"),
565
            opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
566
            opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
566
            opac_search_limit                     => $opac_search_limit,
567
            opac_search_limit                     => $opac_search_limit,
567
            opac_limit_override                   => $opac_limit_override,
568
            opac_limit_override                   => $opac_limit_override,
(-)a/C4/Breeding.pm (-4 / +6 lines)
Lines 126-132 The second parameter $template is a Template object. The routine uses this param Link Here
126
=cut
126
=cut
127
127
128
sub Z3950Search {
128
sub Z3950Search {
129
    my ($pars, $template)= @_;
129
    my ($pars, $template, $fromopac)= @_;
130
130
131
    my @id= @{$pars->{id}};
131
    my @id= @{$pars->{id}};
132
    my $page= $pars->{page};
132
    my $page= $pars->{page};
Lines 192-198 sub Z3950Search { Link Here
192
                    for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
192
                    for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
193
                        if ( $oResult[$k]->record($i) ) {
193
                        if ( $oResult[$k]->record($i) ) {
194
                            undef $error;
194
                            undef $error;
195
                            ( $res, $error ) = _handle_one_result( $oResult[$k]->record($i), $servers[$k], ++$imported, $biblionumber, $xslh ); #ignores error in sequence numbering
195
                            ( $res, $error ) = _handle_one_result( $oResult[$k]->record($i), $servers[$k], ++$imported, $biblionumber, $xslh, $fromopac ); #ignores error in sequence numbering
196
                            push @breeding_loop, $res if $res;
196
                            push @breeding_loop, $res if $res;
197
                            push @errconn, { server => $servers[$k]->{servername}, error => $error, seq => $i+1 } if $error;
197
                            push @errconn, { server => $servers[$k]->{servername}, error => $error, seq => $i+1 } if $error;
198
                        }
198
                        }
Lines 291-297 sub _build_query { Link Here
291
}
291
}
292
292
293
sub _handle_one_result {
293
sub _handle_one_result {
294
    my ( $zoomrec, $servhref, $seq, $bib, $xslh )= @_;
294
    my ( $zoomrec, $servhref, $seq, $bib, $xslh, $fromopac )= @_;
295
295
296
    my $raw= $zoomrec->raw();
296
    my $raw= $zoomrec->raw();
297
    my $marcrecord;
297
    my $marcrecord;
Lines 304-310 sub _handle_one_result { Link Here
304
    }
304
    }
305
    SetUTF8Flag($marcrecord);
305
    SetUTF8Flag($marcrecord);
306
    my $error;
306
    my $error;
307
    ( $marcrecord, $error ) = _do_xslt_proc($marcrecord, $servhref, $xslh);
307
    ( $marcrecord, $error ) = _do_xslt_proc($marcrecord, $servhref, $xslh) unless $fromopac;
308
308
309
    my $batch_id = GetZ3950BatchId($servhref->{servername});
309
    my $batch_id = GetZ3950BatchId($servhref->{servername});
310
    my $breedingid = AddBiblioToBatch($batch_id, $seq, $marcrecord, 'UTF-8', 0);
310
    my $breedingid = AddBiblioToBatch($batch_id, $seq, $marcrecord, 'UTF-8', 0);
Lines 318-323 sub _handle_one_result { Link Here
318
        {
318
        {
319
            biblionumber => $bib,
319
            biblionumber => $bib,
320
            server       => $servhref->{servername},
320
            server       => $servhref->{servername},
321
            host         => $servhref->{host},
321
            breedingid   => $breedingid,
322
            breedingid   => $breedingid,
322
        }, $marcrecord) if $breedingid;
323
        }, $marcrecord) if $breedingid;
323
    return ( $row, $error );
324
    return ( $row, $error );
Lines 350-355 sub _do_xslt_proc { Link Here
350
sub _add_rowdata {
351
sub _add_rowdata {
351
    my ($row, $record)=@_;
352
    my ($row, $record)=@_;
352
    my %fetch= (
353
    my %fetch= (
354
        biblionumber => 'biblio.biblionumber',
353
        title => 'biblio.title',
355
        title => 'biblio.title',
354
        author => 'biblio.author',
356
        author => 'biblio.author',
355
        isbn =>'biblioitems.isbn',
357
        isbn =>'biblioitems.isbn',
(-)a/Koha/Schema/Result/Z3950server.pm (+8 lines)
Lines 126-131 __PACKAGE__->table("z3950servers"); Link Here
126
  is_nullable: 1
126
  is_nullable: 1
127
  size: 255
127
  size: 255
128
128
129
=head2 opac
130
131
  data_type: 'tinyint'
132
  is_nullable: 1
133
  size: 1
134
129
=cut
135
=cut
130
136
131
__PACKAGE__->add_columns(
137
__PACKAGE__->add_columns(
Lines 175-180 __PACKAGE__->add_columns( Link Here
175
  { data_type => "longtext", is_nullable => 1 },
181
  { data_type => "longtext", is_nullable => 1 },
176
  "attributes",
182
  "attributes",
177
  { data_type => "varchar", is_nullable => 1, size => 255 },
183
  { data_type => "varchar", is_nullable => 1, size => 255 },
184
  "opac",
185
  { data_type => "tinyint", is_nullable => 1, size => 1 },
178
);
186
);
179
187
180
=head1 PRIMARY KEY
188
=head1 PRIMARY KEY
(-)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 attributes
69
        recordtype checked servername servertype sru_options sru_fields attributes opac
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/bug11361.perl (+8 lines)
Line 0 Link Here
1
$DBversion = "XXX";
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do("ALTER TABLE z3950servers ADD COLUMN opac TINYINT(1);");
4
    $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');");
5
    print "Add opac column to z3950servers table.";
6
    print "Add OPACZ3950 preference.";
7
    SetVersion($DBversion);
8
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 426-431 OPAC: Link Here
426
                  yes: Allow
426
                  yes: Allow
427
                  no: "Don't allow"
427
                  no: "Don't allow"
428
            - patrons to search your authority records.
428
            - patrons to search your authority records.
429
        -
430
            - pref: OpacZ3950
431
              choices:
432
                  yes: Allow
433
                  no: "Don't allow"
434
            - patrons to search for bibliographic records in other libraries via Z39.50.
429
        -
435
        -
430
            - pref: opacbookbag
436
            - pref: opacbookbag
431
              choices:
437
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt (-2 / +9 lines)
Lines 79-84 Link Here
79
            <input type="checkbox" name="checked" id="checked" value="1" />
79
            <input type="checkbox" name="checked" id="checked" value="1" />
80
        [% END %]
80
        [% END %]
81
        </li>
81
        </li>
82
        <li><label for="opac">OPAC (Shown in OPAC Z39.50 search): </label>
83
        [% IF ( server.opac ) %]
84
            <input type="checkbox" size="1" name="opac" id="opac" value="1" checked="checked" />
85
        [% ELSE %]
86
            <input type="checkbox" size="1" name="opac" id="opac" value="1" />
87
        [% END %]
88
        </li>
82
        <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank | html %]" />
89
        <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank | html %]" />
83
        </li>
90
        </li>
84
        [% IF (server.servertype||type) == 'zed' %]
91
        [% IF (server.servertype||type) == 'zed' %]
Lines 161-168 Link Here
161
        You searched for [% searchfield | html %]
168
        You searched for [% searchfield | html %]
162
    [% END %]
169
    [% END %]
163
    <table id="serverst">
170
    <table id="serverst">
164
171
        <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>Opac</th><th>Options</th>
165
        <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>Actions</th>
166
        </tr></thead>
172
        </tr></thead>
167
        <tbody>
173
        <tbody>
168
        [% FOREACH loo IN loop %]
174
        [% FOREACH loo IN loop %]
Lines 176-181 Link Here
176
                [% END %]
182
                [% END %]
177
            </td>
183
            </td>
178
            <td>[% loo.attributes | html %]</td>
184
            <td>[% loo.attributes | html %]</td>
185
            <td>[% IF loo.opac %]X[% END %]</td>
179
            <td>
186
            <td>
180
                <div class="btn-group dropup">
187
                <div class="btn-group dropup">
181
                    <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id | html %]" role="button" data-toggle="dropdown" href="#">
188
                    <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id | html %]" role="button" data-toggle="dropdown" href="#">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (+5 lines)
Lines 310-315 Link Here
310
                            <a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>
310
                            <a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a>
311
                        </li>
311
                        </li>
312
                    [% END %]
312
                    [% END %]
313
                    [% IF Koha.Preference( 'OpacZ3950' ) %]
314
                        <li><span id="z3950searchOpac">
315
                            <a target="_blank" href="#" >Z39.50 Search</a></span>
316
                        </li>
317
                    [% END %]
313
                    [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]
318
                    [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]
314
                        <li class="nav-item">
319
                        <li class="nav-item">
315
                            <a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>
320
                            <a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (+12 lines)
Lines 323-328 $(document).ready(function() { Link Here
323
        [% Koha.Preference('OPACUserJS') | $raw %]
323
        [% Koha.Preference('OPACUserJS') | $raw %]
324
    </script>
324
    </script>
325
[% END %]
325
[% END %]
326
[% IF Koha.Preference( 'OpacZ3950' ) %]
327
<script type="text/javascript">
328
//<![CDATA[
329
     $(document).ready(function() {
330
        $("#z3950searchOpac").click(function(){
331
            window.open("/cgi-bin/koha/opac-z3950-search.pl","z3950searchOpac",'width=800,height=550,location=yes,toolbar=no,scrollbars=yes,resize=yes');
332
            return false;
333
        });
334
     });
335
//]]>
336
</script>
337
[% END %]
326
[% IF SCO_login %]
338
[% IF SCO_login %]
327
    [% SET SCOUserJS = Koha.Preference('SCOUserJS') %]
339
    [% SET SCOUserJS = Koha.Preference('SCOUserJS') %]
328
    [% IF ( SCOUserJS ) %]
340
    [% IF ( SCOUserJS ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt (+304 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
Koha &rsaquo; Z39.50/SRU search results
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'greybox.inc' %]
6
[% BLOCK cssinclude %][% END %]
7
    <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
8
    <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/staff-global.css" />
9
10
    <style type="text/css">
11
        .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;}
12
        .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
13
        .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
14
        tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }
15
16
        .input-prepend.input-block-level {
17
          display: table;
18
          margin: 2px;
19
        }
20
        .input-prepend.input-block-level .add-on {
21
          display: table-cell;
22
          width: 1%; /* remove this if you want default bootstrap button width */
23
        }
24
        .input-prepend.input-block-level > input {
25
          box-sizing: border-box; /* use bootstrap mixin or include vendor variants */
26
          -moz-box-sizing: border-box; /* for Firefox */
27
          display: table; /* table-cell is not working well in Chrome for small widths */
28
          min-height: inherit;
29
          width: 100%;
30
        }
31
        .input-prepend.input-block-level > input {
32
          border-left: 0;
33
        }
34
        .marginbot{
35
            margin-bottom:10px;
36
        }
37
    </style>
38
</head>
39
[% IF ( opsearch ) %]
40
<body id="cat_z3950_search">
41
[% ELSE %]
42
<body style="padding:.5em;">
43
[% END %]
44
    <div class="main">
45
      <div class="container-fluid">
46
[% search_fields = [
47
    { label => "ISBN", prop => 'isbn' },
48
    { label => "ISSN", prop => 'issn' },
49
    { label => "Title", prop => 'title' },
50
    { label => "Author", prop => 'author' },
51
    { label => "Subject Heading", prop => 'subject' },
52
    { label => "Keyword (any)", prop => 'srchany' },
53
    { label => "LC call number", prop => 'lccall' },
54
    { label => "Control no.", prop => 'controlnumber' },
55
    { label => "Dewey", prop => 'dewey' },
56
    { label => "Standard ID", prop => 'stdid' }
57
] %]
58
[% IF ( opsearch ) %]
59
<div class="row-fluid">
60
    <h2>Z39.50/SRU search</h2>
61
</div>
62
<form method="post" action="opac-z3950-search.pl" name="f">
63
    <div class="row-fluid">
64
        <input type="hidden" name="op" id="op" value="do_search" />
65
        <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
66
        <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
67
        <div id="search_params" class="span6 form-horizontal">
68
            <h2>Search Parameters</h2>
69
            <div id="search_field" class="well">
70
                [% FOREACH field IN search_fields %]
71
                    <div class="input-prepend input-block-level">
72
                        <span class="add-on">[% field.label %]</span>
73
                        <input type="text" id="[% field.prop %]" name="[% field.prop %]" value="[% ${field.prop} %]" />
74
                    </div>
75
                [% END %]
76
            </div>
77
            <div class="control-group">
78
                <div calss="controls">
79
                    <button onclick="$("form[name='f']").submit();" class="btn search-submit">Search</button>
80
                    <a href="#">Cancel</a>
81
                </div>
82
            </div>
83
        </div>
84
        <div class="span5">
85
          <h2>
86
              Search targets
87
              <span style="display: inline; font-size: 70%; padding-left: 1em;">
88
                  <span class="checkall">
89
                    <a id="CheckAll" href="#">Select all</a>
90
                  </span>
91
                  <span class="clearall">
92
                    <a id="CheckNone" href="#">Clear all</a>
93
                  </span>
94
              </span>
95
          </h2>
96
          <div id="z3950_search_targets" class="well checkboxed">
97
        [% FOREACH serverloo IN serverloop %]
98
          <div class="input-group">
99
            <label for="z3950_[% serverloo.id %]">
100
                <input
101
                    style="vertical-align:-2px"
102
                    type="checkbox" name="id"
103
                    id="z3950_[% serverloo.id %]"
104
                    value="[% serverloo.id %]"
105
                    [% IF ( serverloo.checked ) %]checked="checked"[% END %]
106
                />
107
                [% serverloo.servername %]
108
            </label>
109
          </div>
110
        [% END %]
111
     </div>
112
    </div>
113
</form>
114
115
[% ELSE %]
116
<div class="row-fluid">
117
    <h2>Results</h2>
118
    <p>You searched for:
119
        [% FOREACH field IN search_fields %]
120
            [% IF ( ${field.prop} ) %]<em>[% field.label %]: </em><span class=term>[% ${field.prop} %]</span> [% END %]
121
        [% END %]
122
    </p>
123
</div>
124
    [% IF ( errconn ) %]
125
            <div class="alert alert-danger">
126
                <ul>
127
                [% FOREACH errcon IN errconn %]
128
                    [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li>
129
                    [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li>
130
                    [% ELSIF ( errcon.error == 'xslt_err' ) %]<li>[% errcon.server %]: Warning: XSLT error on search result [% errcon.seq %]</li>
131
                    [% ELSE %]<li>[% errcon.server %] record [% errcon.seq %]: [% errcon.error %]</li>
132
                    [% END %]
133
                [% END %]
134
                </ul>
135
            </div>
136
    [% END %]
137
<div class="row-fluid marginbot">
138
    <div class="span12">
139
        [% IF ( breeding_loop ) %]
140
        <table id="resultst" class="table table-condensed">
141
    <thead>    <tr>
142
            <th>Server</th>
143
            <th>Title</th>
144
            <th>Author</th>
145
            <th>Date</th>
146
            <th>Edition</th>
147
            <th>ISBN</th>
148
            <th>LCCN</th>
149
            <th>MARC</th>
150
            <th>Card</th>
151
            <th>&nbsp;</th>
152
        </tr></thead>
153
        <tbody>[% FOREACH breeding_loo IN breeding_loop %]
154
            [% IF ( breeding_loo.breedingid ) %]
155
            <tr id="row[% breeding_loo.breedingid %]">
156
                <td>[% breeding_loo.server %] </td>
157
                <td>[% breeding_loo.title |html %]</td>
158
                <td>[% breeding_loo.author %]</td>
159
                <td>[% breeding_loo.date %]</td>
160
                <td>[% breeding_loo.edition %]</td>
161
                <td>[% breeding_loo.isbn %]</td>
162
                <td>[% breeding_loo.lccn %]</td>
163
                <td><a href="/cgi-bin/koha/opac-showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td>
164
                <td><a href="/cgi-bin/koha/opac-showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
165
                <td><a target="_blank" href="http://[% breeding_loo.opacurl %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% breeding_loo.biblionumber %]">Show</a></td>
166
            </tr>
167
            [% END %]
168
        [% END %]</tbody>
169
        </table>
170
    </div>
171
</div>
172
173
<form method="post" action="opac-z3950-search.pl" id="page_form" name="page_form">
174
    <input type="hidden" name="op" id="op" value="do_search" />
175
    <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
176
    <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
177
    <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
178
    [% FOREACH field IN search_fields %]
179
        <input type="hidden" name="[% field.prop %]" value="[% ${field.prop} %]" />
180
    [% END %]
181
182
    [% FOREACH server IN servers %]
183
    <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
184
    [% END %]
185
[% IF total_pages > 1 %]
186
    <div class="row-fluid">
187
        <div class="span4">
188
            <div class="input-prepend input-append">
189
                [% IF ( show_prevbutton ) %]
190
                    <button class="btn" type="button" name="changepage_prev" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();">Previous Page</button>
191
                [% END %]
192
                <span class="add-on">Page [% current_page %] / [% total_pages %]</span>
193
                [% IF ( show_nextbutton ) %]
194
                    <button class="btn" type="button" name="changepage_next" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();">Next Page</button>
195
                [% END %]
196
            </div>
197
        </div>
198
        <div class="span2 offset5">
199
            <div class="input-prepend input-append">
200
                <span class="add-on">Go to page</span>
201
                <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" type="text"/>
202
                <button class="btn" type="submit" name="changepage_goto" onclick="return validate_goto_page();">Go</button>
203
            </div>
204
        </div>
205
[% END %]
206
</form>
207
208
209
[% ELSE %]
210
    <div class="alert alert-warning">Nothing found.</div>
211
[% END %]
212
    <div class="row-fluid marginbot">
213
        <div class="span12">
214
           <a class="btn" href="/cgi-bin/koha/opac-z3950-search.pl">Try another search</a>
215
        </div>
216
    </div>
217
</div>
218
[% END %]
219
220
    </div>
221
</div>
222
223
[% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
224
225
[% INCLUDE 'opac-bottom.inc' %]
226
[% BLOCK jsinclude %][% END %]
227
[% INCLUDE 'datatables.inc' %]
228
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
229
230
<script type="text/javascript">
231
//<![CDATA[
232
function Import(GetThisOne,biblionumber) {
233
    opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne;
234
    window.close();
235
    return false;
236
}
237
238
function closemenu(){
239
    $(".linktools").hide();
240
    $("tr").removeClass("selected");
241
}
242
243
$(document).ready(function(){
244
    $("#CheckAll").click(function(){
245
        $(".checkboxed").checkCheckboxes();
246
        return false;
247
    });
248
    $("#CheckNone").click(function(){
249
        $(".checkboxed").unCheckCheckboxes();
250
        return false;
251
    });
252
    $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
253
        "sDom": 't',
254
        "aoColumnDefs": [
255
            { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false },
256
            { "aTargets": [ 1 ], "sType": "nsb-nse" },
257
        ],
258
        "aaSorting": [[ 1, "asc" ]],
259
        "bPaginate": false
260
    }));
261
        /* Inline edit/delete links */
262
        $("td").click(function(event){
263
            var $tgt = $(event.target);
264
            var row = $(this).parent();
265
            $(".linktools").hide();
266
            $("tr").removeClass("selected");
267
            row.addClass("selected");
268
            if($tgt.is("a")||$tgt.is(":nth-child(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){
269
                //Don't show inline links for cells containing links of their own.
270
            } else {
271
                var position = $(this).offset();
272
                var top = position.top+5;
273
                var left = position.left+5;
274
                $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
275
            }
276
        });
277
    $("form[name='f']").submit(function(){
278
        if ($('input[type=checkbox]').filter(':checked').length == 0) {
279
            alert(_("Please choose at least one external target"));
280
            return false;
281
        } else {
282
            $("*").css("cursor", "progress");
283
            return true;
284
        }
285
    });
286
});
287
288
[% IF ( total_pages ) %]
289
function validate_goto_page(){
290
    var page = $('#goto_page').val();
291
    if(isNaN(page)) {
292
        alert(_("The page entered is not a number."));
293
        return false;
294
    }
295
    else if(page < 1 || page > [% total_pages %] ) {
296
        alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
297
        return false;
298
    }
299
    else {
300
        return true;
301
    }
302
}
303
[% END %]
304
</script>
(-)a/opac/opac-z3950-search.pl (-1 / +117 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::Context;
28
use C4::Breeding;
29
use C4::Koha;
30
31
my $input        = new CGI;
32
my $error         = $input->param('error');
33
my $biblionumber  = $input->param('biblionumber') || 0;
34
my $frameworkcode = $input->param('frameworkcode');
35
my $title         = $input->param('title');
36
my $author        = $input->param('author');
37
my $isbn          = $input->param('isbn');
38
my $issn          = $input->param('issn');
39
my $lccn          = $input->param('lccn');
40
my $lccall        = $input->param('lccall');
41
my $subject       = $input->param('subject');
42
my $dewey         = $input->param('dewey');
43
my $controlnumber = $input->param('controlnumber');
44
my $stdid         = $input->param('stdid');
45
my $srchany       = $input->param('srchany');
46
my $op            = $input->param('op')||'';
47
48
my $page            = $input->param('current_page') || 1;
49
$page = $input->param('goto_page') if $input->param('changepage_goto');
50
51
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
52
        template_name   => "opac-z3950-search.tt",
53
        query           => $input,
54
        type            => "opac",
55
        authnotrequired => 1,
56
        debug           => 1,
57
});
58
59
$template->param(
60
    frameworkcode => $frameworkcode,
61
    isbn         => $isbn,
62
    issn         => $issn,
63
    lccn         => $lccn,
64
    lccall       => $lccall,
65
    title        => $title,
66
    author       => $author,
67
    controlnumber=> $controlnumber,
68
    stdid        => $stdid,
69
    srchany      => $srchany,
70
    biblionumber => $biblionumber,
71
    dewey        => $dewey,
72
    subject      => $subject,
73
);
74
75
if ( $op ne "do_search" ) {
76
    my $schema = Koha::Database->new()->schema();
77
    my $rs = $schema->resultset('Z3950server')->search(
78
        {
79
            recordtype => 'biblio',
80
            servertype => ['zed', 'sru'],
81
            opac => '1',
82
        },
83
        { result_class => 'DBIx::Class::ResultClass::HashRefInflator' },
84
    );
85
    $template->param(
86
        serverloop   => [ $rs->all ],
87
        opsearch     => "search",
88
    );
89
    output_html_with_http_headers $input, $cookie, $template->output;
90
    exit;
91
}
92
93
my @id = $input->param('id');
94
if ( @id==0 ) {
95
        # empty server list -> report and exit
96
        $template->param( emptyserverlist => 1 );
97
        output_html_with_http_headers $input, $cookie, $template->output;
98
        exit;
99
}
100
101
my $pars= {
102
        biblionumber => $biblionumber,
103
        page => $page,
104
        id => \@id,
105
        isbn => $isbn,
106
        issn => $issn,
107
        title => $title,
108
        author => $author,
109
        dewey => $dewey,
110
        subject => $subject,
111
        lccall => $lccall,
112
        controlnumber => $controlnumber,
113
        stdid => $stdid,
114
        srchany => $srchany,
115
};
116
Z3950Search($pars, $template, 1);
117
output_html_with_http_headers $input, $cookie, $template->output;

Return to bug 11361