Currently Koha uses a JavaScript calendar plugin from http://www.dynarch.com/projects/calendar/old/. This older version of the plugin is open source but is now unmaintained. The newer version is not open source. This plugin can be replaced by the jQueryUI datepicker widget: http://jqueryui.com/demos/datepicker/
Created attachment 10259 [details] [review] Bug 8181 - Replace DynArch calendar widget with jQueryUI version All instances of the old DynArch calendar have been replaced with jQueryUI versions and the old library files have been removed. There is now a helper function in staff-global.js for triggering a datepicker prompt on any input field. Just add a "datepicker" class to the input field. If you would like two fields in one from to limit each other (one is date from, one is date to), add these classes to each: "datepickerfrom" and "datepickerto." This will prevent an invalid entry, e.g. a date in the latter which falls before the former. jQueryUI is now upgraded to the latest verision, 1.8.21.
A couple of notes: This patch re-introduces a couple of image files which are used by the jQueryUI library in general. The datepicker uses some elements of the image sprite. If subsequent jQuery modules don't use other elements of the sprite it might be worth a follow-up to remove it in favor of an alternative style. This patch moves some of the CSS introduced in previous jQueryUI patches out of staff-global.css and into jquery-ui.css in order to make it a more generalized Koha theme. Here is a list of pages modified by this patch: includes/checkouts-table-footer.inc (used by circulation.pl and moremember.pl (renewal due date)) acqui/histsearch.tt acqui/lateorders.tt acqui/parcels.tt admin/aqbudgetperiods.tt admin/aqcontract.tt admin/categorie.tt admin/smart-rules.tt circ/circulation.tt circ/overdue.tt circ/pendingreserves.tt circ/reserveratios.tt labels/search.tt members/memberentrygen.tt members/moremember.tt reports/acquisitions_stats.tt reports/bor_issues_top.tt reports/borrowers_out.tt reports/borrowers_stats.tt reports/cat_issues_top.tt reports/catalogue_stats.tt reports/dictionary.tt reports/guided_reports_start.tt reports/issues_avg_stats.tt reports/issues_by_borrower_category.tt reports/issues_stats.tt reports/reserves_stats.tt reports/stats_screen.tt reserve/request.tt serials/checkexpiration.tt serials/claims.tt serials/subscription-add.tt suggestion/suggestion.tt tags/review.tt tools/cleanborrowers.tt tools/export.tt tools/holidays.tt tools/inventory.tt tools/koha-news.tt tools/modborrowers.tt tools/scheduler.tt tools/viewlog.tt opac-reserve.tt opac-user.tt
Hi Owen, thx for another big patch to add a shiny new calendar :) Your patch applied cleanly, but I found some smaller problems: 1) In the holidays calendar, the calendar does not display, until I copy a calendar somewhere. So for example, the calendar does not show, when I enter the page. Changing the location on top, does not refresh the page or bring up another calendar. 2) In acquisitions late orders the filters do not respect the dateformat setting. I have metric DD/MM/YYYY but the dates from the datepicker are MM/DD/YYYY. In other places like the holiday calendar the display is correct. (acqui/lateorders.pl) Same problem occurs on: acqui/histsearch.pl acqui/parcels.pl admin/aqbudetperiods.pl admin/aqcontract.pl admin/category.pl (stopping here) 3) The tooltip for the calendar shows up as a black box with '...' in it. It was a bit irritating for me, perhaps you have an idea? 4) The today button does not enter today's date, but does switch back to the correct 'page' of the calendar. Today's date is not very clearly marked there. It's not so easy to spot in the calendar. Perhaps it could stand out a bit more?
Created attachment 10365 [details] [review] Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version All instances of the old DynArch calendar have been replaced with jQueryUI versions and the old library files have been removed. calendar.inc has been modified to include jQueryUI localization strings and global configuration options. Just add a "datepicker" class to an input field to trigger a datepicker prompt. If you would like two fields in one from to limit each other (one is date from, one is date to), add these classes to each: "datepickerfrom" and "datepickerto." This will prevent an invalid entry, e.g. a date in the latter which falls before the former. jQueryUI is now upgraded to the latest verision, 1.8.21. Edit: Now with proper translatability, date formatting, first day of the week handling, and RTL support.
Created attachment 10366 [details] [review] Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version All instances of the old DynArch calendar have been replaced with jQueryUI versions and the old library files have been removed. calendar.inc has been modified to include jQueryUI localization strings and global configuration options. Just add a "datepicker" class to an input field to trigger a datepicker prompt. If you would like two fields in one from to limit each other (one is date from, one is date to), add these classes to each: "datepickerfrom" and "datepickerto." This will prevent an invalid entry, e.g. a date in the latter which falls before the former. jQueryUI is now upgraded to the latest verision, 1.8.21. Edit: Now with proper translatability, date formatting, first day of the week handling, and RTL support.
(In reply to comment #3) > 1) In the holidays calendar, the calendar does not display, until I copy a > calendar somewhere. I was able to reproduce this error when first visiting the page after switching to this branch, but not on subsequent page loads. Could it have been a browser cache issue? > 2) In acquisitions late orders the filters do not respect the dateformat > setting. Handling of dateformat and other I18N settings has been fixed. That is to say, added. > 3) The tooltip for the calendar shows up as a black box with '...' in it. It > was a bit irritating for me, perhaps you have an idea? This is a default of the jQueryUI datepicker: The calendar icon has a title attribute added to it, "..." I'm not sure why. It might be possible to revise the default configuration without modifying the jQueryUI library itself. I'll have to investigate. > Today's date is not very clearly marked > there. It's not so easy to spot in the calendar. Perhaps it could stand out > a bit more? I have revised the CSS to make it brighter.
This now appears to work fine for me. Well done Owen!
Created attachment 10371 [details] [review] Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version All instances of the old DynArch calendar have been replaced with jQueryUI versions and the old library files have been removed. calendar.inc has been modified to include jQueryUI localization strings and global configuration options. Just add a "datepicker" class to an input field to trigger a datepicker prompt. If you would like two fields in one from to limit each other (one is date from, one is date to), add these classes to each: "datepickerfrom" and "datepickerto." This will prevent an invalid entry, e.g. a date in the latter which falls before the former. jQueryUI is now upgraded to the latest verision, 1.8.21. Edit: Now with proper translatability, date formatting, first day of the week handling, and RTL support. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Created attachment 10391 [details] [review] [PASSED QA] Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version All instances of the old DynArch calendar have been replaced with jQueryUI versions and the old library files have been removed. calendar.inc has been modified to include jQueryUI localization strings and global configuration options. Just add a "datepicker" class to an input field to trigger a datepicker prompt. If you would like two fields in one from to limit each other (one is date from, one is date to), add these classes to each: "datepickerfrom" and "datepickerto." This will prevent an invalid entry, e.g. a date in the latter which falls before the former. jQueryUI is now upgraded to the latest verision, 1.8.21. Edit: Now with proper translatability, date formatting, first day of the week handling, and RTL support. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Ian Walls <koha.sekjal@gmail.com> QA Comment: rebased on current master; minor merge conflicts with other patches pushed
Comment on attachment 10371 [details] [review] Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version Rebased patch to apply on current master (trivial conflicts resolved)
While this is a very large patch, it is entirely template based. It moves us from one implementation of the datepicker to a better one, with a little spacing cleanup along the way for good measure. Marking Passed QA.
Could not confirm that every page work fine, but could not find anything wrong either. Patch pushed, i'll advertise this change in my next monthly RM newsletter