Bugzilla – Attachment 124632 Details for
Bug 28961
Use Flatpickr on tools pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28961: Use Flatpickr on tools pages
Bug-28961-Use-Flatpickr-on-tools-pages.patch (text/plain), 14.14 KB, created by
Lucas Gass (lukeg)
on 2021-09-07 20:10:05 UTC
(
hide
)
Description:
Bug 28961: Use Flatpickr on tools pages
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-09-07 20:10:05 UTC
Size:
14.14 KB
patch
obsolete
>From 065299ef4f8a8204d348140557076e8c6d7432be Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 7 Sep 2021 14:14:54 +0000 >Subject: [PATCH] Bug 28961: Use Flatpickr on tools pages > >This patch replaces the use of jQueryUI's datepicker on tools pages. > >To test, apply the patch and test the following tools pages to confirm >that datepickers work correctly. "Linked" date fields should prevent a >"to" selection which preceeds the selected "from" date. > > - News -> New entry: Linked fields "Published date" and "Expiration > date". > - Batch extend due dates: Linked fields "Due date from" and "Due date > to"; "Hard due date" field. > - Batch patron deletion: "who have not borrowed since," "whose > expiration date is before," and "Permanently delete checkout history > older than." > - Export: Linked "Start date" and "End date" fields. > - Import patrons -> Enter default values: "Date of birth," > "Registration date," and "Expiry date." > - Inventory: "Set inventory date to." > - Batch patron modification -> Submit a batch of cardnumbers or a > patron list: "Registration date," "Expiry date," and "Restriction > expiration." > - Task scheduler: "Date" field. > - Log viewer: "Display from" and "Display to" linked fields. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../prog/en/modules/tools/additional-contents.tt | 4 ++-- > .../prog/en/modules/tools/batch_extend_due_dates.tt | 6 +++--- > .../prog/en/modules/tools/cleanborrowers.tt | 8 ++++---- > .../intranet-tmpl/prog/en/modules/tools/export.tt | 4 ++-- > .../prog/en/modules/tools/import_borrowers.tt | 2 +- > .../prog/en/modules/tools/inventory.tt | 2 +- > .../prog/en/modules/tools/modborrowers.tt | 2 +- > .../prog/en/modules/tools/scheduler.tt | 13 +++++-------- > .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 4 ++-- > 9 files changed, 21 insertions(+), 24 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >index c693a68b2e..c419562522 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >@@ -199,12 +199,12 @@ > [% END %] > <li> > <label for="from">Publication date: </label> >- <input id="from" type="text" name="published_on" size="15" value="[% additional_content.published_on | html %]" class="datepickerfrom" /> >+ <input id="from" type="text" name="published_on" size="15" value="[% additional_content.published_on | html %]" class="flatpickrfrom" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > <li> > <label for="to">Expiration date: </label> >- <input id="to" type="text" name="expirationdate" size="15" value="[% additional_content.expirationdate | html %]" class="datepickerto" /> >+ <input id="to" type="text" name="expirationdate" size="15" value="[% additional_content.expirationdate | html %]" class="flatpickrto" /> > <div class="hint"> > [% INCLUDE 'date-format.inc' %] > [% IF category == 'news' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >index 66ba593bf6..1fed15f83a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >@@ -82,12 +82,12 @@ > > <li> > <label for="from_due_date">Due date from: </label> >- <input type="text" size="10" id="from" name="from_due_date" class="datepickerfrom" /> >+ <input type="text" size="10" id="from" name="from_due_date" class="flatpickrfrom" /> > </li> > > <li> > <label for="to_due_date">Due date to:</label> >- <input type="text" size="10" id="to" name="to_due_date" class="datepickerto" /> >+ <input type="text" size="10" id="to" name="to_due_date" class="flatpickrto" /> > </li> > </ol> > </fieldset> >@@ -96,7 +96,7 @@ > <ol> > <li> > <label for="new_hard_due_date">Hard due date: </label> >- <input type="text" size="10" id="new_hard_due_date" name="new_hard_due_date" class="datepicker" /> >+ <input type="text" size="10" id="new_hard_due_date" name="new_hard_due_date" class="flatpickr" /> > </li> > > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >index 9e5f7bcde8..05e70eb768 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >@@ -111,18 +111,18 @@ > <ul> > <li> > <label for="date1">who have not borrowed since:</label> >- <input size="10" id="date1" name="not_borrowed_since" type="text" class="datepicker" /> >+ <input size="10" id="date1" name="not_borrowed_since" type="text" class="flatpickr" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </li> > <li> > <label for="borrower_dateexpiry">whose expiration date is before:</label> >- <input size="10" id="borrower_dateexpiry" name="borrower_dateexpiry" type="text" class="datepicker" /> >+ <input size="10" id="borrower_dateexpiry" name="borrower_dateexpiry" type="text" class="flatpickr" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </li> > [% IF Koha.Preference('TrackLastPatronActivity') %] > <li> > <label for="borrower_lastseen">who have not been connected since:</label> >- <input size="10" id="borrower_lastseen" name="borrower_lastseen" type="text" class="datepicker" /> >+ <input size="10" id="borrower_lastseen" name="borrower_lastseen" type="text" class="flatpickr" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </li> > [% END %] >@@ -161,7 +161,7 @@ > <ul> > <li> > <label for="date2">Permanently delete checkout history older than</label> >- <input size="10" id="date2" name="last_issue_date" type="text" class="datepicker" /> >+ <input size="10" id="date2" name="last_issue_date" type="text" class="flatpickr" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </li> > </ul> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >index 04b7bc801c..fe5011bd9b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt >@@ -110,11 +110,11 @@ > <ol> > <li> > <label for="from">Start date:</label> >- <input type="text" size="10" id="from" name="start_accession" value="[% from | html %]" class="datepickerfrom" /> >+ <input type="text" size="10" id="from" name="start_accession" value="[% from | html %]" class="flatpickrfrom" /> > </li> > <li> > <label for="to">End date:</label> >- <input size="10" id="to" name="end_accession" value="[% end_accession | html %]" type="text" class="datepickerto" /> >+ <input size="10" id="to" name="end_accession" value="[% end_accession | html %]" type="text" class="flatpickrto" /> > </li> > </ol> > </fieldset> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >index 153ffd3a09..080762d8d0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >@@ -409,7 +409,7 @@ you can supply dates in ISO format (e.g., '2010-10-28'). > <script> > $(document).ready(function() { > [%# Make date fields have the datepicker %] >- $("#dateenrolled, #dateexpiry, #dateofbirth").datepicker(); >+ $("#dateenrolled, #dateexpiry, #dateofbirth").flatpickr(); > > $(".expand_defaults").click(function(e){ > e.preventDefault(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >index 8edc3739b4..0bb130d0c3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >@@ -84,7 +84,7 @@ > <fieldset class="rows"> > <legend>Parameters</legend> > <ol> >- <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepicker" disabled /></li> >+ <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="flatpickr" /></li> > <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li> > <li><label for="dont_checkin">Do not check in items scanned during inventory: </label><input type="checkbox" name="dont_checkin" id="dont_checkin" disabled /></li> > <li><label for="out_of_order">Check barcodes list for items shelved out of order: </label><input type="checkbox" name="out_of_order" id="out_of_order" disabled /></li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >index 4d22b3e529..d067e39624 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >@@ -351,7 +351,7 @@ > [% END %] > [% END %] > [% IF ( field.type == 'date' ) %] >- <input type="text" name="[% field.name | html %]" id="[% field.name | html %]" value="" size="10" maxlength="10" class="datepicker" /> >+ <input type="text" name="[% field.name | html %]" id="[% field.name | html %]" value="" size="10" maxlength="10" class="flatpickr" /> > <a href="#" class="clear-date" id="clear-date-[% field.name | html %]" ><i class="fa fa-fw fa-trash"></i> Clear</a> > [% END %] > [% IF field.mandatory %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt >index b9fe10e830..bf144309e2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt >@@ -44,9 +44,11 @@ > [% time | html %]</li> > <li><label for="starttime">Time:</label> > <input type="text" name="starttime" id="starttime" value="" maxlength="5" size="5" /></li> >-<li><label for="startdate">Date: </label> <input type="text" size="10" id="startdate" name="startdate" value="" /> >-<div class="hint">[% INCLUDE 'date-format.inc' %]</div> >-</li> >+ <li> >+ <label for="startdate">Date: </label> >+ <input type="text" size="10" id="startdate" name="startdate" class="flatpickr futuredate" value="" /> >+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ </li> > <li><label for="report">Report:</label> > <select name="report" id="report"> > [% FOREACH savedreport IN savedreports %] >@@ -109,11 +111,6 @@ > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/tools-menu.js") | $raw %] > [% INCLUDE 'calendar.inc' %] >- <script> >- $(document).ready(function(){ >- $("#startdate").datepicker({ minDate: "+0D" }); >- }); >- </script> > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >index 3b0886d369..94be8a7976 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -262,11 +262,11 @@ > [% END %] > </li> > <li> >- <label for="from"> Display from: </label> <input type="text" size="10" id="from" name="from" value="[% datefrom | html %]" class="datepickerfrom" /> >+ <label for="from"> Display from: </label> <input type="text" size="10" id="from" name="from" value="[% datefrom | html %]" class="flatpickrfrom" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > <li> >- <label for="to">Display to: </label> <input size="10" id="to" name="to" type="text" value="[% dateto | html %]" class="datepickerto" /> >+ <label for="to">Display to: </label> <input size="10" id="to" name="to" type="text" value="[% dateto | html %]" class="flatpickrto" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > </ol> >-- >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 28961
:
124618
|
124632
|
125496