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

(-)a/catalogue/detail.pl (+14 lines)
Lines 47-52 use Koha::Items; Link Here
47
use Koha::ItemTypes;
47
use Koha::ItemTypes;
48
use Koha::Patrons;
48
use Koha::Patrons;
49
use Koha::Virtualshelves;
49
use Koha::Virtualshelves;
50
use LWP::Simple;
51
use Koha::SearchEngine::Elasticsearch;
50
52
51
my $query = CGI->new();
53
my $query = CGI->new();
52
54
Lines 519-522 $template->param (countdeletedorders => $count_deletedorders_using_biblio); Link Here
519
$template->param (basketsorders => \@baskets_orders);
521
$template->param (basketsorders => \@baskets_orders);
520
$template->param (basketsdeletedorders => \@baskets_deletedorders);
522
$template->param (basketsdeletedorders => \@baskets_deletedorders);
521
523
524
if ( C4::Context->preference('SearchEngine') eq 'Elasticsearch' ) {
525
    my $es_conf = Koha::SearchEngine::Elasticsearch->new({index=>'biblios'})->get_elasticsearch_params();
526
    my $es_url;
527
    my $es_record;
528
    foreach my $es_node ( @{$es_conf->{nodes}} ){
529
        $es_url = "http://".$es_node."/".$es_conf->{index_name}."/data/$biblionumber";
530
        $es_record = get($es_url);
531
        last if defined $es_record; #can quit once we find the record (should be same in any node)
532
    }
533
    $template->param( esrecord => $es_record );
534
}
535
522
output_html_with_http_headers $query, $cookie, $template->output;
536
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +30 lines)
Lines 232-237 function verify_images() { Link Here
232
     [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
232
     [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
233
        verify_images();
233
        verify_images();
234
     });[% END %]
234
     });[% END %]
235
236
    [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' && 1==0 %]
237
    function ESRecord (biblionumber) {
238
        $.getJSON("http://localhost:9200/koha_kohadev_biblios/data/", biblionumber, function( data ){
239
                $.each( data, function( key, val ) {
240
                        console.log("key "+key+"val "+val);
241
                });
242
        });
243
    }
244
    $(document).ready( function(){
245
        var esid = [% biblionumber %];
246
        ESRecord( esid );
247
    });
248
    [% END %]
249
250
251
235
//]]>
252
//]]>
236
</script>
253
</script>
237
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
254
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
Lines 613-618 function verify_images() { Link Here
613
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
630
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
614
    <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
631
    <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
615
[% END %]
632
[% END %]
633
[% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]<li><a href="#esrecord" id="estab">Elasticsearch Record</a></li>[% END %]
616
</ul>
634
</ul>
617
635
618
[% items_table_block_iter = 0 %]
636
[% items_table_block_iter = 0 %]
Lines 1108-1113 function verify_images() { Link Here
1108
    </div>
1126
    </div>
1109
[% END %]
1127
[% END %]
1110
1128
1129
[% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
1130
    <div id="esrecord" class="esrecord">
1131
        <div esid="[% biblionumber %]"></div>
1132
        [% IF esrecord %]
1133
           <p>[% esrecord %]</p>
1134
           <script type="application/json" id="stuff">[% (esrecord) %]</script>
1135
        [% ELSE %]
1136
           <p>"This record was not found in the ES index"</p>
1137
        [% END %]
1138
    </div>
1139
[% END %]
1140
1111
</div><!-- /bibliodetails -->
1141
</div><!-- /bibliodetails -->
1112
1142
1113
<div class="yui-g" id="export" style="margin-top: 1em;">
1143
<div class="yui-g" id="export" style="margin-top: 1em;">
1114
- 

Return to bug 18829