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 (-1 / +28 lines)
Lines 169-174 Link Here
169
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
169
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
170
    <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
170
    <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
171
[% END %]
171
[% END %]
172
[% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]<li><a href="#esrecord" id="estab">Elasticsearch Record</a></li>[% END %]
172
</ul>
173
</ul>
173
174
174
[% items_table_block_iter = 0 %]
175
[% items_table_block_iter = 0 %]
Lines 698-703 Link Here
698
    </div>
699
    </div>
699
[% END %]
700
[% END %]
700
701
702
[% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
703
    <div id="esrecord" class="esrecord">
704
        <div esid="[% biblionumber %]"></div>
705
        [% IF esrecord %]
706
            <p>[% esrecord %]</p>
707
            <script type="application/json" id="stuff">[% (esrecord) %]</script>
708
        [% ELSE %]
709
            <p>"This record was not found in the ES index"</p>
710
        [% END %]
711
    </div>
712
[% END %]
713
701
</div><!-- /bibliodetails -->
714
</div><!-- /bibliodetails -->
702
715
703
<div id="export" style="margin-top: 1em;">
716
<div id="export" style="margin-top: 1em;">
Lines 943-948 Link Here
943
        [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
956
        [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
944
            verify_images();
957
            verify_images();
945
        });[% END %]
958
        });[% END %]
959
960
        [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' && 1==0 %]
961
            function ESRecord (biblionumber) {
962
                $.getJSON("http://localhost:9200/koha_kohadev_biblios/data/", biblionumber, function( data ){
963
                    $.each( data, function( key, val ) {
964
                         console.log("key "+key+"val "+val);
965
                    });
966
                });
967
            }
968
            $(document).ready( function(){
969
                var esid = [% biblionumber %];
970
                ESRecord( esid );
971
            });
972
        [% END %]
973
946
    </script>
974
    </script>
947
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
975
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
948
        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
976
        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
949
- 

Return to bug 18829