lp1913815 Course Browse Owning Lib Support
authorKyle Huckins <khuckins@catalyte.io>
Wed, 20 Apr 2022 16:35:24 +0000 (16:35 +0000)
committerKyle Huckins <khuckins@catalyte.io>
Wed, 20 Apr 2022 16:35:24 +0000 (16:35 +0000)
- Enable the ability to filter Course Browse results by owning library

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Course.pm

Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Course.pm

index 4045349..22cf1f0 100644 (file)
@@ -53,6 +53,7 @@ sub load_course_browse {
     if ($cgi->param('bterm')) {
         my $bterm = $cgi->param('bterm');
         my $qtype = $cgi->param('qtype');
+        my $locg = $cgi->param('locg');
         # Search term is optional. If it's empty, start at the
         # beginning. Otherwise, center results on a match.
         # Regardless, we're listing everything, so retrieve all.
@@ -115,10 +116,13 @@ sub load_course_browse {
                     'owning_lib'
                 ]},
                 "order_by" => {"acmc" => [$qtype]},
-                # TODO: We need to support the chosen library as well...
-                "where" => {'-not' => {'+acmc' => 'is_archived'}}
+                "where" => {
+                    '-not' => {'+acmc' => 'is_archived'},
+                    '+acmc' => { 'owning_lib' => $locg }
+                }
             });
         }
+
         my $bterm_match = 0;
         for my $result(@$results) {
             my $value_exists = 0;