Show OPAC-invisible copies in TPAC in staff context user/dbs/show_opac_invisible_in_staff_client
authorDan Scott <dscott@laurentian.ca>
Sat, 9 Mar 2013 03:41:08 +0000 (22:41 -0500)
committerDan Scott <dscott@laurentian.ca>
Sat, 9 Mar 2013 03:41:08 +0000 (22:41 -0500)
We were not calling the staff variation of the copy count method; thus,
the record details template was skipping the copy table in the event
that all copies for a given record were marked as OPAC-invisible via
either copy visibility or shelving location visibility.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm

index 026d792..df55e14 100644 (file)
@@ -381,8 +381,12 @@ sub get_hold_copy_summary {
     my $ctx = $self->ctx;
     
     my $search = OpenSRF::AppSession->create('open-ils.search');
-    my $req1 = $search->request(
-        'open-ils.search.biblio.record.copy_count', $org, $rec_id); 
+    my $copy_count_meth = 'open-ils.search.biblio.record.copy_count';
+    # We want to include OPAC-invisible copies in a staff context
+    if ($ctx->{is_staff}) {
+        $copy_count_meth .= '.staff';
+    }
+    my $req1 = $search->request($copy_count_meth, $org, $rec_id); 
 
     # if org unit hiding applies, limit the hold count to holds
     # whose pickup library is within our depth-scoped tree