Bugzilla – Attachment 124658 Details for
Bug 28949
Use Flatpickr on reports pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28949: Use Flatpickr on reports pages
Bug-28949-Use-Flatpickr-on-reports-pages.patch (text/plain), 47.45 KB, created by
Owen Leonard
on 2021-09-08 13:45:38 UTC
(
hide
)
Description:
Bug 28949: Use Flatpickr on reports pages
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-09-08 13:45:38 UTC
Size:
47.45 KB
patch
obsolete
>From a55b3c5eb857a10dc9420ba0c3cea27edac52e32 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 3 Sep 2021 17:27:00 +0000 >Subject: [PATCH] Bug 28949: Use Flatpickr on reports pages > >This patch replaces the use of jQueryUI's datepicker on reports pages. > >To test, apply the patch and test the following reports pages to confirm >that datepickers work correctly. "Linked" date fields should prevent a >"to" selection which preceeds the selected "from" date. > >- Acquisitions statistic wizard: Linked pairs of fields for > "placed on" and "received on." >- Patrons with the most checkouts: Linked pairs of fields for > "Checkout date from" and "Check-in date from" >- Patrons who haven't checked out: "Not checked out since" > field. >- Cash register statistics wizard: Linked "From" and "To" > fields. >- Most-circulated items: Linked pairs of fields for > "Checkout date from" and "Check-in date from" >- Catalog statistics wizard: Linked pairs of fields for "Date acquired > (item)" and "Date deleted (item)" The latter is shown by checking the > "Count deleted items" radio button. >- View dictionary -> New definition: > - Enter a definition name > - Select table Circulation > - Choose a date column, e.g. "Date of birth" or "Registration date" > - Select "Date range" > - Test that the "Start of date range" and "End of date range" fields > are linked correctly. >- Create guided report: > - Module: catalog > - Type: Tabular > - Select columns (any) > - Select criteria to limit on: There should be three pairs of linked > fields, "Creation date," "Modification date," and "Due date." > - Confirm that the report is saved correctly with the dates you chose. >- Create from SQL -> Test a report with one or more date > fields, e.g. https://wiki.koha-community.org/wiki/SQL_Reports_Library#Items_added_by_Collection >- Average loan time: Linke pairs of fields for "Checkout > date" and "Returns." >- Reports -> Circulation statistics wizard: Linked "Period" fields. >- Reports -> Holds statistics wizard: Linked pairs of fields "Hold > date," "Notification date," "Reminder date," "Waiting date," and > "Cancellation date." >--- > .../prog/en/includes/calendar.inc | 3 + > .../en/modules/reports/acquisitions_stats.tt | 64 ++++---- > .../prog/en/modules/reports/bor_issues_top.tt | 63 ++++---- > .../prog/en/modules/reports/borrowers_out.tt | 7 +- > .../en/modules/reports/cash_register_stats.tt | 4 +- > .../prog/en/modules/reports/cat_issues_top.tt | 62 +++---- > .../en/modules/reports/catalogue_stats.tt | 42 +++-- > .../prog/en/modules/reports/dictionary.tt | 4 +- > .../modules/reports/guided_reports_start.tt | 27 +++- > .../en/modules/reports/issues_avg_stats.tt | 56 +++---- > .../prog/en/modules/reports/issues_stats.tt | 11 +- > .../prog/en/modules/reports/reserves_stats.tt | 152 +++++++++--------- > 12 files changed, 272 insertions(+), 223 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index bdb793ca67..e7d3bcd644 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -34,6 +34,9 @@ > if( $(instance.input).hasClass("futuredate") ){ > instance.set("minDate", new Date().fp_incr(1)); > } >+ if( $(instance.input).hasClass("pastdate") ){ >+ instance.set("maxDate", new Date().fp_incr(-1)); >+ } > $(instance.input) > /* Add a wrapper element so that we can prevent the clear button from wrapping */ > .wrap("<span class='flatpickr_wrapper'></span>") >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt >index af06dc3e35..2f9dee8e43 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt >@@ -119,11 +119,12 @@ > <td>Placed on</td> > <td><input type="radio" name="Line" value="aqbasket.closedate" /></td> > <td><input type="radio" checked="checked" name="Column" value="aqbasket.closedate" /> </td> >- <td> From <input type="text" size="10" id="from" name="Filter" value="" /> >- <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >- To <input size="10" id="to" name="Filter" type="text" value="" /> >- <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >- </td> >+ <td> >+ From <input type="text" size="10" id="placedonfrom" name="Filter" value="" /> >+ <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >+ To <input size="10" id="placedonto" name="Filter" type="text" value="" /> >+ <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >+ </td> > </tr> > <tr class="hilighted"> > <td> </td> >@@ -141,11 +142,12 @@ > <td>Received on</td> > <td><input type="radio" name="Line" value="aqorders.datereceived" /></td> > <td><input type="radio" name="Column" value="aqorders.datereceived" /></td> >- <td> From <input type="text" size="10" id="fromRO" name="Filter" value="" /> >- <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >- To <input type="text" size="10" id="toRO" name="Filter" value="" /> >- <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >- </td> >+ <td> >+ From <input type="text" size="10" id="receivedonfrom" name="Filter" value="" /> >+ <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >+ To <input type="text" size="10" id="receivedonto" name="Filter" value="" /> >+ <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >+ </td> > </tr> > <tr> > <td> </td> >@@ -339,33 +341,29 @@ > [% INCLUDE 'calendar.inc' %] > <script> > $(document).ready(function() { >- // http://jqueryui.com/demos/datepicker/#date-range >- var dates = $( "#from, #to" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "from" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- dates.not( this ).datepicker( "option", option, date ); >+ var placedonfrom = $("#placedonfrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ placedonto.set('minDate', selectedDates[0]); > } > }); >- var datesRO = $( "#fromRO, #toRO" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "fromRO" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- datesRO.not( this ).datepicker( "option", option, date ); >+ var placedonto = $("#placedonto").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ >+ var receivedonfrom = $("#receivedonfrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ receivedonto.set('minDate', selectedDates[0]); > } > }); >+ var receivedonto = $("#receivedonto").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt >index 502ac75124..2d819f6262 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt >@@ -117,12 +117,21 @@ > <h1>Patrons with the most checkouts</h1> > <form method="post" action="/cgi-bin/koha/reports/bor_issues_top.pl"> > <fieldset class="rows"> >- <ol><li><label for="from">Checkout date from:</label> <input type="text" readonly="readonly" size="10" id="from" name="Filter" /> >- <label class="inline" for="to">To: </label> <input readonly="readonly" size="10" id="to" name="Filter" value="" type="text" /> >- <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li> >- <li> <label for="fromRO">Check-in date from:</label> <input type="text" readonly="readonly" size="10" id="fromRO" name="Filter" /> >- <label class="inline" for="toRO">To: </label> <input type="text" readonly="readonly" size="10" id="toRO" name="Filter" value="" /> >- <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li> >+ <ol> >+ <li> >+ <label for="checkoutfrom">Checkout date from:</label> >+ <input type="text" size="10" id="checkoutfrom" name="Filter" /> >+ <label class="inline" for="checkoutto">To: </label> >+ <input size="10" id="checkoutto" name="Filter" value="" type="text" /> >+ <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >+ </li> >+ <li> >+ <label for="checkinfrom">Check-in date from:</label> >+ <input type="text" size="10" id="checkinfrom" name="Filter" /> >+ <label class="inline" for="checkinto">To: </label> >+ <input type="text" size="10" id="checkinto" name="Filter" value="" /> >+ <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >+ </li> > <li> > <label for="branch">Library: </label> > <select name="Filter" id="branch"><option value="" > Any library</option> >@@ -220,33 +229,29 @@ > [% INCLUDE 'calendar.inc' %] > <script> > $(document).ready(function() { >- // http://jqueryui.com/demos/datepicker/#date-range >- var dates = $( "#from, #to" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "from" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- dates.not( this ).datepicker( "option", option, date ); >+ var checkoutfrom = $("#checkoutfrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ checkoutto.set('minDate', selectedDates[0]); > } > }); >- var datesRO = $( "#fromRO, #toRO" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "fromRO" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- datesRO.not( this ).datepicker( "option", option, date ); >+ var checkoutto = $("#checkoutto").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ >+ var checkinfrom = $("#checkinfrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ checkinto.set('minDate', selectedDates[0]); > } > }); >+ var checkinto = $("#checkinto").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt >index c54a95118b..f32f1f3ba4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt >@@ -68,7 +68,7 @@ > [% END %] > </select> > </li> >- <li><label for="to">Not checked out since: </label> <input size="10" id="to" name="Filter" value="" type="text" /> >+ <li><label for="to">Not checked out since: </label> <input size="10" id="to" class="flatpickr pastdate" name="Filter" value="" type="text" /> > </li> > </ol> > </fieldset> >@@ -143,11 +143,6 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'calendar.inc' %] >- <script> >- $(document).ready(function(){ >- $("#to").datepicker({ maxDate: "-1D" }); >- }); >- </script> > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt >index 4ec821bc6d..d442c6981f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt >@@ -58,12 +58,12 @@ > <br> > <li> > <label for="from">From: </label> >- <input type="text" size="10" id="from" name="from" value="[% beginDate | $KohaDates %]" class="datepickerfrom" /> >+ <input type="text" size="10" id="from" name="from" value="[% beginDate | $KohaDates %]" class="flatpickrfrom" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > <li> > <label for="to">To: </label> >- <input type="text" size="10" id="to" name="to" value="[% endDate | $KohaDates %]" class="datepickerto" /> >+ <input type="text" size="10" id="to" name="to" value="[% endDate | $KohaDates %]" class="flatpickrto" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt >index ecd1d44026..7d4aa27b51 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt >@@ -95,12 +95,20 @@ > <form method="post" action="/cgi-bin/koha/reports/cat_issues_top.pl"> > <fieldset class="rows"> > <ol> >- <li><label for="from">Checkout date from: </label> <input type="text" size="10" id="from" name="Filter" /> >- <label for="to" class="inline">To:</label> <input size="10" id="to" name="Filter" value="" type="text" /> >- <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li> >- <li><label for="fromRO">Check-in date from</label> <input type="text" size="10" id="fromRO" name="Filter" /> >- <label for="toRO" class="inline">To: </label> <input type="text" size="10" id="toRO" name="Filter" value="" /> >- <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li> >+ <li> >+ <label for="checkoutfrom">Checkout date from: </label> >+ <input type="text" size="10" id="checkoutfrom" name="Filter" /> >+ <label for="checkoutto" class="inline">To:</label> >+ <input size="10" id="checkoutto" name="Filter" value="" type="text" /> >+ <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >+ </li> >+ <li> >+ <label for="checkinfrom">Check-in date from</label> >+ <input type="text" size="10" id="checkinfrom" name="Filter" /> >+ <label for="checkinto" class="inline">To: </label> >+ <input type="text" size="10" id="checkinto" name="Filter" value="" /> >+ <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >+ </li> > <li> > <label for="branch">Library: </label> > <select name="Filter" id="branch"><option value="" > Any library</option> >@@ -220,33 +228,29 @@ > <script> > [% UNLESS ( do_it ) %] > $(document).ready(function() { >- // http://jqueryui.com/demos/datepicker/#date-range >- var dates = $( "#from, #to" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "from" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- dates.not( this ).datepicker( "option", option, date ); >+ var checkoutfrom = $("#checkoutfrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ checkoutto.set('minDate', selectedDates[0]); > } > }); >- var datesRO = $( "#fromRO, #toRO" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "fromRO" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- datesRO.not( this ).datepicker( "option", option, date ); >+ var checkoutto = $("#checkoutto").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ >+ var checkinfrom = $("#checkinfrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ checkinto.set('minDate', selectedDates[0]); > } > }); >+ var checkinto = $("#checkinto").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); > }); > [% END %] > </script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt >index 6d0b879213..effe64e508 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt >@@ -252,9 +252,9 @@ > <td><input type="radio" name="Column" value="items.dateaccessioned" /></td> > <td> > <label for="acqdateFrom">From</label> >- <input type="text" name="Filter" id="acqdateFrom" class="datepicker" /> >+ <input type="text" name="Filter" id="acqdateFrom" /> > <label for="acqdateTo">To</label> >- <input type="text" name="Filter" id="acqdateTo" class="datepicker" /> >+ <input type="text" name="Filter" id="acqdateTo" /> > </td> > </tr> > <tr id="removeddatetr"> >@@ -263,9 +263,9 @@ > <td><input type="radio" name="Column" value="deleteditems.timestamp" /></td> > <td> > <label for="deldateFrom">From</label> >- <input type="text" name="Filter" id="deldateFrom" class="datepicker" /> >+ <input type="text" name="Filter" id="deldateFrom" /> > <label for="deldateTo">To</label> >- <input type="text" name="Filter" id="deldateTo" class="datepicker"/> >+ <input type="text" name="Filter" id="deldateTo" /> > </td> > </tr> > </tbody> >@@ -353,16 +353,30 @@ > } > > $(document).ready(function() { >- $('#acqdateFrom, #deldateFrom') >- .datepicker('option', 'onSelect', function(selectedDate) { >- var id = $(this).attr('id').replace('From', 'To'); >- $('#' + id).datepicker('option', 'minDate', selectedDate); >- }); >- $('#acqdateTo, #deldateTo') >- .datepicker('option', 'onSelect', function(selectedDate) { >- var id = $(this).attr('id').replace('To', 'From'); >- $('#' + id).datepicker('option', 'maxDate', selectedDate); >- }); >+ >+ var acqdateFrom = $("#acqdateFrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ acqdateTo.set('minDate', selectedDates[0]); >+ } >+ }); >+ var acqdateTo = $("#acqdateTo").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ >+ var deldateFrom = $("#deldateFrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ deldateTo.set('minDate', selectedDates[0]); >+ } >+ }); >+ var deldateTo = $("#deldateTo").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); > > $("input[name='Cellvalue']").change(function() { > changeRemovedDateTrStatus(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt >index 30e83f8f6b..fd1bd3e223 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/dictionary.tt >@@ -259,10 +259,10 @@ > </li> > <li class="radio"> > Start of date range >- <input type="text" size="10" id="from" name="[% column.name | html %]_start_value" value="" class="datepickerfrom" /> >+ <input type="text" size="10" id="from" name="[% column.name | html %]_start_value" value="" class="flatpickrfrom" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > End of date range >- <input type="text" size="10" id="to" name="[% column.name | html %]_end_value" value="" class="datepickerto" /> >+ <input type="text" size="10" id="to" name="[% column.name | html %]_end_value" value="" class="flatpickrto" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index 4afd8b7179..3b197dd6f8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -603,7 +603,7 @@ > </td> > [% IF ( criteri.date ) %] > <td> >- <input type="text" size="10" id="[% criteri.name | html %]_value" name="[% criteri.name | html %]_value" value="" class="datepicker" /> >+ <input type="text" size="10" id="[% criteri.name | html %]_value" name="[% criteri.name | html %]_value" value="" class="flatpickr" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </td> > </tr> >@@ -619,9 +619,9 @@ > [% IF ( criteri.daterange ) %] > <td> > from >- <input type="text" size="10" id="from_[% criteri.name | html %]_value" name="from_[% criteri.name | html %]_value" value="" class="datepickerfrom" /> >+ <input type="text" size="10" id="from_[% criteri.name.remove('\.') | html %]_value" name="from_[% criteri.name | html %]_value" value="" /> > to >- <input type="text" size="10" id="to_[% criteri.name | html %]_value" name="to_[% criteri.name | html %]_value" value="" class="datepickerto" /> >+ <input type="text" size="10" id="to_[% criteri.name.remove('\.') | html %]_value" name="to_[% criteri.name | html %]_value" value="" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </td> > </tr> >@@ -858,7 +858,7 @@ > <input name="param_name" value="[% sql_param.name | html %]" type="hidden" /> > [% IF sql_param.input == 'date' %] > <li> >- <label for="date_[% sql_param_entry | html %][% loop.count | html %]">[% sql_param.entry | html %]:</label> <input id="date_[% sql_param_entry | html %][% loop.count | html %]" type="text" value="" size="10" name="sql_params" class="datepicker" /> >+ <label for="date_[% sql_param_entry | html %][% loop.count | html %]">[% sql_param.entry | html %]:</label> <input id="date_[% sql_param_entry | html %][% loop.count | html %]" type="text" value="" size="10" name="sql_params" class="flatpickr" /> > </li> > [% ELSIF ( sql_param.input == 'text' ) %] > <li> >@@ -1320,7 +1320,7 @@ > <ol> > <li> > <label for="filter_date">Date:</label> >- <input type="text" id="filter_date" name="filter_date" size="10" value="[% filters.date | html %]" class="datepicker" /> >+ <input type="text" id="filter_date" name="filter_date" size="10" value="[% filters.date | html %]" class="flatpickr" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > <li> >@@ -2189,6 +2189,23 @@ > readOnly: true > }); > } >+ [% IF ( build4 ) %] >+ [% FOREACH criteri IN criteria %] >+ [% IF ( criteri.daterange ) %] >+ var from_[% criteri.name.remove('\.') | html %]_value = $("#from_[% criteri.name.remove('\.') | html %]_value").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ to_[% criteri.name.remove('\.') | html %]_value.set('minDate', selectedDates[0]); >+ } >+ }); >+ var to_[% criteri.name.remove('\.') | html %]_value = $("#to_[% criteri.name.remove('\.') | html %]_value").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ [% END %] >+ [% END %] >+ [% END %] > </script> > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt >index f976f1cffe..47138b735d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt >@@ -103,8 +103,11 @@ > <td>Checkout date</td> > <td><input type="radio" name="Line" value="timestamp" /></td> > <td><input type="radio" checked="checked" name="Column" value="timestamp" /></td> >- <td > <label for="from">From</label> <input type="text" size="10" id="from" name="Filter" /> >- <label for="to">To</label> <input size="10" id="to" name="Filter" value="" type="text" /> >+ <td> >+ <label for="checkoutfrom">From</label> >+ <input type="text" size="10" id="checkoutfrom" name="Filter" /> >+ <label for="checkouto">To</label> >+ <input size="10" id="checkouto" name="Filter" value="" type="text" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </td> > </tr> >@@ -124,8 +127,11 @@ > <td>Returns</td> > <td><input type="radio" name="Line" value="returndate" /></td> > <td><input type="radio" name="Column" value="returndate" /></td> >- <td > <label for="fromRO">From</label> <input type="text" size="10" id="fromRO" name="Filter" /> >- <label for="toRO">To</label> <input type="text" size="10" id="toRO" name="Filter" value="" /> >+ <td> >+ <label for="checkinfrom">From</label> >+ <input type="text" size="10" id="checkinfrom" name="Filter" /> >+ <label for="checkinto">To</label> >+ <input type="text" size="10" id="checkinto" name="Filter" value="" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </td> > </tr> >@@ -262,33 +268,29 @@ > [% INCLUDE 'calendar.inc' %] > <script> > $(document).ready(function() { >- // http://jqueryui.com/demos/datepicker/#date-range >- var dates = $( "#from, #to" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "from" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- dates.not( this ).datepicker( "option", option, date ); >+ var checkoutfrom = $("#checkoutfrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ checkouto.set('minDate', selectedDates[0]); > } > }); >- var datesRO = $( "#fromRO, #toRO" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "fromRO" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- datesRO.not( this ).datepicker( "option", option, date ); >+ var checkouto = $("#checkouto").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ >+ var checkinfrom = $("#checkinfrom").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ checkinto.set('minDate', selectedDates[0]); > } > }); >+ var checkinto = $("#checkinto").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt >index ddf42c2bec..97e1f0f76c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt >@@ -126,11 +126,14 @@ > <td>Period</td> > <td><input type="radio" name="Line" value="datetime" /></td> > <td><input type="radio" name="Column" value="datetime" /></td> >- <td><label for="from">From</label> <input type="text" size="10" id="from" name="Filter" class="datepickerfrom" /> >- <label for="to">To</label> <input size="10" id="to" name="Filter" value="" type="text" class="datepickerto" /> >+ <td> >+ <label for="from">From</label> >+ <input type="text" size="10" id="from" name="Filter" class="flatpickrfrom" /> >+ <label for="to">To</label> >+ <input size="10" id="to" name="Filter" value="" type="text" class="flatpickrto" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >- </td> >- </tr> >+ </td> >+ </tr> > <tr> > <td><label for="PeriodTypeSel">Type:</label><select name="PeriodTypeSel" id="PeriodTypeSel"> > <option value ="issue">Checkout</option> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt >index dabfe169ea..4db7612a5d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt >@@ -123,41 +123,56 @@ > <td>Hold date</td> > <td><input type="radio" name="Line" value="reservedate" /></td> > <td><input type="radio" name="Column" value="reservedate" /></td> >- <td><label for="filter_reservedate_begin">From</label> <input type="text" size="10" id="filter_reservedate_begin" name="filter_reservedate_begin" /> >- <label for="filter_reservedate_end">To</label> <input size="10" id="filter_reservedate_end" name="filter_reservedate_end" value="" type="text" /> >- </td> >- </tr> >+ <td> >+ <label for="filter_reservedate_begin">From</label> >+ <input type="text" size="10" id="filter_reservedate_begin" name="filter_reservedate_begin" /> >+ <label for="filter_reservedate_end">To</label> >+ <input size="10" id="filter_reservedate_end" name="filter_reservedate_end" value="" type="text" /> >+ </td> >+ </tr> > <tr> > <td>Notification date</td> > <td><input type="radio" name="Line" value="notificationdate" /></td> > <td><input type="radio" name="Column" value="notificationdate" /></td> >- <td><label for="filter_notificationdate_begin">From</label> <input type="text" size="10" id="filter_notificationdate_begin" name="filter_notificationdate_begin" /> >- <label for="filter_notificationdate_end">To</label> <input size="10" id="filter_notificationdate_end" name="filter_notificationdate_end" value="" type="text" /> >- </td> >+ <td> >+ <label for="filter_notificationdate_begin">From</label> >+ <input type="text" size="10" id="filter_notificationdate_begin" name="filter_notificationdate_begin" /> >+ <label for="filter_notificationdate_end">To</label> >+ <input size="10" id="filter_notificationdate_end" name="filter_notificationdate_end" value="" type="text" /> >+ </td> > </tr> > <tr> > <td>Reminder date</td> > <td><input type="radio" name="Line" value="reminderdate" /></td> > <td><input type="radio" name="Column" value="reminderdate" /></td> >- <td><label for="filter_reminderdate_begin">From</label> <input type="text" size="10" id="filter_reminderdate_begin" name="Filter" /> >- <label for="filter_reminderdate_end">To</label> <input size="10" id="filter_reminderdate_end" name="filter_reminderdate_end" value="" type="text" /> >- </td> >+ <td> >+ <label for="filter_reminderdate_begin">From</label> >+ <input type="text" size="10" id="filter_reminderdate_begin" name="Filter" /> >+ <label for="filter_reminderdate_end">To</label> >+ <input size="10" id="filter_reminderdate_end" name="filter_reminderdate_end" value="" type="text" /> >+ </td> > </tr> > <tr> > <td>Waiting date</td> > <td><input type="radio" name="Line" value="waitingdate" /></td> > <td><input type="radio" name="Column" value="waitingdate" /></td> >- <td><label for="filter_waitingdate_begin">From</label> <input type="text" size="10" id="filter_waitingdate_begin" name="filter_waitingdate_begin" /> >- <label for="filter_waitingdate_end">To</label> <input size="10" id="filter_waitingdate_end" name="filter_waitingdate_end" value="" type="text" /> >- </td> >+ <td> >+ <label for="filter_waitingdate_begin">From</label> >+ <input type="text" size="10" id="filter_waitingdate_begin" name="filter_waitingdate_begin" /> >+ <label for="filter_waitingdate_end">To</label> >+ <input size="10" id="filter_waitingdate_end" name="filter_waitingdate_end" value="" type="text" /> >+ </td> > </tr> > <tr> > <td>Cancellation date</td> > <td><input type="radio" name="Line" value="cancellationdate" /></td> > <td><input type="radio" name="Column" value="cancellationdate" /></td> >- <td><label for="filter_cancellationdate_begin">From</label> <input type="text" size="10" id="filter_cancellationdate_begin" name="filter_cancellationdate_begin" /> >- <label for="filter_cancellationdate_end">To</label> <input size="10" id="filter_cancellationdate_end" name="filter_cancellationdate_end" value="" type="text" /> >- </td> >+ <td> >+ <label for="filter_cancellationdate_begin">From</label> >+ <input type="text" size="10" id="filter_cancellationdate_begin" name="filter_cancellationdate_begin" /> >+ <label for="filter_cancellationdate_end">To</label> >+ <input size="10" id="filter_cancellationdate_end" name="filter_cancellationdate_end" value="" type="text" /> >+ </td> > </tr> > <tr> > <td>Patron category</td> >@@ -325,72 +340,65 @@ > [% INCLUDE 'calendar.inc' %] > <script> > $(document).ready(function() { >- // http://jqueryui.com/demos/datepicker/#date-range >- var dates = $( "#filter_reservedate_begin, #filter_reservedate_end" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "filter_reservedate_begin" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- dates.not( this ).datepicker( "option", option, date ); >+ var filter_reservedate_begin = $("#filter_reservedate_begin").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ filter_reservedate_end.set('minDate', selectedDates[0]); > } > }); >- var datesND = $( "#filter_notificationdate_begin, #filter_notificationdate_end" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "filter_notificationdate_begin" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- datesND.not( this ).datepicker( "option", option, date ); >+ var filter_reservedate_end = $("#filter_reservedate_end").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ >+ var filter_notificationdate_begin = $("#filter_notificationdate_begin").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ filter_notificationdate_end.set('minDate', selectedDates[0]); > } > }); >- var datesRD = $( "#filter_reminderdate_begin, #filter_reminderdate_end" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "filter_reminderdate_begin" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- datesRD.not( this ).datepicker( "option", option, date ); >+ var filter_notificationdate_end = $("#filter_notificationdate_end").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ >+ var filter_reminderdate_begin = $("#filter_reminderdate_begin").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ filter_reminderdate_end.set('minDate', selectedDates[0]); > } > }); >- var datesWD = $( "#filter_waitingdate_begin, #filter_waitingdate_end" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "filter_waitingdate_begin" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- datesWD.not( this ).datepicker( "option", option, date ); >+ var filter_reminderdate_end = $("#filter_reminderdate_end").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ >+ var filter_waitingdate_begin = $("#filter_waitingdate_begin").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ filter_waitingdate_end.set('minDate', selectedDates[0]); > } > }); >- var datesCD = $( "#filter_cancellationdate_begin, #filter_cancellationdate_end" ).datepicker({ >- changeMonth: true, >- numberOfMonths: 1, >- onSelect: function( selectedDate ) { >- var option = this.id == "filter_cancellationdate_begin" ? "minDate" : "maxDate", >- instance = $( this ).data( "datepicker" ); >- date = $.datepicker.parseDate( >- instance.settings.dateFormat || >- $.datepicker._defaults.dateFormat, >- selectedDate, instance.settings ); >- datesCD.not( this ).datepicker( "option", option, date ); >+ var filter_waitingdate_end = $("#filter_waitingdate_end").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); >+ >+ var filter_cancellationdate_begin = $("#filter_cancellationdate_begin").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ filter_cancellationdate_end.set('minDate', selectedDates[0]); > } > }); >+ var filter_cancellationdate_end = $("#filter_cancellationdate_end").flatpickr({ >+ onClose: function( selectedDates, dateText, instance) { >+ validate_date( selectedDates, instance ); >+ }, >+ }); > }); > </script> > [% END %] >-- >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 28949
:
124570
|
124658
|
124785
|
125492