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

(-)a/Koha/Item.pm (+12 lines)
Lines 51-56 use Koha::Plugins; Link Here
51
use Koha::Recalls;
51
use Koha::Recalls;
52
use Koha::Result::Boolean;
52
use Koha::Result::Boolean;
53
use Koha::SearchEngine::Indexer;
53
use Koha::SearchEngine::Indexer;
54
use Koha::Serial::Items;
54
use Koha::StockRotationItem;
55
use Koha::StockRotationItem;
55
use Koha::StockRotationRotas;
56
use Koha::StockRotationRotas;
56
use Koha::TrackedLinks;
57
use Koha::TrackedLinks;
Lines 444-449 sub checkout { Link Here
444
    return Koha::Checkout->_new_from_dbic( $checkout_rs );
445
    return Koha::Checkout->_new_from_dbic( $checkout_rs );
445
}
446
}
446
447
448
=head3 serialitem
449
450
=cut
451
452
sub serialitem {
453
    my ( $self ) = @_;
454
    my $rs = $self->_result->serialitem;
455
    return unless $rs;
456
    return Koha::Serial::Item->_new_from_dbic($rs);
457
}
458
447
=head3 item_group
459
=head3 item_group
448
460
449
my $item_group = $item->item_group;
461
my $item_group = $item->item_group;
(-)a/Koha/REST/V1/Biblios.pm (+1 lines)
Lines 302-307 sub get_items { Link Here
302
302
303
        my $items_rs = $biblio->items;
303
        my $items_rs = $biblio->items;
304
        $items_rs = $items_rs->filter_by_bookable if $bookable_only;
304
        $items_rs = $items_rs->filter_by_bookable if $bookable_only;
305
        # FIXME We need to order_by serial.publisheddate if we have _order_by=+me.serial_issue_number
305
        my $items = $c->objects->search($items_rs);
306
        my $items = $c->objects->search($items_rs);
306
        return $c->render(
307
        return $c->render(
307
            status  => 200,
308
            status  => 200,
(-)a/Koha/Serial/Item.pm (+13 lines)
Lines 24-29 use Koha::Database; Link Here
24
24
25
use base qw(Koha::Object);
25
use base qw(Koha::Object);
26
26
27
use Koha::Serials;
28
27
=head1 NAME
29
=head1 NAME
28
30
29
Koha::Serial::Item - Koha Serial Item Object class
31
Koha::Serial::Item - Koha Serial Item Object class
Lines 34-39 Koha::Serial::Item - Koha Serial Item Object class Link Here
34
36
35
=cut
37
=cut
36
38
39
=head3 serial
40
41
=cut
42
43
sub serial {
44
    my ($self) = @_;
45
    my $rs = $self->_result->serialid;
46
    return unless $rs;
47
    return Koha::Serial->_new_from_dbic($rs);
48
}
49
37
=head3 type
50
=head3 type
38
51
39
=cut
52
=cut
(-)a/api/v1/swagger/definitions/item.yaml (+4 lines)
Lines 238-243 properties: Link Here
238
    type:
238
    type:
239
      - object
239
      - object
240
      - "null"
240
      - "null"
241
  serialitem:
242
    type:
243
      - object
244
      - "null"
241
  _strings:
245
  _strings:
242
    type:
246
    type:
243
      - object
247
      - object
(-)a/api/v1/swagger/paths/biblios.yaml (+1 lines)
Lines 425-430 Link Here
425
            - +strings
425
            - +strings
426
            - cover_image_ids
426
            - cover_image_ids
427
            - item_group_item.item_group.description
427
            - item_group_item.item_group.description
428
            - serialitem.serial
428
        collectionFormat: csv
429
        collectionFormat: csv
429
      - $ref: "../swagger.yaml#/parameters/match"
430
      - $ref: "../swagger.yaml#/parameters/match"
430
      - $ref: "../swagger.yaml#/parameters/order_by"
431
      - $ref: "../swagger.yaml#/parameters/order_by"
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-9 / +24 lines)
Lines 712-720 Link Here
712
                    <th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th>
712
                    <th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th>
713
                [% END %]
713
                [% END %]
714
                <th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th>
714
                <th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th>
715
                [% IF volinfo %]
715
                <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th>
716
                    <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th>
717
                [% END %]
718
                <th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th>
716
                <th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th>
719
                <th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen">Last seen</th>
717
                <th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen">Last seen</th>
720
                <th id="[% tab | html %]_issues" data-colname="[% tab | html %]_issues">Checkouts</th>
718
                <th id="[% tab | html %]_issues" data-colname="[% tab | html %]_issues">Checkouts</th>
Lines 2498-2503 Link Here
2498
        [% IF Koha.Preference('EnableItemGroups') %]
2496
        [% IF Koha.Preference('EnableItemGroups') %]
2499
            embed.push('item_group_item.item_group.description');
2497
            embed.push('item_group_item.item_group.description');
2500
        [% END %]
2498
        [% END %]
2499
        [% IF biblio.serial %]
2500
            embed.push('serialitem.serial');
2501
        [% END %]
2501
        let table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %];
2502
        let table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %];
2502
        var items_table = $("#table_items").kohaTable({
2503
        var items_table = $("#table_items").kohaTable({
2503
            ajax: { url: table_url },
2504
            ajax: { url: table_url },
Lines 2631-2647 Link Here
2631
                }
2632
                }
2632
2633
2633
            },
2634
            },
2634
            [% IF volinfo %]
2635
            {
2635
            {
2636
                data: "",
2636
                data: "me.serial_issue_number",
2637
                className: "enumchron",
2637
                className: "enumchron",
2638
                searchable: false, // FIXME
2638
                searchable: true,
2639
                orderable: true,
2639
                orderable: true,
2640
                render: function (data, type, row, meta) {
2640
                render: function (data, type, row, meta) {
2641
                    return "volinfo"; // FIXME volinfo/enumchron/serial_issue_number
2641
                    let nodes = "";
2642
                    [%# FIXME Previously we displayed the column if at least one item of the biblio had an enumchron/serial_issue_number. Now it's only if one item of the ones displayed on the current page, how is that bad? How can it be fixed in an elegant way? Should we display the column only if biblio.serial? %]
2643
                    let serial = row.serialitem ? row.serialitem.serial : null;
2644
                    if ( row.serial_issue_number && serial && serial.serialseq ) {
2645
                        nodes += '<span class="enum">%s</span>'.format(row.serial_issue_number);
2646
                        if ( serial.serialseq && row.serial_issue_number != serial.serialseq ) {
2647
                            nodes += ' <span class="sep"> -- </span>'
2648
                            nodes += ' <span class="serialseq">%s</span>'.format(serial.serialseq);
2649
                        }
2650
                    } else if ( row.serial_issue_number ) {
2651
                        nodes += ' <span class="enum">%s</span>'.format(row.serial_issue_number);
2652
                    } else if ( serial && serial.serialseq ) {
2653
                        nodes += '<span class="serialseq">%s</span>'.format(serial.serialseq);
2654
                    }
2655
                    if ( serial && serial.publisheddate ) {
2656
                        nodes += ' <span class="pubdate">(%s)</span>'.format($date(serial.publisheddate));
2657
                    }
2658
                    return nodes;
2642
                }
2659
                }
2643
            },
2660
            },
2644
            [% END %]
2645
            {
2661
            {
2646
                data: "",
2662
                data: "",
2647
                className: "status",
2663
                className: "status",
2648
- 

Return to bug 33568