LP1829418 OPAC-Visible Stat Cats Not Visible
authorTerran McCanna <tmccanna@georgialibraries.org>
Fri, 30 Sep 2022 19:28:48 +0000 (15:28 -0400)
committerJane Sandberg <js7389@princeton.edu>
Sat, 29 Oct 2022 04:00:56 +0000 (21:00 -0700)
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 <tmccanna@georgialibraries.org>
Signed-off-by: Elaine Hardy <ehardy@georgialibraries.org>
Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2

index dcc2f14..dab7918 100644 (file)
@@ -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"]
             }
         }
     ]);
index c4c14d0..91d6bcf 100644 (file)
@@ -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',
index 74bb68c..5c34b56 100755 (executable)
                 </td>
                 <td></td>
             </tr>
-            
-           
-
+            [% IF ctx.user.stat_cat_entries.size;
+                FOR statcat IN ctx.user.stat_cat_entries;
+                    IF statcat.stat_cat.opac_visible == 't'; %]
+                        <tr>
+                            <td class='color_4 light_border'>[% statcat.stat_cat.name %]</td>
+                            <td class='light_border' colspan='2'>[% statcat.stat_cat_entry %]</td>
+                        </tr>
+                    [% END;
+                END;
+            END %]
         </tbody>
     </table>
 
index 6e02890..b5b1bc1 100755 (executable)
@@ -192,6 +192,13 @@ END; # FOREACH bib
                     </div>
             [% END %]
         [% END %]
+        [% IF copy_info.statcats.size; %]
+            [% FOREACH statcat IN copy_info.statcats;
+                IF statcat.stat_cat.opac_visible == 't'; %]
+                    <br/>[% statcat.stat_cat.name %]: [% statcat.value %]
+                [% END;
+            END %]
+        [% END %]
         </td>
             [%- IF has_parts == 'true' %]
             <td>[% copy_info.part_label | html %]</td>