From: Thomas Berezansky Date: Sat, 2 Jul 2011 16:50:36 +0000 (-0400) Subject: Opac Renewal at original circ library X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=367102ae7cdad33b0784db05c671b57d41e706be;p=contrib%2FConifer.git 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 --- 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 566a168a99..e184b285fd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -3272,6 +3272,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 6f1a071b4c..799c4cd91e 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -7882,6 +7882,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',