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 / +28 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
114
        [% IF ( holdcount ) %]
113
        [% IF ( holdcount ) %]
115
            <span class="results_summary">
114
            <span class="results_summary">
116
                <span class="label">Holds:</span>
115
                <span class="label">Holds:</span>
Lines 328-333 Link Here
328
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
327
[% 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>
328
    <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
330
[% END %]
329
[% END %]
330
[% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]<li><a href="#esrecord" id="estab">Elasticsearch Record</a></li>[% END %]
331
</ul>
331
</ul>
332
332
333
[% items_table_block_iter = 0 %]
333
[% items_table_block_iter = 0 %]
Lines 859-864 Link Here
859
    </div>
859
    </div>
860
[% END %]
860
[% END %]
861
861
862
[% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
863
    <div id="esrecord" class="esrecord">
864
        <div esid="[% biblionumber %]"></div>
865
        [% IF esrecord %]
866
            <p>[% esrecord %]</p>
867
            <script type="application/json" id="stuff">[% (esrecord) %]</script>
868
        [% ELSE %]
869
            <p>"This record was not found in the ES index"</p>
870
        [% END %]
871
    </div>
872
[% END %]
873
862
</div><!-- /bibliodetails -->
874
</div><!-- /bibliodetails -->
863
875
864
<div class="yui-g" id="export" style="margin-top: 1em;">
876
<div class="yui-g" id="export" style="margin-top: 1em;">
Lines 1103-1108 Link Here
1103
        [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
1115
        [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
1104
            verify_images();
1116
            verify_images();
1105
        });[% END %]
1117
        });[% END %]
1118
        
1119
        [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' && 1==0 %]
1120
            function ESRecord (biblionumber) {
1121
                $.getJSON("http://localhost:9200/koha_kohadev_biblios/data/", biblionumber, function( data ){
1122
                    $.each( data, function( key, val ) {
1123
                         console.log("key "+key+"val "+val);
1124
                    });
1125
                });
1126
            }
1127
            $(document).ready( function(){
1128
                var esid = [% biblionumber %];
1129
                ESRecord( esid );
1130
            });    
1131
        [% END %]
1132
    
1106
    </script>
1133
    </script>
1107
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1134
    [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1108
        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1135
        <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1109
- 

Return to bug 18829