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

(-)a/Koha/MetaSearcher.pm (-1 / +1 lines)
Lines 127-133 sub search { Link Here
127
                extra => $2,
127
                extra => $2,
128
                id => $server_id,
128
                id => $server_id,
129
                host => $server_id,
129
                host => $server_id,
130
                name => $server_id,
130
                servername => $server_id,
131
            };
131
            };
132
        }
132
        }
133
    }
133
    }
(-)a/cataloguing/editor.pl (-1 / +1 lines)
Lines 81-87 my $dbh = C4::Context->dbh; Link Here
81
$template->{VARS}->{z3950_servers} = $dbh->selectall_arrayref( q{
81
$template->{VARS}->{z3950_servers} = $dbh->selectall_arrayref( q{
82
    SELECT * FROM z3950servers
82
    SELECT * FROM z3950servers
83
    WHERE recordtype != 'authority' AND servertype = 'zed'
83
    WHERE recordtype != 'authority' AND servertype = 'zed'
84
    ORDER BY servername
84
    ORDER BY rank,servername
85
}, { Slice => {} } );
85
}, { Slice => {} } );
86
86
87
output_html_with_http_headers $input, $cookie, $template->output;
87
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/search.js (-2 / +2 lines)
Lines 73-80 define( [ 'koha-backend', 'marc-record' ], function( KohaBackend, MARC ) { Link Here
73
73
74
            var itemTag = KohaBackend.GetSubfieldForKohaField('items.itemnumber')[0];
74
            var itemTag = KohaBackend.GetSubfieldForKohaField('items.itemnumber')[0];
75
75
76
            $.each( servers, function ( id, info ) {
76
            $.each( servers, function ( index, info ) {
77
                if ( info.checked ) Search.includedServers.push( id );
77
                if ( info.checked ) Search.includedServers.push( info.server_id );
78
            } );
78
            } );
79
79
80
            if ( Search.includedServers.length == 0 ) return false;
80
            if ( Search.includedServers.length == 0 ) return false;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-15 / +18 lines)
Lines 41-60 require.config( { Link Here
41
41
42
<script>
42
<script>
43
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'preferences', 'resources', 'text-marc', 'widget' ], function( KohaBackend, Search, Macros, MARCEditor, MARC, Preferences, Resources, TextMARC, Widget ) {
43
require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'preferences', 'resources', 'text-marc', 'widget' ], function( KohaBackend, Search, Macros, MARCEditor, MARC, Preferences, Resources, TextMARC, Widget ) {
44
    var z3950Servers = {
44
    var z3950Servers = [
45
        'koha:biblioserver': {
45
        {
46
            server_id: 'koha:biblioserver',
46
            name: _("Local catalog"),
47
            name: _("Local catalog"),
47
            recordtype: 'biblio',
48
            recordtype: 'biblio',
48
            checked: false,
49
            checked: false,
49
        },
50
        },
50
        [%- FOREACH server = z3950_servers -%]
51
        [%- FOREACH server = z3950_servers -%]
51
            [% server.id | html %]: {
52
            {
53
                server_id: [% server.id | html %],
52
                name: '[% server.servername | html %]',
54
                name: '[% server.servername | html %]',
53
                recordtype: '[% server.recordtype | html %]',
55
                recordtype: '[% server.recordtype | html %]',
54
                checked: [% server.checked ? 'true' : 'false' | html %],
56
                checked: [% server.checked ? 'true' : 'false' | html %],
55
            },
57
            },
56
        [%- END -%]
58
        [%- END -%]
57
    };
59
    ];
58
60
59
    // The columns that should show up in a search, in order, and keyed by the corresponding <metadata> tag in the XSL and Pazpar2 config
61
    // The columns that should show up in a search, in order, and keyed by the corresponding <metadata> tag in the XSL and Pazpar2 config
60
    var z3950Labels = [
62
    var z3950Labels = [
Lines 405-412 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
405
    // Search functions
407
    // Search functions
406
    function showAdvancedSearch() {
408
    function showAdvancedSearch() {
407
        $('#advanced-search-servers').empty();
409
        $('#advanced-search-servers').empty();
408
        $.each( z3950Servers, function( server_id, server ) {
410
        $.each( z3950Servers, function( index, server ) {
409
            $('#advanced-search-servers').append( '<li data-server-id="' + server_id + '"><label><input class="search-toggle-server" type="checkbox"' + ( server.checked ? ' checked="checked">' : '>' ) + server.name + '</label></li>' );
411
            $('#advanced-search-servers').append( '<li data-server-id="' + index + '"><label><input class="search-toggle-server" type="checkbox"' + ( server.checked ? ' checked="checked">' : '>' ) + server.name + '</label></li>' );
410
        } );
412
        } );
411
        $('#advanced-search-ui').modal('show');
413
        $('#advanced-search-ui').modal('show');
412
    }
414
    }
Lines 457-474 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
457
        $('#searchresults tbody').empty();
459
        $('#searchresults tbody').empty();
458
        $('#search-serversinfo').empty();
460
        $('#search-serversinfo').empty();
459
461
460
        $.each( z3950Servers, function( server_id, server ) {
462
        $.each( z3950Servers, function( index, server ) {
461
            var num_fetched = data.num_fetched[server_id];
463
            var num_fetched = data.num_fetched[server.server_id];
462
464
463
            if ( data.errors[server_id] ) {
465
            if ( data.errors[server.server_id] ) {
464
                num_fetched = data.errors[server_id];
466
                num_fetched = data.errors[server.server_id];
465
            } else if ( num_fetched == null ) {
467
            } else if ( num_fetched == null ) {
466
                num_fetched = '-';
468
                num_fetched = '-';
467
            } else if ( num_fetched < data.num_hits[server_id] ) {
469
            } else if ( num_fetched < data.num_hits[server.server_id] ) {
468
                num_fetched += '+';
470
                num_fetched += '+';
469
            }
471
            }
470
472
471
            $('#search-serversinfo').append( '<li data-server-id="' + server_id + '"><label><input class="search-toggle-server" type="checkbox"' + ( server.checked ? ' checked="checked">' : '>' ) + server.name + ' (' + num_fetched + ')' + '</label></li>' );
473
            $('#search-serversinfo').append( '<li data-server-id="' + index + '"><label><input class="search-toggle-server" type="checkbox"' + ( server.checked ? ' checked="checked">' : '>' ) + server.name + ' (' + num_fetched + ')' + '</label></li>' );
472
        } );
474
        } );
473
475
474
        var seenColumns = {};
476
        var seenColumns = {};
Lines 511-517 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
511
            }
513
            }
512
514
513
            var result = '<tr>';
515
            var result = '<tr>';
514
            result += '<td class="sourcecol">' + z3950Servers[ hit.server ].name + '</td>';
516
            var server_name = hit.servername == 'koha:biblioserver' ? _("Local catalog") : hit.servername;
517
            result += '<td class="sourcecol">' + server_name + '</td>';
515
518
516
            $.each( z3950Labels, function( undef, label ) {
519
            $.each( z3950Labels, function( undef, label ) {
517
                if ( !seenColumns[ label[0] ] ) return;
520
                if ( !seenColumns[ label[0] ] ) return;
Lines 641-648 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
641
                // Macros loaded on first show of modal
644
                // Macros loaded on first show of modal
642
                break;
645
                break;
643
            case 'selected_search_targets':
646
            case 'selected_search_targets':
644
                $.each( z3950Servers, function( server_id, server ) {
647
                $.each( z3950Servers, function( index, server ) {
645
                    var saved_val = Preferences.user.selected_search_targets[server_id];
648
                    var saved_val = Preferences.user.selected_search_targets[server.server_id];
646
649
647
                    if ( saved_val != null ) server.checked = saved_val;
650
                    if ( saved_val != null ) server.checked = saved_val;
648
                } );
651
                } );
(-)a/svc/cataloguing/metasearch (-1 / +1 lines)
Lines 56-61 my @hits; Link Here
56
foreach my $hit ( $searcher->results( $offset, $page_size ) ) {
56
foreach my $hit ( $searcher->results( $offset, $page_size ) ) {
57
    push @hits, {
57
    push @hits, {
58
        server => $hit->{server}->{id},
58
        server => $hit->{server}->{id},
59
        servername => $hit->{server}->{servername},
59
        index => $hit->{index},
60
        index => $hit->{index},
60
        record => $hit->{record}->as_xml_record(),
61
        record => $hit->{record}->as_xml_record(),
61
        metadata => $hit->{metadata}
62
        metadata => $hit->{metadata}
62
- 

Return to bug 17515