From 8823e4060bbc825c859327b018c5f8cb29b9ac2a Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Sat, 2 Jul 2011 12:50:36 -0400 Subject: [PATCH] Opac Renewal at original circ library Fixes multiple potential issues: 1 - Bad home ou on patron breaks circ rules Ex. Patron edited while editor would let you pick bad home ou 2 - Item not allowed to circ at patron home ou Ex. Patron went to where they were allowed to pick it up 3 - Fines change to patron home ou fine rules Ex. Patron's home ou doesn't charge fines but circ lib does Ex. Circ lib doesn't charge fines but Patron's home ou does Signed-off-by: Thomas Berezansky Signed-off-by: Mike Rylander --- .../lib/OpenILS/Application/Circ/Circulate.pm | 8 ++++++++ Open-ILS/src/sql/Pg/950.data.seed-values.sql | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index cbdb4fcb4d..5da8ada801 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -3316,6 +3316,14 @@ sub do_renew { $self->renewal_remaining( $circ->renewal_remaining - 1 ); $self->circ($circ); + # Opac renewal - re-use circ library from original circ (unless told not to) + if($self->opac_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($circ->circ_lib); + } + } + # Run the fine generator against the old circ $self->generate_fines_start; diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 0082b83d41..6ffacb0069 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -7929,6 +7929,18 @@ INSERT INTO config.global_flag (name, label, enabled) TRUE ); +INSERT INTO config.global_flag (name, label, enabled) + VALUES ( + 'circ.opac_renewal.use_original_circ_lib', + oils_i18n_gettext( + 'circ.opac_renewal.use_original_circ_lib', + 'Circ: Use original circulation library on opac renewal instead of user home library', + 'cgf', + 'label' + ), + TRUE + ); + INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype) VALUES ( 'history.circ.retention_age', -- 2.43.2