Bugzilla – Attachment 126796 Details for
Bug 29270
Use flatpickr and futuredate on reserve/request.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29270: Remove flatpickr instantiation from request.tt
Bug-29270-Remove-flatpickr-instantiation-from-requ.patch (text/plain), 4.34 KB, created by
Katrin Fischer
on 2021-10-24 10:17:08 UTC
(
hide
)
Description:
Bug 29270: Remove flatpickr instantiation from request.tt
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-10-24 10:17:08 UTC
Size:
4.34 KB
patch
obsolete
>From 18570f0972b49e43c4c848779523eada34c2e301 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 15 Oct 2021 09:49:19 +0200 >Subject: [PATCH] Bug 29270: Remove flatpickr instantiation from request.tt > >The JS code is only used when placing a hold for club BUT the date >inputs are not displayed there. > >Test plan: >Place holds for patrons and clubs and confirm that the two date inputs >are working correctly > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/reserve/request.tt | 33 ++-------------------- > 1 file changed, 2 insertions(+), 31 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 8e9bf1fd4f..a6d269f71f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -492,15 +492,13 @@ > [% IF ( reserve_in_future ) %] > <li> > <label for="from">Hold starts on date:</label> >- <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" > >- <input type="hidden" class="datepickerfrom_hidden" /> >+ <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-start_for="expiration_date" class="flatpickr futuredate" /> > </li> > [% END %] > > <li> > <label for="to">Hold expires on date:</label> >- <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" /> >- <input type="hidden" class="datepickerto_hidden" /> >+ <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" /> > </li> > > [% UNLESS ( multi_hold ) %] >@@ -1154,29 +1152,6 @@ > [% END %] > > >- var startPicker = $("#reserve_date").flatpickr({ >- minDate: new Date().fp_incr(1), /* Require that "Hold starts on date" be in the future */ >- onChange: function(selectedDates, dateStr, instance) { >- altFormat = instance.formatDate(selectedDates[0], "Y-m-d"); >- $(".datepickerfrom_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */ >- }, >- onClose: function( selectedDates, dateText, instance) { >- validate_date( selectedDates, instance ); >- endPicker.set('minDate', selectedDates[0]); >- } >- }); >- >- var endPicker = $("#expiration_date").flatpickr({ >- minDate: new Date().fp_incr(1), // Require that "Hold expires on date" be in the future >- onChange: function(selectedDates, dateStr, instance) { >- altFormat = instance.formatDate(selectedDates[0], "Y-m-d"); >- $(".datepickerto_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */ >- }, >- onClose: function( selectedDates, dateText, instance) { >- validate_date( selectedDates, instance ); >- }, >- }); >- > var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, { > 'bPaginate': false, > "sDom": '<"top pager"ilf>t', >@@ -1203,10 +1178,6 @@ > data.patron_id = $('input[name="borrowernumber"]').val(); > if($('textarea[name="notes"]').length) > data.notes = $('textarea[name="notes"]').val()||null; >- if($('.datepickerto_hidden').length) >- data.expiration_date = $('.datepickerto_hidden').val()||null; >- if($('.datepickerfrom_hidden').length) >- data.hold_date = $('.datepickerfrom_hidden').val()||null; > if($('input[name="itemtype"]').length) { > data.item_type = $('input[name="itemtype"]').val()||null; > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29270
:
126496
|
126680
| 126796 |
127706
|
127708