Bugzilla – Attachment 128765 Details for
Bug 29735
Remove flatpickr instantiations from .js files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29735: Remove flatpickr init from categories.js and holds.js
Bug-29735-Remove-flatpickr-init-from-categoriesjs-.patch (text/plain), 5.66 KB, created by
David Nind
on 2021-12-20 16:52:36 UTC
(
hide
)
Description:
Bug 29735: Remove flatpickr init from categories.js and holds.js
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-12-20 16:52:36 UTC
Size:
5.66 KB
patch
obsolete
>From 1c3a5efe7b5a67d520b0b86cc9ce4b11c404fa17 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 20 Dec 2021 12:02:45 +0100 >Subject: [PATCH] Bug 29735: Remove flatpickr init from categories.js and > holds.js > >Same as bug 29394, we want the flatpickr instanciations be done at the >same place, from calendar.inc. That way they will all behave >identically. > >Test plan: >Edit a patron category and confirm that the "until date" calendar has >the "yesterday" and "today" dates disabled > >Place a hold on an item, go to the patron detail page, click the "holds" >tab, suspend. >That should trigger a modal that will display a calendar with >"yesterday" and "today" dates disabled > >Signed-off-by: David Nind <david@davidnind.com> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt | 2 +- > .../intranet-tmpl/prog/en/modules/members/moremember.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/categories.js | 4 ---- > koha-tmpl/intranet-tmpl/prog/js/holds.js | 5 +---- > 5 files changed, 4 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >index 9b1d6bfa2a..a5e5b8e85f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >@@ -157,7 +157,7 @@ > </li> > <li> > <label for="enrolmentperioddate">Until date: </label> >- <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> >+ <input type="text" class="enrollmentperiod flatpickr" data-flatpickr-futuredate="true" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" /> > </li> > </ol> > </fieldset> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index f456dff8f9..7bbd76cde4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -857,7 +857,6 @@ > [% INCLUDE 'datatables.inc' %] > [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] > [% INCLUDE 'columns_settings.inc' %] >- [% INCLUDE 'calendar.inc' %] > [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %] > [% INCLUDE 'timepicker.inc' %] > [% INCLUDE 'select2.inc' %] >@@ -887,6 +886,7 @@ > [% Asset.js("js/pages/circulation.js") | $raw %] > [% Asset.js("js/checkouts.js") | $raw %] > [% Asset.js("js/holds.js") | $raw %] >+ [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] > <script> >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 442c4895eb..7d89d9f524 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1130,12 +1130,12 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >- [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'columns_settings.inc' %] > [% Asset.js("lib/hc-sticky.js") | $raw %] > [% Asset.js("js/circ-patron-search-results.js") | $raw %] > [% INCLUDE 'select2.inc' %] > [% Asset.js("js/holds.js") | $raw%] >+ [% INCLUDE 'calendar.inc' %] > <script> > var Sticky; > var biblionumber = "[% biblionumber | $raw %]"; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/categories.js b/koha-tmpl/intranet-tmpl/prog/js/categories.js >index 3ef44c3341..c3c1c85a47 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/categories.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/categories.js >@@ -38,10 +38,6 @@ $(document).ready(function() { > "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12], > }, columns_settings); > >- $("#enrolmentperioddate").flatpickr({ >- minDate: new Date().fp_incr(1) >- }); >- > if ($("#branches option:selected").length < 1) { > $("#branches option:first").attr("selected", "selected"); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index 5570716f52..291e17d22a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -384,7 +384,7 @@ $(document).ready(function() { > <input type='hidden' id='suspend-modal-reserve_id' name='reserve_id' />\ > \ > <label for='suspend-modal-until'>" + __("Suspend until:") + "</label>\ >- <input name='suspend_until' id='suspend-modal-until' class='suspend-until' size='10' />\ >+ <input name='suspend_until' id='suspend-modal-until' class='suspend-until flatpickr' data-flatpickr-futuredate='true' size='10' />\ > \ > <p><a class='btn btn-link' id='suspend-modal-clear-date' >" + __("Clear date to suspend indefinitely") + "</a></p>\ > \ >@@ -400,9 +400,6 @@ $(document).ready(function() { > </div>\ > "); > >- $("#suspend-modal-until").flatpickr({ >- minDate: new Date().fp_incr(1) // Require that "until date" be in the future >- }); > $("#suspend-modal-clear-date").on( "click", function() { $("#suspend-modal-until").val(""); } ); > > $("#suspend-modal-submit").on( "click", function( e ) { >-- >2.20.1
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 29735
:
128733
|
128765
|
128805
|
129684