Bug 22922: Use jQuery datepicker instead of <input type="date">
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 17 May 2019 14:06:41 +0000 (16:06 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 21 Oct 2019 09:01:01 +0000 (10:01 +0100)
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
reserve/modrequest.pl

index 8b0a174..5a2ef15 100644 (file)
             <td>[% hold.notes | html %]</td>
             <td>
                 [% IF Koha.Preference('AllowHoldDateInFuture') %]
-                    <input type="date" value="[% hold.date | html %]" required name="reservedate">
+                    <input type="text" class="datepicker" value="[% hold.date | $KohaDates %]" required name="reservedate">
                 [% ELSE %]
                     [% hold.date | $KohaDates %]
                 [% END %]
             </td>
-            <td><input type="date" value="[% hold.expirationdate | html %]" name="expirationdate"></td>
+            <td><input type="text" class="datepicker" value="[% hold.expirationdate | $KohaDates %]" name="expirationdate"></td>
 
             <td>
                 [% IF ( hold.found ) %]
index 04c1b7d..e75fac7 100755 (executable)
@@ -27,6 +27,7 @@ use CGI qw ( -utf8 );
 use C4::Output;
 use C4::Reserves;
 use C4::Auth;
+use Koha::DateUtils qw( dt_from_string );
 
 my $query = new CGI;
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
@@ -72,13 +73,13 @@ else {
         my $params = {
             rank => $rank[$i],
             reserve_id => $reserve_id[$i],
-            expirationdate => $expirationdates[$i],
+            expirationdate => $expirationdates[$i] ? dt_from_string($expirationdates[$i]) : undef,
             branchcode => $branch[$i],
             itemnumber => $itemnumber[$i],
             suspend_until => $suspend_until[$i]
         };
         if (C4::Context->preference('AllowHoldDateInFuture')) {
-            $params->{reservedate} = $reservedates[$i];
+            $params->{reservedate} = $reservedates[$i] ? dt_from_string($reservedates[$i]) : undef;
         }
 
         ModReserve($params);