| Summary: | Use Flatpickr on acquisitions pages | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Owen Leonard <oleonard> |
| Component: | Templates | Assignee: | Owen Leonard <oleonard> |
| Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | jonathan.druart, kyle, lucas, martin.renvoize |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Small patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: |
21.11.00
|
|
| Circulation function: | |||
| Bug Depends on: | 28937 | ||
| Bug Blocks: | 29239 | ||
| Attachments: |
Bug 28942: Use Flatpickr on acquisitions pages
Bug 28942: Use Flatpickr on acquisitions pages Bug 28942: Use Flatpickr on acquisitions pages |
||
|
Description
Owen Leonard
2021-09-02 14:15:36 UTC
Created attachment 124453 [details] [review] Bug 28942: Use Flatpickr on acquisitions pages This patch modifies several acquisitions pages replacing jQuery datepickers with Flatpickr widgets. To test, apply the patch and test datepickers on the following Acquisitions pages: - Acquisitions -> Late orders (linked date fields in the sidebar) - Acquisitions -> Invoices (linked date fields in the sidebar) - Acquisitions -> Invoices -> Invoice details (shipment date and billing date) - Acquisitions -> Vendor -> Receive shipment (shipment date) - Acquisitions -> Vendor -> Receive shipment -> Receive (on order line) -> Date received field under "Accounting details - Acquisitions -> Orders search tab in the header -> Advanced search: Linked date fields in the search form." Created attachment 124848 [details] [review] Bug 28942: Use Flatpickr on acquisitions pages This patch modifies several acquisitions pages replacing jQuery datepickers with Flatpickr widgets. To test, apply the patch and test datepickers on the following Acquisitions pages: - Acquisitions -> Late orders (linked date fields in the sidebar) - Acquisitions -> Invoices (linked date fields in the sidebar) - Acquisitions -> Invoices -> Invoice details (shipment date and billing date) - Acquisitions -> Vendor -> Receive shipment (shipment date) - Acquisitions -> Vendor -> Receive shipment -> Receive (on order line) -> Date received field under "Accounting details - Acquisitions -> Orders search tab in the header -> Advanced search: Linked date fields in the search form." Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 125493 [details] [review] Bug 28942: Use Flatpickr on acquisitions pages This patch modifies several acquisitions pages replacing jQuery datepickers with Flatpickr widgets. To test, apply the patch and test datepickers on the following Acquisitions pages: - Acquisitions -> Late orders (linked date fields in the sidebar) - Acquisitions -> Invoices (linked date fields in the sidebar) - Acquisitions -> Invoices -> Invoice details (shipment date and billing date) - Acquisitions -> Vendor -> Receive shipment (shipment date) - Acquisitions -> Vendor -> Receive shipment -> Receive (on order line) -> Date received field under "Accounting details - Acquisitions -> Orders search tab in the header -> Advanced search: Linked date fields in the search form." Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Great to see all these updates.. PQA Question (not related only to this patch, but other flatpickr ones as well):
Why don't you set the flatpickrto class when needed?
For instance:
+ var billingdatefrom = $("#billingdatefrom").flatpickr({
+ onClose: function( selectedDates, dateText, instance) {
+ validate_date( selectedDates, instance );
+ billingdateto.set('minDate', selectedDates[0]);
+ }
+ });
+ var billingdateto = $("#billingdateto").flatpickr({
+ onClose: function( selectedDates, dateText, instance) {
+ validate_date( selectedDates, instance );
+ },
+ });
You need billingdatefrom, but you could use .flatpickrto for #billintdateto.
Also I think we could improve it a bit more, .flatpickrfrom could have a data containing the name of its "to".
We could only have:
<input type="text" size="10" id="from" name="date_from" value="" class="flatpickrfrom" data-date_to="to" />
<input type="text" size="10" id="to" name="date_to" value="" class="flatpickrto" />
And a couple of line in calendar.inc to link them.
I won't ofc block this patch series for that, but it would be great to have a follow-up bug on top to clean it.
Pushed to master for 21.11, thanks to everybody involved! |