LP1903594 Bootstrap opac: suspend hold not working
authorGarry Collum <gcollum@gmail.com>
Wed, 11 Nov 2020 16:03:00 +0000 (11:03 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 8 Feb 2021 15:51:52 +0000 (10:51 -0500)
Fixes hold suspension at the time of the hold placement in the Bootstrap opac.
And fixes the date picker validation for the activation date.

To test.
As a patron, place a hold in the Bootstrap Opac.
At the time of placement select "Suspend this hold?" and set an activation date.
In the staff client, notice that neither the suspension or activation date has been saved.

Apply the patch.
Repeat the above steps and check for the suspension and activation date.
Place another hold with a activation date in the past.  This should fail.
Place a hold without "Suspend this hold" checked.
Place a hold with "Suspend this hold" checked, but without an activation date.

Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2

index a0387bc..652a0a1 100755 (executable)
@@ -256,7 +256,7 @@ function maybeToggleNumCopies(obj) {
 
              [% IF ctx.hold_data.size > 0; %]
             <div class="form-check m-2">
-                <input class="form-check-input" type="checkbox" value="" id="hold_suspend">
+                <input class="form-check-input" type="checkbox" value="t" id="hold_suspend" name="hold_suspend">
                 <label class="form-check-label" for="hold_suspend">
                 [% IF ctx.hold_data.size == 1;
                     l('Suspend this hold?');
@@ -278,7 +278,7 @@ function maybeToggleNumCopies(obj) {
             <blockquote id="toggled-block-suspend">
             <label for="thaw_date">[% l('Activate on') %]
               <div class="input-group date" data-provide="datepicker">
-                <input type="text" class="form-control" name="thaw_date" id="datepicker" value="[% thaw_date | html %]" data-date-format="mm/dd/yyyy" />
+                <input type="text" class="form-control" name="thaw_date" id="thaw_date" value="[% thaw_date | html %]" data-date-format="mm/dd/yyyy" />
                 <div class="input-group-addon">
                     <span class="glyphicon glyphicon-th"></span>
                 </div>