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 431-436 sub return_claims { Link Here
431
    return Koha::Checkouts::ReturnClaims->_new_from_dbic( $claims_rs );
431
    return Koha::Checkouts::ReturnClaims->_new_from_dbic( $claims_rs );
432
}
432
}
433
433
434
=head3 return_claim
435
436
  my $return_claim = $item->return_claim;
437
438
Returns the most recent unresolved return_claims associated with this item
439
440
=cut
441
442
sub return_claim {
443
    my ($self) = @_;
444
    my $claims_rs =
445
      $self->_result->return_claims->search( { resolution => undef },
446
        { order_by => { '-desc' => 'created_on' }, rows => 1 } )->single;
447
    return unless $claims_rs;
448
    return Koha::Checkouts::ReturnClaim->_new_from_dbic($claims_rs);
449
}
450
434
=head3 holds
451
=head3 holds
435
452
436
my $holds = $item->holds();
453
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 1405-1410 Note that permanent location is a code, and location may be an authval. Link Here
1405
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1405
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1406
    [% INCLUDE 'columns_settings.inc' %]
1406
    [% INCLUDE 'columns_settings.inc' %]
1407
    [% INCLUDE 'js-date-format.inc' %]
1407
    [% INCLUDE 'js-date-format.inc' %]
1408
    [% INCLUDE 'js-patron-format.inc' %]
1408
    [% Asset.js("js/browser.js") | $raw %]
1409
    [% Asset.js("js/browser.js") | $raw %]
1409
    [% Asset.js("js/table_filters.js") | $raw %]
1410
    [% Asset.js("js/table_filters.js") | $raw %]
1410
    <script>
1411
    <script>
Lines 1438-1444 Note that permanent location is a code, and location may be an authval. Link Here
1438
                    },
1439
                    },
1439
                    "header_filter": false,
1440
                    "header_filter": false,
1440
                    "embed": [
1441
                    "embed": [
1441
                        "biblio"
1442
                        "biblio",
1443
                        "return_claim.patron"
1442
                    ],
1444
                    ],
1443
                    "order": [[ 1, "asc" ]],
1445
                    "order": [[ 1, "asc" ]],
1444
                    "columnDefs": [ {
1446
                    "columnDefs": [ {
Lines 1501-1515 Note that permanent location is a code, and location may be an authval. Link Here
1501
                            "orderable": true,
1503
                            "orderable": true,
1502
                        },
1504
                        },
1503
                        {
1505
                        {
1504
                            "data": "lost_status:last_seen_date",
1506
                            "data": "lost_status:last_seen_date:return_claim.patron",
1505
                            "title": "Status",
1507
                            "title": "Status",
1506
                            "searchable": false,
1508
                            "searchable": false,
1507
                            "orderable": true,
1509
                            "orderable": true,
1508
                            "render": function(data, type, row, meta) {
1510
                            "render": function(data, type, row, meta) {
1509
                                if ( row.lost_status == bundle_lost_value ) {
1511
                                if ( row.lost_status == bundle_lost_value ) {
1510
                                    return "Last seen: " + row.last_seen_date;
1512
                                    let out = '<span class="lost">' + _("Last seen") + ': ' + row.last_seen_date + '</span>';
1513
                                    if ( row.return_claim ) {
1514
                                        out = out + '<span class="claims_return">' + _("Claims returned by") + ': ' + $patron_to_html( row.return_claim.patron, { display_cardnumber: false, url: true } ) + '</span>';
1515
                                    }
1516
                                    return out;
1511
                                }
1517
                                }
1512
                                return "Present";
1518
                                else if ( row.lost_status !== 0 ) {
1519
                                    return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1520
                                }
1521
                                return '<span class="available">' + _("Present") + '</span>';
1513
                            }
1522
                            }
1514
                        },
1523
                        },
1515
                        {
1524
                        {
Lines 1524-1530 Note that permanent location is a code, and location may be an authval. Link Here
1524
                        }
1533
                        }
1525
                    ]
1534
                    ]
1526
                }, bundle_settings, 1);
1535
                }, bundle_settings, 1);
1527
1528
                $(".tbundle").on("click", ".remove", function(){
1536
                $(".tbundle").on("click", ".remove", function(){
1529
                    var bundle_table = $(this).closest('table');
1537
                    var bundle_table = $(this).closest('table');
1530
                    var host_itemnumber = bundle_table.data('itemnumber');
1538
                    var host_itemnumber = bundle_table.data('itemnumber');
1531
- 

Return to bug 28854