Bug 8181 - Replace DynArch calendar widget with jQueryUI version
Summary: Replace DynArch calendar widget with jQueryUI version
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact:
URL:
Keywords:
Depends on: 8143 8428
Blocks: 5481 10396
  Show dependency treegraph
 
Reported: 2012-06-01 16:36 UTC by Owen Leonard
Modified: 2014-05-26 21:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8181 - Replace DynArch calendar widget with jQueryUI version (628.93 KB, patch)
2012-06-13 14:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version (627.96 KB, patch)
2012-06-19 16:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version (627.94 KB, patch)
2012-06-19 16:41 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version (627.95 KB, patch)
2012-06-20 02:32 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version (628.10 KB, patch)
2012-06-20 19:17 UTC, Ian Walls
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2012-06-01 16:36:48 UTC
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/
Comment 1 Owen Leonard 2012-06-13 14:13:05 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2012-06-13 14:18:29 UTC
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
Comment 3 Katrin Fischer 2012-06-17 15:32:48 UTC
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?
Comment 4 Owen Leonard 2012-06-19 16:37:10 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2012-06-19 16:41:53 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2012-06-19 17:00:12 UTC
(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.
Comment 7 Chris Cormack 2012-06-20 02:31:41 UTC
This now appears to work fine for me. Well done Owen!
Comment 8 Chris Cormack 2012-06-20 02:32:27 UTC Comment hidden (obsolete)
Comment 9 Ian Walls 2012-06-20 19:17:31 UTC
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 10 Ian Walls 2012-06-20 19:18:03 UTC
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)
Comment 11 Ian Walls 2012-06-20 19:18:21 UTC
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.
Comment 12 Paul Poulain 2012-06-25 16:29:03 UTC
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