lp1849212: OPAC course material circulation modifier
authorKyle Huckins <khuckins@catalyte.io>
Mon, 9 Dec 2019 18:53:03 +0000 (18:53 +0000)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 14 Sep 2020 22:16:33 +0000 (18:16 -0400)
- View Circulation Modifier column on Course Materials
while in OPAC record view.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>

 Changes to be committed:
modified:   Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
modified:   Open-ILS/src/templates/opac/parts/record/copy_table.tt2

Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

index ea30359..2cb5699 100644 (file)
@@ -102,9 +102,9 @@ sub load_record {
 
     $ctx->{copies} = $copy_rec->gather(1);
 
-    my $course_module_opt_in = 0;
+    $ctx->{course_module_opt_in} = 0;
     if ($ctx->{get_org_setting}->($org, "circ.course_materials_opt_in")) {
-        $course_module_opt_in = 1;
+        $ctx->{course_module_opt_in} = 1;
     }
 
     # Add public copy notes to each copy - and while we're in there, grab peer bib records
@@ -116,7 +116,7 @@ sub load_record {
             'open-ils.circ.copy_note.retrieve.all',
             {itemid => $copy->{id}, pub => 1 }
         );
-        if ($course_module_opt_in) {
+        if ($ctx->{course_module_opt_in}) {
             $copy->{course_materials} = $U->simplereq(
                 'open-ils.circ',
                 'open-ils.circ.course_materials.retrieve',
index f09e37b..c0a4bfc 100644 (file)
@@ -44,8 +44,10 @@ IF has_copies or ctx.foreign_copies;
             [%- END %]
             <th scope='col'>[% l("Barcode") %]</th>
             <th scope='col'>[% l("Shelving Location") %]</th>
-            [%- IF ctx.is_staff %]
+            [% IF ctx.is_staff || ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %]
             <th scope='col'>[% l("Circulation Modifier") %]</th>
+            [% END %]
+            [% IF ctx.is_staff %]
             <th scope='col'>[% l("Age Hold Protection") %]</th>
             <th scope='col'>[% l("Active/Create Date") %]</th>
             [%- END %]
@@ -145,8 +147,10 @@ END; # FOREACH bib
                 END; -%]
             </td>
             <td property="availableAtOrFrom">[%- INCLUDE "opac/parts/location_name_link.tt2"; -%]</td>
-            [%- IF ctx.is_staff %]
+
+            [% IF copy_info.courses.size > 0 || ctx.is_staff %]
             <td>[% copy_info.circ_modifier | html %]</td>
+            [% ELSIF ctx.is_staff %]
             <td>
                 [% copy_info.age_protect ?
                     ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
@@ -167,6 +171,8 @@ END; # FOREACH bib
                    '-';
                 END;
             %]</td>
+            [% ELSIF ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %]
+            <td></td>
             [% END # is_staff %]
             [% IF ctx.is_staff OR serial_holdings %]
             <td>[%  # Show copy/volume hold links to staff (without