From 3fe27455f1d35e3ac095101c86f82f01b324c9b1 Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Fri, 30 Sep 2022 15:28:48 -0400 Subject: [PATCH] LP1829418 OPAC-Visible Stat Cats Not Visible This adds patron and item statistical categories to the Bootstrap OPAC. OPAC-visible patron stat cats will appear in My Account > Preferences > Personal Information as new rows below the Account Expiration Date. OPAC-visible item stat cats will appear below Copy Notes in the copy table on the record details page. Signed-off-by: Terran McCanna Signed-off-by: Elaine Hardy Signed-off-by: Jane Sandberg --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm | 5 +++-- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm | 6 ++++++ Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2 | 13 ++++++++++--- .../templates-bootstrap/opac/parts/record/copy_table.tt2 | 7 +++++++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index dcc2f1403e..dab791836f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -37,8 +37,9 @@ sub prepare_extended_user_info { { flesh => 2, flesh_fields => { - au => [qw/card home_ou addresses ident_type locale billing_address waiver_entries/, @extra_flesh], - "aou" => ["billing_address"] + au => [qw/card home_ou addresses ident_type locale billing_address waiver_entries stat_cat_entries/, @extra_flesh], + "aou" => ["billing_address"], + "actscecm" => ["stat_cat"] } } ]); diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm index c4c14d04ae..91d6bcff55 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm @@ -150,6 +150,7 @@ sub load_record { # Add public copy notes to each copy - and while we're in there, grab peer bib records # and copy tags. Oh and if we're working with course materials, those too. + # And opac-visible item stat cats. my %cached_bibs = (); foreach my $copy (@{$ctx->{copies}}) { $copy->{notes} = $U->simplereq( @@ -157,6 +158,11 @@ sub load_record { 'open-ils.circ.copy_note.retrieve.all', {itemid => $copy->{id}, pub => 1 } ); + $copy->{statcats} = $U->simplereq( + 'open-ils.circ', + 'open-ils.circ.asset.stat_cat_entries.fleshed.retrieve_by_copy', + {copyid => $copy->{id}, public => 1} + ); if ($ctx->{course_module_opt_in}) { $copy->{course_materials} = $U->simplereq( 'open-ils.courses', diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2 index 74bb68c5c1..5c34b56832 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2 @@ -161,9 +161,16 @@ - - - + [% IF ctx.user.stat_cat_entries.size; + FOR statcat IN ctx.user.stat_cat_entries; + IF statcat.stat_cat.opac_visible == 't'; %] + + [% statcat.stat_cat.name %] + [% statcat.stat_cat_entry %] + + [% END; + END; + END %] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 index 6e02890210..b5b1bc1824 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 @@ -192,6 +192,13 @@ END; # FOREACH bib [% END %] [% END %] + [% IF copy_info.statcats.size; %] + [% FOREACH statcat IN copy_info.statcats; + IF statcat.stat_cat.opac_visible == 't'; %] +
[% statcat.stat_cat.name %]: [% statcat.value %] + [% END; + END %] + [% END %] [%- IF has_parts == 'true' %] [% copy_info.part_label | html %] -- 2.11.0