[open-ils-commits] r16613 - in branches/rel_1_6/Open-ILS: src/perlmods/OpenILS/Application src/sql/Pg web/opac/locale/en-US xul/staff_client/server/admin (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jun 7 11:17:43 EDT 2010


Author: senator
Date: 2010-06-07 11:17:41 -0400 (Mon, 07 Jun 2010)
New Revision: 16613

Modified:
   branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm
   branches/rel_1_6/Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql
   branches/rel_1_6/Open-ILS/src/sql/Pg/950.data.seed-values.sql
   branches/rel_1_6/Open-ILS/web/opac/locale/en-US/lang.dtd
   branches/rel_1_6/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
Log:
Booking: make check-in op-capture behave more reasonably when elbow_room is
zero, and give the OU setting for elbow_room a default value of 1 day since
that's probably a more reasonable value than zero anyway.

Also add a smidge of documentation explaining what elbow room is for.


Modified: branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm
===================================================================
--- branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm	2010-06-07 13:52:29 UTC (rev 16612)
+++ branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm	2010-06-07 15:17:41 UTC (rev 16613)
@@ -818,19 +818,27 @@
                 ) ||
                 "0 seconds"
             );
-            my $start_time = $dt_parser->parse_datetime(
-                clense_ISO8601($bresv->start_time)
-            );
 
-            if ($now >= $start_time->subtract("seconds" => $elbow_room)) {
+            unless ($elbow_room) {
                 $client->respond($bresv);
             } else {
-                $logger->info("not within elbow room: $elbow_room, else would have returned bresv " . $bresv->id);
+                my $start_time = $dt_parser->parse_datetime(
+                    clense_ISO8601($bresv->start_time)
+                );
+
+                if ($now >= $start_time->subtract("seconds" => $elbow_room)) {
+                    $client->respond($bresv);
+                } else {
+                    $logger->info(
+                        "not within elbow room: $elbow_room, " .
+                        "else would have returned bresv " . $bresv->id
+                    );
+                }
             }
         }
     }
     $e->disconnect;
-    $client->respond_complete;
+    undef;
 }
 __PACKAGE__->register_method(
     method   => "could_capture",

Modified: branches/rel_1_6/Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql
===================================================================
--- branches/rel_1_6/Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql	2010-06-07 13:52:29 UTC (rev 16612)
+++ branches/rel_1_6/Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql	2010-06-07 15:17:41 UTC (rev 16613)
@@ -716,6 +716,17 @@
 
 INSERT INTO config.copy_status (id,name) VALUES (15,oils_i18n_gettext(15, 'On reservation shelf', 'ccs', 'name'));
 
+-- In booking, elbow room defines:
+--  a) how far in the future you must make a reservation on a given item if
+--      that item will have to transit somewhere to fulfill the reservation.
+--  b) how soon a reservation must be starting for the reserved item to
+--      be op-captured by the checkin interface.
+INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES (
+    (SELECT id FROM actor.org_unit WHERE parent_ou IS NULL),
+    'circ.booking_reservation.default_elbow_room',
+    '"1 day"'
+);
+
 -- Put the sequence back inside the protected range
 SELECT SETVAL('permission.perm_list_id_seq'::TEXT, (SELECT MAX(id) FROM permission.perm_list WHERE id < 1000));
 

Modified: branches/rel_1_6/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- branches/rel_1_6/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-06-07 13:52:29 UTC (rev 16612)
+++ branches/rel_1_6/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2010-06-07 15:17:41 UTC (rev 16613)
@@ -130,6 +130,17 @@
 
 SELECT SETVAL('config.copy_status_id_seq'::TEXT, 100);
 
+-- In booking, elbow room defines:
+--  a) how far in the future you must make a reservation on a given item if
+--      that item will have to transit somewhere to fulfill the reservation.
+--  b) how soon a reservation must be starting for the reserved item to
+--      be op-captured by the checkin interface.
+INSERT INTO actor.org_unit_setting (org_unit, name, value) VALUES (
+    (SELECT id FROM actor.org_unit WHERE parent_ou IS NULL),
+    'circ.booking_reservation.default_elbow_room',
+    '"1 day"'
+);
+
 INSERT INTO config.net_access_level (id, name) VALUES 
     (1, oils_i18n_gettext(1, 'Filtered', 'cnal', 'name'));
 INSERT INTO config.net_access_level (id, name) VALUES 

Modified: branches/rel_1_6/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- branches/rel_1_6/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-06-07 13:52:29 UTC (rev 16612)
+++ branches/rel_1_6/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-06-07 15:17:41 UTC (rev 16613)
@@ -1661,6 +1661,8 @@
 <!ENTITY staff.server.admin.org_settings.circ.password_reset_request_per_user_limit.desc "When a user has more than this number of concurrently active self-serve password reset requests for their account, prevent the user from creating any new self-serve password reset requests until the number of active requests for the user drops back below this number.">
 <!ENTITY staff.server.admin.org_settings.circ.password_reset_request_throttle "Circulation: Maximum concurrently active self-serve password reset requests">
 <!ENTITY staff.server.admin.org_settings.circ.password_reset_request_throttle.desc "Prevent the creation of new self-serve password reset requests until the number of active requests drops back below this number.">
+<!ENTITY staff.server.admin.org_settings.circ.booking_reservation.default_elbow_room "Booking: Elbow room">
+<!ENTITY staff.server.admin.org_settings.circ.booking_reservation.default_elbow_room.desc "Booking: Elbow room specifies how far in the future you must make a reservation on an item if that item will have to transit to reach its pickup location.  It secondarily defines how soon a reservation on a given item must start before the check-in process will opportunistically capture it for the reservation shelf.">
 <!ENTITY staff.server.admin.org_settings.circ.charge_on_damaged "Charge item price when marked damaged">
 <!ENTITY staff.server.admin.org_settings.circ.charge_on_damaged.desc "Charge item price when marked damaged">
 <!ENTITY staff.server.admin.org_settings.circ.damaged_item_processing_fee "Charge processing fee for damaged items">

Modified: branches/rel_1_6/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
===================================================================
--- branches/rel_1_6/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml	2010-06-07 13:52:29 UTC (rev 16612)
+++ branches/rel_1_6/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml	2010-06-07 15:17:41 UTC (rev 16613)
@@ -157,6 +157,10 @@
                     desc: '&staff.server.admin.org_settings.circ.password_reset_request_throttle.desc;',
                     type : 'integer'
                 },
+                'circ.booking_reservation.default_elbow_room': {
+                    label: '&staff.server.admin.org_settings.circ.booking_reservation.default_elbow_room;',
+                    desc: '&staff.server.admin.org_settings.circ.booking_reservation.default_elbow_room.desc;'
+                },
                 'ui.circ.patron_summary.horizontal' : {
                     label : '&ui.circ.patron_summary.horizontal;',
                     desc : '&ui.circ.patron_summary.horizontal.desc;',



More information about the open-ils-commits mailing list