From 3e318a6238c7a705854cba4668d48588c14ccf62 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 --- Open-ILS/src/perlmods/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/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index f44d355d24..9cc505fd16 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -3236,6 +3236,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 885cb3bc1c..0ea6693342 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -6953,6 +6953,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.11.0