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

(-)a/Koha/Checkouts/ReturnClaims.pm (-1 / +1 lines)
Lines 60-66 sub resolved { Link Here
60
    return Koha::Checkouts::ReturnClaims->_new_from_dbic( $results );
60
    return Koha::Checkouts::ReturnClaims->_new_from_dbic( $results );
61
}
61
}
62
62
63
=head3 type
63
=head3 _type
64
64
65
=cut
65
=cut
66
66
(-)a/Koha/Item.pm (+17 lines)
Lines 455-460 sub return_claims { Link Here
455
    return Koha::Checkouts::ReturnClaims->_new_from_dbic( $claims_rs );
455
    return Koha::Checkouts::ReturnClaims->_new_from_dbic( $claims_rs );
456
}
456
}
457
457
458
=head3 return_claim
459
460
  my $return_claim = $item->return_claim;
461
462
Returns the most recent unresolved return_claims associated with this item
463
464
=cut
465
466
sub return_claim {
467
    my ($self) = @_;
468
    my $claims_rs =
469
      $self->_result->return_claims->search( { resolution => undef },
470
        { order_by => { '-desc' => 'created_on' }, rows => 1 } )->single;
471
    return unless $claims_rs;
472
    return Koha::Checkouts::ReturnClaim->_new_from_dbic($claims_rs);
473
}
474
458
=head3 holds
475
=head3 holds
459
476
460
my $holds = $item->holds();
477
my $holds = $item->holds();
(-)a/api/v1/swagger/definitions/item.yaml (+8 lines)
Lines 212-217 properties: Link Here
212
  exclude_from_local_holds_priority:
212
  exclude_from_local_holds_priority:
213
    type: boolean
213
    type: boolean
214
    description: Exclude this item from local holds priority.
214
    description: Exclude this item from local holds priority.
215
  return_claims:
216
    type: array
217
    description: An array of all return claims associated with this item
218
  return_claim:
219
    type:
220
      - object
221
      - "null"
222
    description: A return claims object if one exists that's unresolved
215
additionalProperties: false
223
additionalProperties: false
216
required:
224
required:
217
  - item_id
225
  - item_id
(-)a/api/v1/swagger/paths/items.yaml (+3 lines)
Lines 202-207 Link Here
202
    x-koha-embed:
202
    x-koha-embed:
203
      - biblio
203
      - biblio
204
      - checkout
204
      - checkout
205
      - return_claims
206
      - return_claim
207
      - return_claim.patron
205
"/items/{item_id}/bundled_items/{bundled_item_id}":
208
"/items/{item_id}/bundled_items/{bundled_item_id}":
206
  delete:
209
  delete:
207
    x-mojo-to: Items#remove_from_bundle
210
    x-mojo-to: Items#remove_from_bundle
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-6 / +13 lines)
Lines 1568-1573 Note that permanent location is a code, and location may be an authval. Link Here
1568
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1568
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1569
    [% INCLUDE 'columns_settings.inc' %]
1569
    [% INCLUDE 'columns_settings.inc' %]
1570
    [% INCLUDE 'js-date-format.inc' %]
1570
    [% INCLUDE 'js-date-format.inc' %]
1571
    [% INCLUDE 'js-patron-format.inc' %]
1571
    [% Asset.js("js/browser.js") | $raw %]
1572
    [% Asset.js("js/browser.js") | $raw %]
1572
    [% Asset.js("js/table_filters.js") | $raw %]
1573
    [% Asset.js("js/table_filters.js") | $raw %]
1573
    <script>
1574
    <script>
Lines 1601-1607 Note that permanent location is a code, and location may be an authval. Link Here
1601
                    },
1602
                    },
1602
                    "header_filter": false,
1603
                    "header_filter": false,
1603
                    "embed": [
1604
                    "embed": [
1604
                        "biblio"
1605
                        "biblio",
1606
                        "return_claim.patron"
1605
                    ],
1607
                    ],
1606
                    "order": [[ 1, "asc" ]],
1608
                    "order": [[ 1, "asc" ]],
1607
                    "columnDefs": [ {
1609
                    "columnDefs": [ {
Lines 1664-1678 Note that permanent location is a code, and location may be an authval. Link Here
1664
                            "orderable": true,
1666
                            "orderable": true,
1665
                        },
1667
                        },
1666
                        {
1668
                        {
1667
                            "data": "lost_status:last_seen_date",
1669
                            "data": "lost_status:last_seen_date:return_claim.patron",
1668
                            "title": "Status",
1670
                            "title": "Status",
1669
                            "searchable": false,
1671
                            "searchable": false,
1670
                            "orderable": true,
1672
                            "orderable": true,
1671
                            "render": function(data, type, row, meta) {
1673
                            "render": function(data, type, row, meta) {
1672
                                if ( row.lost_status == bundle_lost_value ) {
1674
                                if ( row.lost_status == bundle_lost_value ) {
1673
                                    return "Last seen: " + row.last_seen_date;
1675
                                    let out = '<span class="lost">' + _("Last seen") + ': ' + row.last_seen_date + '</span>';
1676
                                    if ( row.return_claim ) {
1677
                                        out = out + '<span class="claims_return">' + _("Claims returned by") + ': ' + $patron_to_html( row.return_claim.patron, { display_cardnumber: false, url: true } ) + '</span>';
1678
                                    }
1679
                                    return out;
1674
                                }
1680
                                }
1675
                                return "Present";
1681
                                else if ( row.lost_status !== 0 ) {
1682
                                    return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1683
                                }
1684
                                return '<span class="available">' + _("Present") + '</span>';
1676
                            }
1685
                            }
1677
                        },
1686
                        },
1678
                        {
1687
                        {
Lines 1687-1693 Note that permanent location is a code, and location may be an authval. Link Here
1687
                        }
1696
                        }
1688
                    ]
1697
                    ]
1689
                }, bundle_settings, 1);
1698
                }, bundle_settings, 1);
1690
1691
                $(".tbundle").on("click", ".remove", function(){
1699
                $(".tbundle").on("click", ".remove", function(){
1692
                    var bundle_table = $(this).closest('table');
1700
                    var bundle_table = $(this).closest('table');
1693
                    var host_itemnumber = bundle_table.data('itemnumber');
1701
                    var host_itemnumber = bundle_table.data('itemnumber');
1694
- 

Return to bug 28854