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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 427-429 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
427
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo');
427
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo');
428
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo');
428
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo');
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
430
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACSearchExternalTargets','0','Whether to search external targets in the OPAC','','YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+33 lines)
Lines 7025-7030 if(CheckVersion($DBversion)) { Link Here
7025
    SetVersion($DBversion);
7025
    SetVersion($DBversion);
7026
}
7026
}
7027
7027
7028
$DBversion = "3.13.00.XXX";
7029
if(CheckVersion($DBversion)) {
7030
    $dbh->do(
7031
"INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACSearchExternalTargets','0','Whether to search external targets in the OPAC','','YesNo')"
7032
    );
7033
    $dbh->do( q{
7034
CREATE TABLE `external_targets` (
7035
  `target_id` int(11) NOT NULL AUTO_INCREMENT,
7036
  `host` varchar(128) NOT NULL,
7037
  `port` int(11) NOT NULL,
7038
  `db` varchar(64) NOT NULL,
7039
  `userid` varchar(64) DEFAULT '',
7040
  `password` varchar(64) DEFAULT '',
7041
  `name` varchar(64) NOT NULL,
7042
  `syntax` varchar(64) NOT NULL,
7043
  `encoding` varchar(16) DEFAULT 'MARC-8',
7044
  PRIMARY KEY (`target_id`)
7045
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8
7046
    } );
7047
    $dbh->do( q{
7048
CREATE TABLE `external_target_restrictions` (
7049
  `branchcode` varchar(10) NOT NULL,
7050
  `target_id` int(11) NOT NULL,
7051
  KEY `branchcode` (`branchcode`),
7052
  KEY `target_id` (`target_id`),
7053
  CONSTRAINT `external_target_restrictions_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE,
7054
  CONSTRAINT `external_target_restrictions_ibfk_2` FOREIGN KEY (`target_id`) REFERENCES `external_targets` (`target_id`) ON DELETE CASCADE
7055
) ENGINE=InnoDB DEFAULT CHARSET=utf
7056
    } );
7057
    print "Upgrade to $DBversion done (Bug 10486 - Allow external Z39.50 targets to be searched from the OPAC)\n";
7058
    SetVersion($DBversion);
7059
}
7060
7028
=head1 FUNCTIONS
7061
=head1 FUNCTIONS
7029
7062
7030
=head2 TableExists($table)
7063
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+7 lines)
Lines 424-429 OPAC: Link Here
424
                  yes: Allow
424
                  yes: Allow
425
                  no: Do not allow
425
                  no: Do not allow
426
            - users to add a note when placing a hold.
426
            - users to add a note when placing a hold.
427
        -
428
            - pref: OPACSearchExternalTargets
429
              default: 0
430
              choices:
431
                  yes: Search
432
                  no: "Don't search"
433
            - external targets from the OPAC.
427
434
428
    Policy:
435
    Policy:
429
        -
436
        -
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-2 / +2 lines)
Lines 14-20 Link Here
14
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/jquery.rating.css" />[% END %]
14
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/jquery.rating.css" />[% END %]
15
15
16
[% IF ( OverDriveEnabled ) %]<script type="text/javascript" src="[% themelang %]/js/overdrive.js"></script>[% END %]
16
[% IF ( OverDriveEnabled ) %]<script type="text/javascript" src="[% themelang %]/js/overdrive.js"></script>[% END %]
17
[% IF ( 1 ) %]
17
[% IF ( OPACSearchExternalTargets ) %]
18
<script type="text/javascript" src="/opac-tmpl/lib/pz2.js"></script>
18
<script type="text/javascript" src="/opac-tmpl/lib/pz2.js"></script>
19
<script type="text/javascript" src="[% themelang %]/js/externalsearch.js"></script>
19
<script type="text/javascript" src="[% themelang %]/js/externalsearch.js"></script>
20
[% END %]
20
[% END %]
Lines 294-300 $(document).ready(function(){ Link Here
294
        } );
294
        } );
295
    [% END %]
295
    [% END %]
296
296
297
    [% IF ( 1 ) %]
297
    [% IF ( OPACSearchExternalTargets ) %]
298
        KOHA.ExternalSearch.targets = {
298
        KOHA.ExternalSearch.targets = {
299
            [% FOREACH target IN external_search_targets %]
299
            [% FOREACH target IN external_search_targets %]
300
                '[% target.host %]:[% target.port %]/[% target.db %]': {
300
                '[% target.host %]:[% target.port %]/[% target.db %]': {
(-)a/opac/opac-search.pl (-1 / +1 lines)
Lines 903-908 $template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksRe Link Here
903
$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
903
$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
904
$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
904
$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
905
905
906
$template->{VARS}->{OPACSearchExternalTargets} = C4::Context->preference('OPACSearchExternalTargets');
906
$template->{VARS}->{external_search_targets} = GetExternalSearchTargets( C4::Context->userenv ? C4::Context->userenv->{branch} : '' );
907
$template->{VARS}->{external_search_targets} = GetExternalSearchTargets( C4::Context->userenv ? C4::Context->userenv->{branch} : '' );
907
908
908
$template->{VARS}->{OverDriveLibraryID} = C4::Context->preference('OverDriveLibraryID');
909
$template->{VARS}->{OverDriveLibraryID} = C4::Context->preference('OverDriveLibraryID');
909
- 

Return to bug 10486