NOBLE custom Server-side stuff user/blake/noble_custom_server_side_3_7_2
authorblake <blake@mobiusconsortium.org>
Fri, 21 Jan 2022 16:37:16 +0000 (10:37 -0600)
committerblake <blake@mobiusconsortium.org>
Fri, 21 Jan 2022 16:37:16 +0000 (10:37 -0600)
Signed-off-by: blake <blake@mobiusconsortium.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/actor.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm

index c4e3455..52cb3a3 100644 (file)
@@ -908,11 +908,12 @@ sub toSQL {
     }
 
     # Build the badge-ish WITH query
+    # NOBLE changed badge math on SUM line
     my $pop_with = <<'    WITH';
         pop_with AS (
             SELECT  record,
                     ARRAY_AGG(badge) AS badges,
-                    SUM(s.score::NUMERIC*b.weight::NUMERIC)/SUM(b.weight::NUMERIC) AS total_score
+                    SUM(s.score::NUMERIC*b.weight::NUMERIC)/(SELECT SUM(badge.weight::NUMERIC) from rating.badge) AS total_score
               FROM  rating.record_badge_score s
                     JOIN rating.badge b ON (
                         b.id = s.badge
index 2b6a6b4..da4c866 100644 (file)
@@ -1437,11 +1437,11 @@ sub new_hold_copy_targeter {
             # reset prox list after trimming good copies
             $prox_list = create_prox_list(
                 $self, $pu_lib,
-                [ grep { $_->status == 0 || $_->status == 7 } @good_copies ],
+                [ grep { $_->status == 0 || $_->status == 7 || $_->status == 107 } @good_copies ],
                 $hold, $hold_copy_map
             );
 
-            $all_copies = [ grep { ''.$_->circ_lib ne $pu_lib && ( $_->status == 0 || $_->status == 7 ) } @good_copies ];
+            $all_copies = [ grep { ''.$_->circ_lib ne $pu_lib && ( $_->status == 0 || $_->status == 7 || $_->status == 107 ) } @good_copies ];
 
             my $min_prox = [ sort {$a<=>$b} keys %$prox_list ]->[0];
             my $best;
@@ -1828,7 +1828,7 @@ sub reservation_targeter {
                     next;
                 }
 
-                if ($copy->status->id == 0 || $copy->status->id == 7) {
+                if ($copy->status->id == 0 || $copy->status->id == 7 || $copy->status == 107) {
                     push @good_resources, $res;
                     next;
                 }
index 0c1f0a5..69f3ff7 100644 (file)
@@ -795,7 +795,7 @@ sub patron_search {
     my @ns;
     my @namev;
     if ($nv) {
-        $name = "name_kw_tsvector @@ to_tsquery(?)";
+        $name = "name_kw_tsvector @@ to_tsquery('simple', ?)";
 
         # Remove characters that to_tsquery might treat as operators.
         # Note using plainto_tsquery to ignore operators won't let us
index 5763cb8..5fa1c90 100644 (file)
@@ -155,6 +155,8 @@ sub load {
 
     return $self->load_library if $path =~ m|opac/library|;
     return $self->load_rresults if $path =~ m|opac/results|;
+    # NOBLE
+    return $self->load_rresults if $path =~ m|opac/bookbag|;
     return $self->load_print_or_email_preview('print') if $path =~ m|opac/record/print_preview|;
     return $self->load_print_record if $path =~ m|opac/record/print|;
     return $self->load_record if $path =~ m|opac/record/\d|;
index 2728f36..3a7d8bd 100644 (file)
@@ -2184,7 +2184,8 @@ sub sru_search {
                     }
                 }
 
-                $quote_it = 0 if ( $base eq 'all' );
+                #$quote_it = 0 if ( $base eq 'all' ); #NOBLE don't quote keyword for ComCat
+                $quote_it = 0 if ( $base eq 'all' || ( $base eq '=' && grep {$qualifier eq $_} qw(eg.keyword eg.title eg.author) ) );
                 $term = maybeQuote($term) if $quote_it;
 
             } else {