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

(-)a/C4/Auth.pm (+1 lines)
Lines 523-528 sub get_template_and_user { Link Here
523
            OPACURLOpenInNewWindow                => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
523
            OPACURLOpenInNewWindow                => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
524
            OPACUserCSS                           => "" . C4::Context->preference("OPACUserCSS"),
524
            OPACUserCSS                           => "" . C4::Context->preference("OPACUserCSS"),
525
            OpacAuthorities                       => C4::Context->preference("OpacAuthorities"),
525
            OpacAuthorities                       => C4::Context->preference("OpacAuthorities"),
526
            OpacZ3950                             => C4::Context->preference("OpacZ3950"),
526
            opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
527
            opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
527
            opac_search_limit                     => $opac_search_limit,
528
            opac_search_limit                     => $opac_search_limit,
528
            opac_limit_override                   => $opac_limit_override,
529
            opac_limit_override                   => $opac_limit_override,
(-)a/C4/Breeding.pm (-5 / +6 lines)
Lines 131-142 The second parameter $template is a Template object. The routine uses this param Link Here
131
=cut
131
=cut
132
132
133
sub Z3950Search {
133
sub Z3950Search {
134
    my ($pars, $template)= @_;
134
    my ($pars, $template, $fromopac)= @_;
135
135
136
    my @id= @{$pars->{id}};
136
    my @id= @{$pars->{id}};
137
    my $page= $pars->{page};
137
    my $page= $pars->{page};
138
    my $biblionumber= $pars->{biblionumber};
138
    my $biblionumber= $pars->{biblionumber};
139
140
    my $show_next       = 0;
139
    my $show_next       = 0;
141
    my $total_pages     = 0;
140
    my $total_pages     = 0;
142
    my @results;
141
    my @results;
Lines 193-199 sub Z3950Search { Link Here
193
                    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++) {
194
                        if ( $oResult[$k]->record($i) ) {
193
                        if ( $oResult[$k]->record($i) ) {
195
                            undef $error;
194
                            undef $error;
196
                            ( $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
197
                            push @breeding_loop, $res if $res;
196
                            push @breeding_loop, $res if $res;
198
                            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;
199
                        }
198
                        }
Lines 263-269 sub _build_query { Link Here
263
}
262
}
264
263
265
sub _handle_one_result {
264
sub _handle_one_result {
266
    my ( $zoomrec, $servhref, $seq, $bib, $xslh )= @_;
265
    my ( $zoomrec, $servhref, $seq, $bib, $xslh, $fromopac )= @_;
267
266
268
    my $raw= $zoomrec->raw();
267
    my $raw= $zoomrec->raw();
269
    my $marcrecord;
268
    my $marcrecord;
Lines 275-281 sub _handle_one_result { Link Here
275
    }
274
    }
276
    SetUTF8Flag($marcrecord);
275
    SetUTF8Flag($marcrecord);
277
    my $error;
276
    my $error;
278
    ( $marcrecord, $error ) = _do_xslt_proc($marcrecord, $servhref, $xslh);
277
    ( $marcrecord, $error ) = _do_xslt_proc($marcrecord, $servhref, $xslh) unless $fromopac;
279
278
280
    my $batch_id = GetZ3950BatchId($servhref->{servername});
279
    my $batch_id = GetZ3950BatchId($servhref->{servername});
281
    my $breedingid = AddBiblioToBatch($batch_id, $seq, $marcrecord, 'UTF-8', 0, 0);
280
    my $breedingid = AddBiblioToBatch($batch_id, $seq, $marcrecord, 'UTF-8', 0, 0);
Lines 291-296 sub _handle_one_result { Link Here
291
        {
290
        {
292
            biblionumber => $bib,
291
            biblionumber => $bib,
293
            server       => $servhref->{servername},
292
            server       => $servhref->{servername},
293
            host       => $servhref->{host},
294
            breedingid   => $breedingid,
294
            breedingid   => $breedingid,
295
        }, $marcrecord) if $breedingid;
295
        }, $marcrecord) if $breedingid;
296
    return ( $row, $error );
296
    return ( $row, $error );
Lines 323-328 sub _do_xslt_proc { Link Here
323
sub _add_rowdata {
323
sub _add_rowdata {
324
    my ($row, $record)=@_;
324
    my ($row, $record)=@_;
325
    my %fetch= (
325
    my %fetch= (
326
        biblionumber => 'biblio.biblionumber',
326
        title => 'biblio.title',
327
        title => 'biblio.title',
327
        author => 'biblio.author',
328
        author => 'biblio.author',
328
        isbn =>'biblioitems.isbn',
329
        isbn =>'biblioitems.isbn',
(-)a/Koha/Schema/Result/Z3950server.pm (+16 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
129
=head2 opac
130
131
  data_type: 'tinyint'
132
  is_nullable: 1
133
  size: 1
134
123
=cut
135
=cut
124
136
125
__PACKAGE__->add_columns(
137
__PACKAGE__->add_columns(
Lines 167-172 __PACKAGE__->add_columns( Link Here
167
  { data_type => "mediumtext", is_nullable => 1 },
179
  { data_type => "mediumtext", is_nullable => 1 },
168
  "add_xslt",
180
  "add_xslt",
169
  { data_type => "mediumtext", is_nullable => 1 },
181
  { data_type => "mediumtext", is_nullable => 1 },
182
  "attributes",
183
  { data_type => "varchar", is_nullable => 1, size => 255 },
184
  "opac",
185
  { data_type => "tinyint", is_nullable => 1, size => 1 },
170
);
186
);
171
187
172
=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
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/sysprefs.sql (-1 / +2 lines)
Lines 569-573 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
569
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
569
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
570
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
570
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
571
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
571
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
572
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
572
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
573
('OPACZ3950','0','','Allow patrons to search for bibliographic records in other libraries via Z39.50.','YesNo')
573
;
574
;
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 13959-13964 if( CheckVersion( $DBversion ) ) { Link Here
13959
    print "Upgrade to $DBversion done (Bug 16530 - Add a circ sidebar navigation menu)\n";
13959
    print "Upgrade to $DBversion done (Bug 16530 - Add a circ sidebar navigation menu)\n";
13960
}
13960
}
13961
13961
13962
$DBversion = "XXX";
13963
if( CheckVersion( $DBversion ) ) {
13964
    $dbh->do("ALTER TABLE z3950servers ADD COLUMN opac TINYINT(1);");
13965
    $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')");
13966
    print "Add opac column to z3950servers table.\nAdd OPACZ3950 preference.\n";
13967
    SetVersion($DBversion);
13968
}
13969
13970
13962
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
13971
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
13963
# SEE bug 13068
13972
# SEE bug 13068
13964
# if there is anything in the atomicupdate, read and execute it.
13973
# if there is anything in the atomicupdate, read and execute it.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 409-414 OPAC: Link Here
409
                  no: "Don't allow"
409
                  no: "Don't allow"
410
            - patrons to search your authority records.
410
            - patrons to search your authority records.
411
        -
411
        -
412
            - pref: OpacZ3950
413
              choices:
414
                  yes: Allow
415
                  no: "Don't allow"
416
            - patrons to search for bibliographic records in other libraries via Z39.50.
417
        -
412
            - pref: opacbookbag
418
            - pref: opacbookbag
413
              choices:
419
              choices:
414
                  yes: Allow
420
                  yes: Allow
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt (-1 / +10 lines)
Lines 150-155 Link Here
150
            <input type="checkbox" name="checked" id="checked" value="1" />
150
            <input type="checkbox" name="checked" id="checked" value="1" />
151
        [% END %]
151
        [% END %]
152
        </li>
152
        </li>
153
        <li><label for="opac">OPAC (Shown in OPAC Z39.50 search): </label>
154
        [% IF ( server.opac ) %]
155
            <input type="checkbox" size="1" name="opac" id="opac" value="1" checked="checked" />
156
        [% ELSE %]
157
            <input type="checkbox" size="1" name="opac" id="opac" value="1" />
158
        [% END %]
159
        </li>
153
        <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" />
160
        <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" />
154
        </li>
161
        </li>
155
162
Lines 228-234 Link Here
228
        You searched for [% searchfield %]
235
        You searched for [% searchfield %]
229
    [% END %]
236
    [% END %]
230
    <table id="serverst">
237
    <table id="serverst">
231
        <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Preselected</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th></th>
238
        <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>
232
        </tr></thead>
239
        </tr></thead>
233
        <tbody>
240
        <tbody>
234
        [% FOREACH loo IN loop %]
241
        [% FOREACH loo IN loop %]
Lines 241-246 Link Here
241
                <span>Authority</span>
248
                <span>Authority</span>
242
                [% END %]
249
                [% END %]
243
            </td>
250
            </td>
251
            <td>[% loo.attributes %]</td>
252
            <td>[% IF loo.opac %]X[% END %]</td>
244
            <td>
253
            <td>
245
                <div class="dropdown">
254
                <div class="dropdown">
246
                    <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#">
255
                    <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (+1 lines)
Lines 273-278 Link Here
273
                                    [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
273
                                    [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %]
274
                                    [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
274
                                    [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %]
275
                                    [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
275
                                    [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %]
276
                                    [% IF Koha.Preference( 'OpacZ3950' ) %]<li><span id="z3950searchOpac"><a target="_blank" href="#" >Z39.50 Search</a></span></li>[% END %]
276
                                    [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<li><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a></li>[% END %]
277
                                    [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<li><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a></li>[% END %]
277
                                    [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
278
                                    [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %]
278
                                    [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
279
                                    [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (+12 lines)
Lines 262-267 $(document).ready(function() { Link Here
262
        //]]>
262
        //]]>
263
    </script>
263
    </script>
264
[% END %]
264
[% END %]
265
[% IF Koha.Preference( 'OpacZ3950' ) %]
266
<script type="text/javascript">
267
//<![CDATA[
268
     $(document).ready(function() {
269
        $("#z3950searchOpac").click(function(){
270
            window.open("/cgi-bin/koha/opac-z3950-search.pl","z3950searchOpac",'width=800,height=550,location=yes,toolbar=no,scrollbars=yes,resize=yes');
271
            return false;
272
        });
273
     });
274
//]]>
275
</script>
276
[% END %]
265
[% IF SCO_login %]
277
[% IF SCO_login %]
266
    [% SET SCOUserJS = Koha.Preference('SCOUserJS') %]
278
    [% SET SCOUserJS = Koha.Preference('SCOUserJS') %]
267
    [% IF ( SCOUserJS ) %]
279
    [% IF ( SCOUserJS ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt (+298 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 style="vertical-align:-2px" type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" />
101
                [% serverloo.servername %]
102
              </label>
103
            </div>
104
        [% END %]
105
     </div>
106
    </div>
107
</form>
108
109
[% ELSE %]
110
<div class="row-fluid">
111
    <h2>Results</h2>
112
    <p>You searched for:
113
        [% FOREACH field IN search_fields %]
114
            [% IF ( ${field.prop} ) %]<em>[% field.label %]: </em><span class=term>[% ${field.prop} %]</span> [% END %]
115
        [% END %]
116
    </p>
117
</div>
118
    [% IF ( errconn ) %]
119
            <div class="alert alert-danger">
120
                <ul>
121
                [% FOREACH errcon IN errconn %]
122
                    [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li>
123
                    [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li>
124
                    [% ELSIF ( errcon.error == 'xslt_err' ) %]<li>[% errcon.server %]: Warning: XSLT error on search result [% errcon.seq %]</li>
125
                    [% ELSE %]<li>[% errcon.server %] record [% errcon.seq %]: [% errcon.error %]</li>
126
                    [% END %]
127
                [% END %]
128
                </ul>
129
            </div>
130
    [% END %]
131
<div class="row-fluid marginbot">
132
    <div class="span12">
133
        [% IF ( breeding_loop ) %]
134
        <table id="resultst" class="table table-condensed">
135
    <thead>    <tr>
136
            <th>Server</th>
137
            <th>Title</th>
138
            <th>Author</th>
139
            <th>Date</th>
140
            <th>Edition</th>
141
            <th>ISBN</th>
142
            <th>LCCN</th>
143
            <th>MARC</th>
144
            <th>Card</th>
145
            <th>&nbsp;</th>
146
        </tr></thead>
147
        <tbody>[% FOREACH breeding_loo IN breeding_loop %]
148
            [% IF ( breeding_loo.breedingid ) %]
149
            <tr id="row[% breeding_loo.breedingid %]">
150
                <td>[% breeding_loo.server %] </td>
151
                <td>[% breeding_loo.title |html %]</td>
152
                <td>[% breeding_loo.author %]</td>
153
                <td>[% breeding_loo.date %]</td>
154
                <td>[% breeding_loo.edition %]</td>
155
                <td>[% breeding_loo.isbn %]</td>
156
                <td>[% breeding_loo.lccn %]</td>
157
                <td><a href="/cgi-bin/koha/opac-showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td>
158
                <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>
159
                <td><a target="_blank" href="http://[% breeding_loo.host %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% breeding_loo.biblionumber %]">Show</a></td>
160
            </tr>
161
            [% END %]
162
        [% END %]</tbody>
163
        </table>
164
    </div>
165
</div>
166
167
<form method="post" action="opac-z3950-search.pl" id="page_form" name="page_form">
168
    <input type="hidden" name="op" id="op" value="do_search" />
169
    <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
170
    <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
171
    <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
172
    [% FOREACH field IN search_fields %]
173
        <input type="hidden" name="[% field.prop %]" value="[% ${field.prop} %]" />
174
    [% END %]
175
176
    [% FOREACH server IN servers %]
177
    <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
178
    [% END %]
179
[% IF total_pages > 1 %]
180
    <div class="row-fluid">
181
        <div class="span4">
182
            <div class="input-prepend input-append">
183
                [% IF ( show_prevbutton ) %]
184
                    <button class="btn" type="button" name="changepage_prev" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();">Previous Page</button>
185
                [% END %]
186
                <span class="add-on">Page [% current_page %] / [% total_pages %]</span>
187
                [% IF ( show_nextbutton ) %]
188
                    <button class="btn" type="button" name="changepage_next" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();">Next Page</button>
189
                [% END %]
190
            </div>
191
        </div>
192
        <div class="span2 offset5">
193
            <div class="input-prepend input-append">
194
                <span class="add-on">Go to page</span>
195
                <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" type="text"/>
196
                <button class="btn" type="submit" name="changepage_goto" onclick="return validate_goto_page();">Go</button>
197
            </div>
198
        </div>
199
[% END %]
200
</form>
201
202
203
[% ELSE %]
204
    <div class="alert alert-warning">Nothing found.</div>
205
[% END %]
206
    <div class="row-fluid marginbot">
207
        <div class="span12">
208
           <a class="btn" href="/cgi-bin/koha/opac-z3950-search.pl">Try another search</a>
209
        </div>
210
    </div>
211
</div>
212
[% END %]
213
214
    </div>
215
</div>
216
217
[% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
218
219
[% INCLUDE 'opac-bottom.inc' %]
220
[% BLOCK jsinclude %][% END %]
221
[% INCLUDE 'datatables.inc' %]
222
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
223
224
<script type="text/javascript">
225
//<![CDATA[
226
function Import(GetThisOne,biblionumber) {
227
    opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne;
228
    window.close();
229
    return false;
230
}
231
232
function closemenu(){
233
    $(".linktools").hide();
234
    $("tr").removeClass("selected");
235
}
236
237
$(document).ready(function(){
238
    $("#CheckAll").click(function(){
239
        $(".checkboxed").checkCheckboxes();
240
        return false;
241
    });
242
    $("#CheckNone").click(function(){
243
        $(".checkboxed").unCheckCheckboxes();
244
        return false;
245
    });
246
    $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
247
        "sDom": 't',
248
        "aoColumnDefs": [
249
            { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false },
250
            { "aTargets": [ 1 ], "sType": "nsb-nse" },
251
        ],
252
        "aaSorting": [[ 1, "asc" ]],
253
        "bPaginate": false
254
    }));
255
        /* Inline edit/delete links */
256
        $("td").click(function(event){
257
            var $tgt = $(event.target);
258
            var row = $(this).parent();
259
            $(".linktools").hide();
260
            $("tr").removeClass("selected");
261
            row.addClass("selected");
262
            if($tgt.is("a")||$tgt.is(":nth-child(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){
263
                //Don't show inline links for cells containing links of their own.
264
            } else {
265
                var position = $(this).offset();
266
                var top = position.top+5;
267
                var left = position.left+5;
268
                $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
269
            }
270
        });
271
    $("form[name='f']").submit(function(){
272
        if ($('input[type=checkbox]').filter(':checked').length == 0) {
273
            alert(_("Please choose at least one external target"));
274
            return false;
275
        } else {
276
            $("*").css("cursor", "progress");
277
            return true;
278
        }
279
    });
280
});
281
282
[% IF ( total_pages ) %]
283
function validate_goto_page(){
284
    var page = $('#goto_page').val();
285
    if(isNaN(page)) {
286
        alert(_("The page entered is not a number."));
287
        return false;
288
    }
289
    else if(page < 1 || page > [% total_pages %] ) {
290
        alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
291
        return false;
292
    }
293
    else {
294
        return true;
295
    }
296
}
297
[% END %]
298
</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 3 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