From 61310ed4a0fd9e291c1f0806cceed1defd70d0a8 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 13 May 2021 12:18:33 -0400 Subject: [PATCH] LP1928359 Add item circ info to Item Table Adds "Total Circ Count" and "Last Circ Date" to the staff catalog Item Table grid view. Signed-off-by: Bill Erickson Signed-off-by: Shula Link Signed-off-by: Galen Charlton --- .../eg2/src/app/staff/catalog/record/copies.component.html | 4 ++++ Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm | 9 ++++++++- .../src/perlmods/lib/OpenILS/Application/Search/Biblio.pm | 12 +++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.html index df669a14c0..ea6d030ca9 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.html @@ -84,6 +84,10 @@ + + + + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm index 13cdc70799..d5da49b1bc 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm @@ -2122,6 +2122,7 @@ sub basic_opac_copy_query { bmp => [ {column => 'label', alias => 'part_label'}, ], + ($staff ? (erfcc => ['circ_count']) : ()), ($iss_id ? (sitem => ["issuance"]) : ()) }, @@ -2166,7 +2167,13 @@ sub basic_opac_copy_query { sstr => { } } } - } : ()) + } : ()), + ($staff ? { + erfcc => { + fkey => 'id', + field => 'id' + } + }: ()), ] }, diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm index 912e626626..26ccaac068 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm @@ -2871,7 +2871,17 @@ sub bib_copies { my $resp; while ($resp = $req->recv) { - $client->respond($resp->content); + my $copy = $resp->content; + + if ($is_staff) { + # last_circ is an IDL query so it cannot be queried directly + # via JSON query. + $copy->{last_circ} = + new_editor()->retrieve_reporter_last_circ_date($copy->{id}) + ->last_circ; + } + + $client->respond($copy); } return undef; -- 2.11.0