Bug 28958: Use Flatpickr on serials pages
authorOwen Leonard <oleonard@myacpl.org>
Tue, 7 Sep 2021 12:44:06 +0000 (12:44 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 5 Oct 2021 08:58:14 +0000 (10:58 +0200)
This patch replaces the use of jQueryUI's datepicker on serials pages.

To test, apply the patch and test the following serials pages to confirm
that datepickers work correctly. "Linked" date fields should prevent a
"to" selection which preceeds the selected "from" date.

- Claims -> Choose vendor -> Filter missing issues (linked "from" and
  "to" fields).
- Check expiration -> "Expiring before" field.
- Manage numbering patterns -> New numbering pattern -> "First issue
  publication date" field.
- Serials advanced search -> "Expires before" field.
- Subscription search results -> Check multiple checkboxes -> Edit
  selected serials: "Expiration date" field.
- Subscription details -> Serial collection -> Edit serials ->
  "Published on" and "Expected on" fields.
- Subscription details -> Renew -> "Start date" field in the popup
  window.
- Subscription details -> Edit subscription -> Page 2 -> "First issue
  publication date," "Subscription start date," and "Subscription end
  date" fields.
- Locate a subscription with manual history enabled. From the
  subscription detail page, click the "Planning" tab, then "Edit
  history" -> Linked fields "Subscription start date" and "Subscription
  end date."

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-batchedit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-history.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt

index cdd8861..42f2f42 100644 (file)
@@ -54,7 +54,7 @@
         [% END %]
 
         <li><label for="date" class="required">Expiring before:</label>
-            <input id="date" type="text" name="date" size="10" value="[% date | $KohaDates %]" class="required focus datepicker" required="required" />
+            <input id="date" type="text" name="date" size="10" value="[% date | $KohaDates %]" class="required focus flatpickr" required="required" />
         <span class="required">Required</span>
                        <div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
                        </ol>
index c3f588a..cab4dc9 100644 (file)
@@ -93,9 +93,9 @@
        <ol>
        <li>
         <label for="from">From:</label>
-        <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="datepickerfrom" />
+        <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickrfrom" />
         <label for="to" style="float:none;">To:</label>
-        <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="datepickerto" />
+        <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickrto" />
         <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
         <input id="filterByDate" type="button" value="OK" />
         <a href="#" id="clearfilter"><i class="fa fa-remove"></i> Clear filter</a>
index 781ac6b..4be920b 100644 (file)
@@ -62,8 +62,6 @@ $(document).ready(function() {
         }
         return true;
     });
-
-    $(".datepicker").datepicker();
 });
 //]]>
 </script>
