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 418-423 sub return_claims { Link Here
418
    return Koha::Checkouts::ReturnClaims->_new_from_dbic( $claims_rs );
418
    return Koha::Checkouts::ReturnClaims->_new_from_dbic( $claims_rs );
419
}
419
}
420
420
421
=head3 return_claim
422
423
  my $return_claim = $item->return_claim;
424
425
Returns the most recent unresolved return_claims associated with this item
426
427
=cut
428
429
sub return_claim {
430
    my ( $self ) = @_;
431
    my $claims_rs =
432
      $self->_result->return_claims->search( { resolution => undef },
433
        { order_by => { '-desc' => 'created_on' } } )->single;
434
    return unless $claims_rs;
435
    return Koha::Checkouts::ReturnClaim->_new_from_dbic( $claims_rs );
436
}
437
421
=head3 holds
438
=head3 holds
422
439
423
my $holds = $item->holds();
440
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 201-206 Link Here
201
    x-koha-embed:
201
    x-koha-embed:
202
      - biblio
202
      - biblio
203
      - checkout
203
      - checkout
204
      - return_claims
205
      - return_claim
206
      - return_claim.patron
204
/items/{item_id}/bundled_items/{bundled_item_id}:
207
/items/{item_id}/bundled_items/{bundled_item_id}:
205
  delete:
208
  delete:
206
    x-mojo-to: Items#remove_from_bundle
209
    x-mojo-to: Items#remove_from_bundle
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-6 / +13 lines)
Lines 1381-1386 Note that permanent location is a code, and location may be an authval. Link Here
1381
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1381
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1382
    [% INCLUDE 'columns_settings.inc' %]
1382
    [% INCLUDE 'columns_settings.inc' %]
1383
    [% INCLUDE 'js-date-format.inc' %]
1383
    [% INCLUDE 'js-date-format.inc' %]
1384
    [% INCLUDE 'js-patron-format.inc' %]
1384
    [% Asset.js("js/browser.js") | $raw %]
1385
    [% Asset.js("js/browser.js") | $raw %]
1385
    [% Asset.js("js/table_filters.js") | $raw %]
1386
    [% Asset.js("js/table_filters.js") | $raw %]
1386
    <script>
1387
    <script>
Lines 1414-1420 Note that permanent location is a code, and location may be an authval. Link Here
1414
                    },
1415
                    },
1415
                    "header_filter": false,
1416
                    "header_filter": false,
1416
                    "embed": [
1417
                    "embed": [
1417
                        "biblio"
1418
                        "biblio",
1419
                        "return_claim.patron"
1418
                    ],
1420
                    ],
1419
                    "order": [[ 1, "asc" ]],
1421
                    "order": [[ 1, "asc" ]],
1420
                    "columnDefs": [ {
1422
                    "columnDefs": [ {
Lines 1474-1488 Note that permanent location is a code, and location may be an authval. Link Here
1474
                            "orderable": true,
1476
                            "orderable": true,
1475
                        },
1477
                        },
1476
                        {
1478
                        {
1477
                            "data": "lost_status:last_seen_date",
1479
                            "data": "lost_status:last_seen_date:return_claim.patron",
1478
                            "title": "Status",
1480
                            "title": "Status",
1479
                            "searchable": false,
1481
                            "searchable": false,
1480
                            "orderable": true,
1482
                            "orderable": true,
1481
                            "render": function(data, type, row, meta) {
1483
                            "render": function(data, type, row, meta) {
1482
                                if ( row.lost_status == bundle_lost_value ) {
1484
                                if ( row.lost_status == bundle_lost_value ) {
1483
                                    return "Last seen: " + row.last_seen_date;
1485
                                    let out = '<span class="lost">' + _("Last seen") + ': ' + row.last_seen_date + '</span>';
1486
                                    if ( row.return_claim ) {
1487
                                        out = out + '<span class="claims_return">' + _("Claims returned by") + ': ' + $patron_to_html( row.return_claim.patron, { display_cardnumber: false, url: true } ) + '</span>';
1488
                                    }
1489
                                    return out;
1484
                                }
1490
                                }
1485
                                return "Present";
1491
                                else if ( row.lost_status !== 0 ) {
1492
                                    return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1493
                                }
1494
                                return '<span class="available">' + _("Present") + '</span>';
1486
                            }
1495
                            }
1487
                        },
1496
                        },
1488
                        {
1497
                        {
Lines 1497-1503 Note that permanent location is a code, and location may be an authval. Link Here
1497
                        }
1506
                        }
1498
                    ]
1507
                    ]
1499
                }, bundle_columns, 1);
1508
                }, bundle_columns, 1);
1500
1501
                $(".tbundle").on("click", ".remove", function(){
1509
                $(".tbundle").on("click", ".remove", function(){
1502
                    var bundle_table = $(this).closest('table');
1510
                    var bundle_table = $(this).closest('table');
1503
                    var host_itemnumber = bundle_table.data('itemnumber');
1511
                    var host_itemnumber = bundle_table.data('itemnumber');
1504
- 

Return to bug 28854