From: Bill Erickson Date: Thu, 13 May 2021 16:18:33 +0000 (-0400) Subject: LP1928359 Add item circ info to Item Table X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=61310ed4a0fd9e291c1f0806cceed1defd70d0a8;p=evergreen%2Ftadl.git 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 --- 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;