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

(-)a/catalogue/detail.pl (+14 lines)
Lines 46-51 use Koha::Items; Link Here
46
use Koha::ItemTypes;
46
use Koha::ItemTypes;
47
use Koha::Patrons;
47
use Koha::Patrons;
48
use Koha::Virtualshelves;
48
use Koha::Virtualshelves;
49
use LWP::Simple;
50
use Koha::SearchEngine::Elasticsearch;
49
use Koha::Plugins;
51
use Koha::Plugins;
50
52
51
my $query = CGI->new();
53
my $query = CGI->new();
Lines 543-546 $template->param (countdeletedorders => $count_deletedorders_using_biblio); Link Here
543
$template->param (basketsorders => \@baskets_orders);
545
$template->param (basketsorders => \@baskets_orders);
544
$template->param (basketsdeletedorders => \@baskets_deletedorders);
546
$template->param (basketsdeletedorders => \@baskets_deletedorders);
545
547
548
if ( C4::Context->preference('SearchEngine') eq 'Elasticsearch' ) {
549
    my $es_conf = Koha::SearchEngine::Elasticsearch->new({index=>'biblios'})->get_elasticsearch_params();
550
    my $es_url;
551
    my $es_record;
552
    foreach my $es_node ( @{$es_conf->{nodes}} ){
553
        $es_url = "http://".$es_node."/".$es_conf->{index_name}."/data/$biblionumber";
554
        $es_record = get($es_url);
555
        last if defined $es_record; #can quit once we find the record (should be same in any node)
556
    }
557
    $template->param( esrecord => $es_record );
558
}
559
546
output_html_with_http_headers $query, $cookie, $template->output;
560
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +29 lines)
Lines 110-116 Link Here
110
                    </span>
110
                    </span>
111
        [% END %]
111
        [% END %]
112
        <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber | uri %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
112
        <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber | uri %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
113
113
        
114
        [% IF ( holdcount ) %]
114
        [% IF ( holdcount ) %]
115
            <span class="results_summary">
115
            <span class="results_summary">
116
                <span class="label">Holds:</span>
116
                <span class="label">Holds:</span>
Lines 328-333 Link Here
328
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
328
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
329
    <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
329
    <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
330
[% END %]
330
[% END %]
331
[% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]<li><a href="#esrecord" id="estab">Elasticsearch Record</a></li>[% END %]
331
</ul>
332
</ul>
332
333
333
[% items_table_block_iter = 0 %]
334
[% items_table_block_iter = 0 %]
Lines 859-864 Link Here
859
    </div>
860
    </div>
860
[% END %]
861
[% END %]
861
862
863
[% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
864
    <div id="esrecord" class="esrecord">
865
        <div esid="[% biblionumber %]"></div>
866
        [% IF esrecord %]
867
            <p>[% esrecord %]</p>
868
            <script type="application/json" id="stuff">[% (esrecord) %]</script>
869
        [% ELSE %]
870
            <p>"This record was not found in the ES index"</p>
871
        [% END %]
872
    </div>
873
[% END %]
874
862
</div><!-- /bibliodetails -->
875
</div><!-- /bibliodetails -->
863
876
864
<div class="yui-g" id="export" style="margin-top: 1em;">
877
<div class="yui-g" id="export" style="margin-top: 1em;">
Lines 1103-1108 Link Here
1103
        [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
1116
        [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
1104
            verify_images();
1117
            verify_images();
1105
        });[% END %]
1118
        });[% END %]
1119
        
1120
        [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' && 1==0 %]
1121
            function ESRecord (biblionumber) {
1122
                $.getJSON("http://localhost:9200/koha_kohadev_biblios/data/", biblionumber, function( data ){
1123
                    $.each( data, function( key, val ) {
1124
                         console.log("key "+key+"val "+val);
1125
                    });
1126
                });
1127
            }
1128
            $(document).ready( function(){
1129
                var esid = [% biblionumber %];
1130
                ESRecord( esid );
1131
            });    
1132
        [% END %]
1133
    
1106
    </script>
1134
    </script>
1107
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1135
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1108
        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1136
        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1109
- 

Return to bug 18829