Opac Renewal at original circ library
authorThomas Berezansky <tsbere@mvlc.org>
Sat, 2 Jul 2011 16:50:36 +0000 (12:50 -0400)
committerMike Rylander <mrylander@gmail.com>
Sat, 16 Jul 2011 14:20:59 +0000 (10:20 -0400)
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 <tsbere@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>

Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
Open-ILS/src/sql/Pg/950.data.seed-values.sql

index cbdb4fc..5da8ada 100644 (file)
@@ -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;
 
index 0082b83..6ffacb0 100644 (file)
@@ -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',