Koha/koha-tmpl/intranet-tmpl/prog/js
Owen Leonard e5f1ada249 Bug 28937: Use Flatpickr on circulation and patron pages
This patch replaces the use of jQueryUI's datepicker on circulation and
patron-related pages.

The patch modifies Flatpickr's default configuration (in calendar.inc)
so that it has the following features:

 - A Flatpickr input with a "futuredate" class will require that the
   selected date be after today.
 - The Flatpickr input field will be wrapped in a container to
   facilitate better CSS styling.
 - Generic handling of paired date fields is enabled using
   ".flatpickrfrom" and ".flatpickrto" field classes. This mimics the
   same feature we have for jQueryUI datepickers using ".datepickerfrom"
   and ".datepickerto".

This patch also removes an unused function which was repeated in three
templates: validate1.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Go to Circulation and check out to a patron.
  - Open the Restrictions tab and click "Add manual restriction."
    - In the "Expiration" field, test that the Flatpickr widget works
      correctly and limits to dates after today.
  - Enable the SpecifyDueDate preference if necessary.
    - Test the behavior of the SpecifyDueDate controls: Setting a date,
      clearing a date, session persistence.
- Enable the SuspendHoldsIntranet system preference if necessary.
  - Check out to a patron with existing holds.
    - Open the Holds tab and click the "Suspend" button for one of the
      holds.
      - In the modal window which appears, check that the Flatpickr
        widget works correctly and limits to dates after today.
      - At the bottom of the table of holds, test that the "Suspend all
        holds" Flatpickr works correctly and limits to dates after
        today.
        - Perform this same test from the patron details page.
- Enable the  BatchCheckouts system preference if necessary.
  - Open a patron record and click "Batch check out" in the left-hand
    sidebar menu.
    - Test that the "Hard due date" Flatpickr works correctly as a date
      and time picker.
- Go to Circulation -> Overdues.
  - Test that the date due filters in the sidebar work correctly and
    are linked, e.g. the "to" field cannot be before the "from" field.
     - Perform the same test here: Circulation -> Holds to pull; and
       here: Circulation -> Hold ratios.
- Enable the  HouseboundModule system preference if necessary.
  - Check out to or view details of a patron.
    - Click "Housebound" in the sidebar menu.
      - Save delivery day and frequency settings for that patron.
      - Click "Add a new delivery."
      - Test that the "Date" Flatpickr widget works correctly.
- Go to Patrons -> A patron record -> Edit.
  - Test that Flatpickr widgets work on the following fields:
    - Date of birth
    - Registration date & Expiration date (linked).
    - Patron restrictions -> Add manual restriction -> Expiration.
- View a bibliographic record and start the process of placing a hold.
  - After selecting a patron, test the "Hold starts on" and "Hold
    expires on" date fields. The fields should be linked and each
    should limit to future dates.
  - Confirm that the dates are saved correctly when you submit the
    hold.
- Locate a bibliographic record with multiple holds and view the holds.
  - In the table of holds, test each date field: Date, expiration, and
    suspend-until.
- Test that Flatpickr's static "formatDate" method is working
  correctly:
  - Locate a bibliographic record's item so that there is text in both
    the "Public note" and "Non-public note" field.
  - Check that item out to a patron.
  - After the page reloads the public and non-public notes should be
    shown under the checkout title highlighted in red.
