From f1b97cbb871a6fb3ec7e8dd8658a27e5218ca8cd Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 27 Jul 2020 14:10:14 -0400 Subject: [PATCH] LP#1879983: Create and protect a floor on appt granularity If bare numbers are entered, they are interpreted as a number of seconds. The most likely intent is minutes, so we force that unit. Additionally, this commit sets a hard floor of 10 minutes on appointment granularity. Signed-off-by: Mike Rylander Signed-off-by: Michele Morgan Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm index a98a66f6b6..7cc57f5fd1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm @@ -518,7 +518,10 @@ sub times_for_date { return $conn->respond_complete unless ($start_obj); my $gran = $U->ou_ancestor_setting_value($org, 'circ.curbside.granularity') || '15 minutes'; + $gran .= ' minutes' if ($gran =~ /^\s*\d+\s*$/); # Assume minutes for bare numbers (maybe surrounded by spaces) + my $gran_seconds = interval_to_seconds($gran); + $gran_seconds = 600 if ($gran_seconds < 600); # No smaller than 10 minute intervals my $max = $U->ou_ancestor_setting_value($org, 'circ.curbside.max_concurrent') || 10; -- 2.11.0