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 1366-1371 Note that permanent location is a code, and location may be an authval. Link Here
1366
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1366
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1367
    [% INCLUDE 'columns_settings.inc' %]
1367
    [% INCLUDE 'columns_settings.inc' %]
1368
    [% INCLUDE 'js-date-format.inc' %]
1368
    [% INCLUDE 'js-date-format.inc' %]
1369
    [% INCLUDE 'js-patron-format.inc' %]
1369
    [% Asset.js("js/browser.js") | $raw %]
1370
    [% Asset.js("js/browser.js") | $raw %]
1370
    [% Asset.js("js/table_filters.js") | $raw %]
1371
    [% Asset.js("js/table_filters.js") | $raw %]
1371
    <script>
1372
    <script>
Lines 1399-1405 Note that permanent location is a code, and location may be an authval. Link Here
1399
                    },
1400
                    },
1400
                    "header_filter": false,
1401
                    "header_filter": false,
1401
                    "embed": [
1402
                    "embed": [
1402
                        "biblio"
1403
                        "biblio",
1404
                        "return_claim.patron"
1403
                    ],
1405
                    ],
1404
                    "order": [[ 1, "asc" ]],
1406
                    "order": [[ 1, "asc" ]],
1405
                    "columnDefs": [ {
1407
                    "columnDefs": [ {
Lines 1459-1473 Note that permanent location is a code, and location may be an authval. Link Here
1459
                            "orderable": true,
1461
                            "orderable": true,
1460
                        },
1462
                        },
1461
                        {
1463
                        {
1462
                            "data": "lost_status:last_seen_date",
1464
                            "data": "lost_status:last_seen_date:return_claim.patron",
1463
                            "title": "Status",
1465
                            "title": "Status",
1464
                            "searchable": false,
1466
                            "searchable": false,
1465
                            "orderable": true,
1467
                            "orderable": true,
1466
                            "render": function(data, type, row, meta) {
1468
                            "render": function(data, type, row, meta) {
1467
                                if ( row.lost_status == bundle_lost_value ) {
1469
                                if ( row.lost_status == bundle_lost_value ) {
1468
                                    return "Last seen: " + row.last_seen_date;
1470
                                    let out = '<span class="lost">' + _("Last seen") + ': ' + row.last_seen_date + '</span>';
1471
                                    if ( row.return_claim ) {
1472
                                        out = out + '<span class="claims_return">' + _("Claims returned by") + ': ' + $patron_to_html( row.return_claim.patron, { display_cardnumber: false, url: true } ) + '</span>';
1473
                                    }
1474
                                    return out;
1469
                                }
1475
                                }
1470
                                return "Present";
1476
                                else if ( row.lost_status !== 0 ) {
1477
                                    return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1478
                                }
1479
                                return '<span class="available">' + _("Present") + '</span>';
1471
                            }
1480
                            }
1472
                        },
1481
                        },
1473
                        {
1482
                        {
Lines 1482-1488 Note that permanent location is a code, and location may be an authval. Link Here
1482
                        }
1491
                        }
1483
                    ]
1492
                    ]
1484
                }, bundle_columns, 1);
1493
                }, bundle_columns, 1);
1485
1486
                $(".tbundle").on("click", ".remove", function(){
1494
                $(".tbundle").on("click", ".remove", function(){
1487
                    var bundle_table = $(this).closest('table');
1495
                    var bundle_table = $(this).closest('table');
1488
                    var host_itemnumber = bundle_table.data('itemnumber');
1496
                    var host_itemnumber = bundle_table.data('itemnumber');
1489
- 

Return to bug 28854