@@ -143,13 +141,13 @@ $(document).ready(function() {
             Issue <input type="text" name="serialseq" id="serialseq[% serialslis.serialid | html %]" value="[% serialslis.serialseq | html %]" size="20" maxlength="100" />
         </td>
         <td>
-            <input type="text" name="publisheddate" value="[% serialslis.publisheddate | html %]" size="10" maxlength="15" class="datepicker" />
+            <input type="text" name="publisheddate" value="[% serialslis.publisheddate | html %]" size="10" maxlength="15" class="flatpickr" />
         </td>
         <td>
             <input type="text" name="publisheddatetext" value="[% serialslis.publisheddatetext | html %]" size="10" maxlength="100" />
         </td>
         <td>
-            <input type="text" name="planneddate" value="[% serialslis.planneddate | html %]" size="10" maxlength="15" class="datepicker" />
+            <input type="text" name="planneddate" value="[% serialslis.planneddate | html %]" size="10" maxlength="15" class="flatpickr" />
         </td>
         <td>
             [% IF ( serialslis.editdisable ) %]
@@ -306,13 +304,13 @@ $(document).ready(function() {
             Supplemental issue <input type="text" name="serialseq" id="serialseq[% newserialloo.serialid | html %]" value="" size="20" maxlength="100" onchange="if (this.value!=''){unHideItems('items[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]', '[% newserialloo.serialid | html %]')} else {HideItems('items[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]')}" />
         </td>
         <td>
-            <input type="text" name="publisheddate" value="[% newserialloo.publisheddate | html %]" size="10" maxlength="15"  class="datepicker" />
+            <input type="text" name="publisheddate" value="[% newserialloo.publisheddate | html %]" size="10" maxlength="15"  class="flatpickr" />
         </td>
         <td>
             <input type="text" name="publisheddatetext" value="[% newserialloo.publisheddatetext | html %]" size="10" maxlength="100" />
         </td>
         <td>
-            <input type="text" name="planneddate" value="[% newserialloo.planneddate | html %]" size="10" maxlength="15" class="datepicker" />
+            <input type="text" name="planneddate" value="[% newserialloo.planneddate | html %]" size="10" maxlength="15" class="flatpickr" />
         </td>
         <td>
             <select name="status" id="addstatus[% newserialloo.serialid | html %]" onchange="if (this.value==2){unHideItems('items'+'[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','label[% newserialloo.subscriptionid | html %][% newserialloo.serialid | html %]','[% newserialloo.serialid | html %]'); changeDate(this, '[% newserialloo.arriveddate | html %]')} else if (this.value==7){changeDate(this, '[% newserialloo.arriveddate | html %]')} else { HideItems('items'+'[% newserialloo.subscriptionid | html %]'+[% newserialloo.serialid | html %],'label[% serialslis.subscriptionid | html %][% serialslis.serialid | html %]'); changeDate(this, '[% serialslis.planneddate | html %]')}" >
index 587d8fa..d2c979a 100644 (file)
                 </li>
                 <li>
                   <label for="to">Expires before:</label>
-                  <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
+                  <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="flatpickr" />
                 </li>
                 [% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 %]
               </ol>
index 789596e..5de924a 100644 (file)
@@ -263,7 +263,7 @@ fieldset.rows table { clear: none; margin: 0; }
                                     <li>
                                         <label for="acqui_date" class="required">First issue publication date:</label>
                                         [% UNLESS (more_than_one_serial) %]
-                                          <input type="text" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]" class="datepicker required" required="required" />
+                                          <input type="text" size="10" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]" class="flatpickr required" required="required" />
                                         [% ELSE %]
                                           [% firstacquidate | $KohaDates %]
                                           <input type="hidden" id="acqui_date" name="firstacquidate" value="[% firstacquidate | $KohaDates %]"/>
@@ -273,7 +273,7 @@ fieldset.rows table { clear: none; margin: 0; }
                                     [% IF (more_than_one_serial) %]
                                       <li>
                                         <label for="nextacquidate">Next issue publication date:</label>
-                                        <input type="text" size="10" id="nextacquidate" name="nextacquidate" value="[% nextacquidate | $KohaDates %]" class="datepicker" />
+                                        <input type="text" size="10" id="nextacquidate" name="nextacquidate" value="[% nextacquidate | $KohaDates %]" class="flatpickr" />
                                       </li>
                                     [% END %]
                                     <li>
@@ -327,11 +327,11 @@ fieldset.rows table { clear: none; margin: 0; }
                                     </li>
                                     <li>
                                         <label for="from" class="required"> Subscription start date:</label>
-                                        <input type="text" size="10" id="from" name="startdate" value="[% startdate | $KohaDates %]" class="datepickerfrom required" required="required" />
+                                        <input type="text" size="10" id="from" name="startdate" value="[% startdate | $KohaDates %]" class="flatpickrfrom required" required="required" />
                                     </li>
                                     <li>
                                         <label for="to">Subscription end date:</label>
-                                        <input type="text" size="10" id="to" name="enddate" value="[% enddate | $KohaDates %]" class="datepickerto" />
+                                        <input type="text" size="10" id="to" name="enddate" value="[% enddate | $KohaDates %]" class="flatpickrto" />
                                     </li>
                                     <li>
                                         <label for="numberpattern" class="required">Numbering pattern:</label>
index c6219f9..360b18e 100644 (file)
                                 </li>
                                 <li>
                                     <label for="enddate">Expiration date: </label>
-                                    <input type="text" class="datepicker" id="enddate" name="enddate" placeholder="No change"/>
+                                    <input type="text" class="flatpickr" id="enddate" name="enddate" placeholder="No change"/>
                                 </li>
                                 [% FOREACH field IN additional_fields %]
                                     <li>
index 23bdbc6..5682708 100644 (file)
               <tr>
                 <td>Subscription start date</td>
                 <td>
-                    <input type="text" size="10" name="histstartdate" value="[% histstartdate | $KohaDates %]" class="datepickerfrom" /> (start date of the 1st subscription)
+                    <input type="text" size="10" name="histstartdate" value="[% histstartdate | $KohaDates %]" class="flatpickrfrom" /> (start date of the 1st subscription)
                     <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
                 </td>
               </tr>
               <tr>
                 <td>Subscription end date</td>
                 <td>
-                    <input type="text" size="10" name="histenddate" value="[% histenddate | $KohaDates %]" class="datepickerto" />(if empty, subscription is still active)
+                    <input type="text" size="10" name="histenddate" value="[% histenddate | $KohaDates %]" class="flatpickrto" />(if empty, subscription is still active)
                     <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
                 </td>
               </tr>
index 833643a..802698e 100644 (file)
                 </li>
                 <li>
                   <label for="firstacquidate">First issue publication date: </label>
-                  <input type="text" id="firstacquidate" class="datepicker" size="10" />
+                  <input type="text" id="firstacquidate" class="flatpickr" size="10" />
                 </li>
                 <li>
                   <label for="sublength">Subscription length:</label>
index 7d570fe..3cf27e2 100644 (file)
@@ -34,7 +34,7 @@
         <ol>
             <li>
                 <label for="startdate">Start date: </label>
-                <input type="text" size="10" id="startdate" name="startdate" value="[% startdate | html %]" class="datepicker"/>
+                <input type="text" size="10" id="startdate" name="startdate" value="[% startdate | html %]" class="flatpickr"/>
                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
             </li>
     <li>