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 1399-1404 Note that permanent location is a code, and location may be an authval. Link Here
1399
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1399
    [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1400
    [% INCLUDE 'columns_settings.inc' %]
1400
    [% INCLUDE 'columns_settings.inc' %]
1401
    [% INCLUDE 'js-date-format.inc' %]
1401
    [% INCLUDE 'js-date-format.inc' %]
1402
    [% INCLUDE 'js-patron-format.inc' %]
1402
    [% Asset.js("js/browser.js") | $raw %]
1403
    [% Asset.js("js/browser.js") | $raw %]
1403
    [% Asset.js("js/table_filters.js") | $raw %]
1404
    [% Asset.js("js/table_filters.js") | $raw %]
1404
    <script>
1405
    <script>
Lines 1432-1438 Note that permanent location is a code, and location may be an authval. Link Here
1432
                    },
1433
                    },
1433
                    "header_filter": false,
1434
                    "header_filter": false,
1434
                    "embed": [
1435
                    "embed": [
1435
                        "biblio"
1436
                        "biblio",
1437
                        "return_claim.patron"
1436
                    ],
1438
                    ],
1437
                    "order": [[ 1, "asc" ]],
1439
                    "order": [[ 1, "asc" ]],
1438
                    "columnDefs": [ {
1440
                    "columnDefs": [ {
Lines 1495-1509 Note that permanent location is a code, and location may be an authval. Link Here
1495
                            "orderable": true,
1497
                            "orderable": true,
1496
                        },
1498
                        },
1497
                        {
1499
                        {
1498
                            "data": "lost_status:last_seen_date",
1500
                            "data": "lost_status:last_seen_date:return_claim.patron",
1499
                            "title": "Status",
1501
                            "title": "Status",
1500
                            "searchable": false,
1502
                            "searchable": false,
1501
                            "orderable": true,
1503
                            "orderable": true,
1502
                            "render": function(data, type, row, meta) {
1504
                            "render": function(data, type, row, meta) {
1503
                                if ( row.lost_status == bundle_lost_value ) {
1505
                                if ( row.lost_status == bundle_lost_value ) {
1504
                                    return "Last seen: " + row.last_seen_date;
1506
                                    let out = '<span class="lost">' + _("Last seen") + ': ' + row.last_seen_date + '</span>';
1507
                                    if ( row.return_claim ) {
1508
                                        out = out + '<span class="claims_return">' + _("Claims returned by") + ': ' + $patron_to_html( row.return_claim.patron, { display_cardnumber: false, url: true } ) + '</span>';
1509
                                    }
1510
                                    return out;
1505
                                }
1511
                                }
1506
                                return "Present";
1512
                                else if ( row.lost_status !== 0 ) {
1513
                                    return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1514
                                }
1515
                                return '<span class="available">' + _("Present") + '</span>';
1507
                            }
1516
                            }
1508
                        },
1517
                        },
1509
                        {
1518
                        {
Lines 1518-1524 Note that permanent location is a code, and location may be an authval. Link Here
1518
                        }
1527
                        }
1519
                    ]
1528
                    ]
1520
                }, bundle_settings, 1);
1529
                }, bundle_settings, 1);
1521
1522
                $(".tbundle").on("click", ".remove", function(){
1530
                $(".tbundle").on("click", ".remove", function(){
1523
                    var bundle_table = $(this).closest('table');
1531
                    var bundle_table = $(this).closest('table');
1524
                    var host_itemnumber = bundle_table.data('itemnumber');
1532
                    var host_itemnumber = bundle_table.data('itemnumber');
1525
- 

Return to bug 28854