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

(-)a/catalogue/detail.pl (+7 lines)
Lines 640-645 my %can_edit_items_from = map { Link Here
640
} @libraries;
640
} @libraries;
641
$template->param(can_edit_items_from => \%can_edit_items_from);
641
$template->param(can_edit_items_from => \%can_edit_items_from);
642
642
643
my @itemtypes = Koha::ItemTypes->search->as_list;
644
my %item_type_image_locations = map {
645
    $_->itemtype => $_->image_location('intranet')
646
} @itemtypes;
647
$template->param(item_type_image_locations => \%item_type_image_locations);
648
649
643
$template->param(found1 => scalar $query->param('found1') );
650
$template->param(found1 => scalar $query->param('found1') );
644
651
645
$template->param(biblio => $biblio);
652
$template->param(biblio => $biblio);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +12 lines)
Lines 2492-2497 Link Here
2492
            });
2492
            });
2493
        [% END %]
2493
        [% END %]
2494
2494
2495
        const can_edit_items_from = [% To.json(can_edit_items_from) | $raw %];
2496
        const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %];
2495
        let table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?";
2497
        let table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?";
2496
        var items_table = $("#table_items").kohaTable({
2498
        var items_table = $("#table_items").kohaTable({
2497
            ajax: { url: table_url },
2499
            ajax: { url: table_url },
Lines 2529-2535 Link Here
2529
                searchable: true,
2531
                searchable: true,
2530
                orderable: true,
2532
                orderable: true,
2531
                render: function (data, type, row, meta) {
2533
                render: function (data, type, row, meta) {
2532
                    return row._strings.item_type_id.str; // FIXME Display the image
2534
                    let node = '';
2535
                    [% UNLESS noItemTypeImages %]
2536
                        let image_location = item_type_image_locations[row.item_type_id];
2537
                        let item_type_description = row._strings.item_type_id.str;
2538
                        node += image_location
2539
                            ? '<img src="%s" alt="%s" title="%s" /> '.format(image_location, item_type_description, item_type_description)
2540
                            : '';
2541
                    [% END %]
2542
                    node += '<span class="itypedesc itypetext">%s</span>'.format(item_type_description);
2543
                    return node;
2533
                }
2544
                }
2534
            },
2545
            },
2535
            [% END %]
2546
            [% END %]
2536
- 

Return to bug 33568