Bug 19259: Enforce type of the delay value when editing overdue rules - template...
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 27 Sep 2017 16:07:59 +0000 (13:07 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Oct 2017 15:40:31 +0000 (12:40 -0300)
Overdue rules do not save when a delay that is not an integer > 0,
without any warnings.
This patch forces the user to select a number > 0.

Test plan:
Without this patch applied, enter non-integer value or negative or 0
=> The rule will not be inserted without any warnings.
With this patch applied you will get an message from the browser and the
form will not save

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt

index c780f30..bb6e824 100644 (file)
@@ -112,7 +112,7 @@ $(document).ready(function() {
             <tr>
               <th scope="row">[% value.line %]</th>
               <td>
-              <input type="text" name="delay[% tab.number %]-[% value.overduename %]" size="5" value="[% value.delay %]" />
+              <input type="number" min="1" name="delay[% tab.number %]-[% value.overduename %]" value="[% value.delay %]" />
               </td>
               <td>
                 <select name="letter[% tab.number %]-[% value.overduename %]">