- Check for references to a "validate1" function. There should be none.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-09-29 12:47:33 +02:00
..
pages Bug 28937: Use Flatpickr on circulation and patron pages 2021-09-29 12:47:33 +02:00
acq.js Bug 26217: Move translatable strings out of templates into acq.js 2020-09-29 14:28:18 +02:00
acquisitions-menu.js Bug 24347: Add a 'search to order' option similar to 'search to hold' 2020-01-30 10:58:03 +00:00
additem.js Bug 28135: Replace use of input type number in additem.js 2021-05-11 15:37:42 +02:00
addorderiso2709.js Bug 27982: (follow-up) Address another missing instance 2021-04-06 15:56:31 +02:00
admin-menu.js Bug 20931: JS error "ReferenceError: $ is not defined" when CircSidebar is turned on 2018-07-02 11:10:00 +00:00
ajax.js Bug 26237: Move translatable strings out of preferences.tt and into JavaScript files 2020-09-29 14:28:18 +02:00
audio_alerts.js Bug 26225: Move translatable strings out of audio_alerts.tt and into audio_alerts.js 2020-09-29 14:28:18 +02:00
auth-finder-search.js Bug 20273: (follow-up) Autocomplete use start instead of contains 2018-07-19 17:25:16 +00:00
automatic_item_modification_by_age.js Bug 18752 - Automatic item modifications by age should allow 'blank' values 2017-06-13 16:21:37 -03:00
background-job-progressbar.js Bug 18707: Background jobs post disabled inputs 2019-07-15 11:27:59 +01:00
basket.js Bug 27754: Correct eslint errors in basket.js 2021-03-01 11:28:03 +01:00
basketgroup.js Bug 18432 : Follow up - Updating to use they/them 2017-04-21 10:56:43 -04:00
biblio_framework.js Bug 26225: Move translatable strings out of biblio_framework.tt and into biblio_framework.js 2020-09-29 14:28:18 +02:00
browser.js Bug 20529: Remove other occurrences of decodeURIComponent from browser.js 2021-09-01 15:53:41 +02:00
calendar.js Bug 28937: Use Flatpickr on circulation and patron pages 2021-09-29 12:47:33 +02:00
cart.js Bug 26439: (QA follow-up) Correct MSG instances in cart.js 2020-11-04 12:59:34 +01:00
cashup_modal.js Bug 26274: Update register.tt to use the API 2021-02-12 12:33:41 +01:00
catalog.js Bug 26707: Split cart and lists button on bibliographic detail pages 2021-01-04 16:31:29 +01:00
cataloging.js Bug 29030: Make authorized value and description fields required 2021-09-29 12:47:33 +02:00
cataloging_additem.js Bug 28689: Extra %s in alert message when saving an items 2021-07-30 16:07:38 +02:00
categories.js Bug 28928: Minor follow-ups to Bug 28376 - Flatpickr introduction 2021-09-01 15:46:01 +02:00
charts.js Bug 17282: Ability to create charts for SQL reports 2018-10-01 13:56:35 +00:00
checkouts.js Bug 28937: Use Flatpickr on circulation and patron pages 2021-09-29 12:47:33 +02:00
circ-patron-search-results.js Bug 22330: (QA follow-up) Enable datatable in patron search 2019-03-21 16:22:56 +00:00
datatables.js Bug 28096: Fix table settings for API datatables wrapper 2021-04-21 10:51:29 +02:00
desk_selection.js Bug 24201: (follow-up) add desk choice with library choice 2020-08-07 16:54:40 +02:00
elasticsearch-mappings.js Bug 26970: Add row highlight on drag in Elasticsearch mapping template 2021-04-07 16:08:04 +02:00
file-upload.js
funds_sorts.js Bug 15184: Prepare the ground - Move funds and sort fields autoupdate 2018-11-08 15:52:56 +00:00
holds.js Bug 28937: Use Flatpickr on circulation and patron pages 2021-09-29 12:47:33 +02:00
ill-availability-partner.js Bug 23173: (follow-up) Display available partners 2020-04-06 11:04:59 +01:00
ill-availability.js Bug 27170: Fix bug fix 2021-09-21 20:22:57 +02:00
ill-list-table.js Bug 25614: Move ILL request keyword filter to sidebar 2021-01-27 10:45:54 +01:00
item_search_fields.js Bug 26230: Move translatable strings out of item_search_fields.tt and into item_search_fields.js 2020-09-29 14:28:18 +02:00
letter.js Bug 26602: (QA follow-up) Cleanup datatables settings 2021-02-08 14:56:00 +01:00
localcovers.js Bug 25031: (QA follow-up) Improve handling of one or fewer images 2020-07-24 14:09:30 +02:00
mana.js Bug 22249: Mana - Move comment process in a dedicated sub 2019-07-26 16:08:08 +01:00
marc_modification_templates.js Bug 28418: Show template_id of MARC modification templates 2021-06-21 14:01:51 +02:00
marc_subfields_structure.js Bug 8976: Add the ability to sort subfields for the MARC frameworks 2021-03-01 15:14:22 +01:00
members-menu.js Bug 15788: Use delete_borrowers permission 2021-06-21 13:50:26 +02:00
members.js Bug 27430: Change password minimum value hint when patron category is changed 2021-02-01 16:36:38 +01:00
merge-record.js Bug 25320: Move translatable strings out of merge-record-strings.inc into merge-record.js 2020-09-29 14:28:19 +02:00
messaging-preference-form.js Bug 13613: Move similar JS code to a function 2021-05-11 15:13:25 +02:00
offlinecirc.js Bug 24545: (follow-up) Fix license statements 2020-02-24 13:31:27 +00:00
onboarding.js Bug 19514: Add client-side check 2017-12-14 16:58:13 -03:00
register_selection.js Bug 24786: Allow selection of cash register at login 2020-11-06 15:39:59 +01:00
rotating-collections.js Bug 23013: Upgrade DataTables in the staff client 2019-08-22 15:23:19 +01:00
select2.js Bug 27124: JS error "select2Width is not defined" 2020-12-21 10:07:40 +01:00
serials-toolbar.js Bug 26256: Move translatable strings out of templates and into serials-toolbar.js 2020-09-29 14:28:18 +02:00
showpredictionpattern.js Bug 19778: Move template JavaScript to the footer: Serials, part 4 2017-12-14 16:58:13 -03:00
sms_providers.js Bug 26240: Move translatable strings out of sms_providers.tt and into sms_providers.js 2020-09-29 14:28:18 +02:00
staff-global.js Bug 28522: Correct eslint errors in staff-global.js 2021-06-21 12:07:28 +02:00
subscription-add.js Bug 27998: (follow-up) Address missing instances 2021-04-06 15:56:31 +02:00
table_filters.js Bug 24662: Remove global variables MSG_* from datatables.inc 2020-03-11 13:49:15 +00:00
tools-menu.js Bug 11897: (QA follow-up) Update of tools-menu.js 2018-10-09 15:46:08 +00:00
viewlog.js Bug 26572: (QA follow-up) Escape strings in autocomplete 2020-11-04 12:59:34 +01:00
xmlControlfield.js
z3950_search.js Bug 28773: (QA follow-up) Additional changes 2021-08-04 14:06:43 +02:00