From: senator Date: Mon, 7 Jun 2010 15:17:41 +0000 (+0000) Subject: Booking: make check-in op-capture behave more reasonably when elbow_room is X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d5bc8b221ff6e4466c9c0c5802c66aecccceb586;p=Evergreen.git 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. git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@16613 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm b/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm index ae9e8ab3d9..97a1941091 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Booking.pm @@ -818,19 +818,27 @@ sub could_capture { ) || "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", diff --git a/Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql b/Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql index 79fa01596b..ae9b72a7e4 100644 --- a/Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql +++ b/Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql @@ -716,6 +716,17 @@ COMMIT; 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)); 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 7bef05026a..862123928d 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -130,6 +130,17 @@ INSERT INTO config.copy_status (id,name) VALUES (15,oils_i18n_gettext(15, 'On re 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 diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 6d6fa83bd0..22ae2501ae 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1661,6 +1661,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml index c5bbe0e2eb..46fd0e4b12 100644 --- a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml @@ -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;',