lp1861319 Auto-Renew/OPAC Renewal Compatibility
authorKyle Huckins <khuckins@catalyte.io>
Mon, 16 Nov 2020 21:54:04 +0000 (21:54 +0000)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 10 Mar 2021 19:59:38 +0000 (14:59 -0500)
- Check global flag to determine which OU to check setting for.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: John Amundson <jamundson@cwmars.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index be6917c..0d36dae 100644 (file)
@@ -1024,6 +1024,16 @@ sub mk_env {
             clean_ISO8601($patron->expire_date));
 
         # An expired patron can renew with the assistance of an OUS.
             clean_ISO8601($patron->expire_date));
 
         # An expired patron can renew with the assistance of an OUS.
+        if($self->opac_renewal or $self->auto_renewal) {
+            my $use_circ_lib = $self->editor->retrieve_config_global_flag('circ.opac_renewal.use_original_circ_lib');
+            if($use_circ_lib and $U->is_true($use_circ_lib->enabled)) {
+                $self->circ_lib($self->circ->circ_lib);
+            }
+            else {
+                $self->circ_lib($patron->home_ou);
+            }
+        }
+
         my $expire_setting = $U->ou_ancestor_setting_value($self->circ_lib, OILS_SETTING_ALLOW_RENEW_FOR_EXPIRED_PATRON);
         unless ($self->is_renewal and $expire_setting) {
             if(CORE::time > $expire->epoch) {
         my $expire_setting = $U->ou_ancestor_setting_value($self->circ_lib, OILS_SETTING_ALLOW_RENEW_FOR_EXPIRED_PATRON);
         unless ($self->is_renewal and $expire_setting) {
             if(CORE::time > $expire->epoch) {