[OPEN-ILS-DEV] What I did on my summer vacation

Dan Scott denials at gmail.com
Thu Jul 24 23:05:41 EDT 2008


I've been meaning to do this for ages, and finally scraped a few hours
together to get it done.

As Evergreen 1.4 is introducing the use of Dojo
(http://dojotoolkit.org) for a number of administrative interfaces,
and even more so for 2.0 (acquisitions and serials interfaces), I
thought it might make sense to start using Dojo to replace other
widgets. In my dream world, the fewer widget sources that we use, the
simpler infrastructure maintenance and extension shall be.

Okay, enough gobbledygook. Attached is a patch (less than 200 lines)
that introduces the use of the Dojo dijit.DateTextBox widget to
replace the use of the jscalendar date-picker widget in the OPAC. It's
not yet perfect, but it's headed there. I don't have extensive
experience with the OPAC code, so I'm hoping Bill and/or Jason can
take a look and see if there are any obvious horrible things lurking
in this patch.

Summary: Tested successfully with Firefox 3.0.1 (Linux) and IE6 (under
IES4Linux).

Functional differences:
  * Dates are now displayed according to the chosen locale, based on
CLDR standards. For example, the textual representation of ISO8601
format "2008-07-27" in the en-US locale is "7/27/2008"; in the fr-CA
locale the textual representation is "27/07/2008". Dates are still
transferred to the server in ISO8601 format. Accordingly, the
formatting hints have been removed from the hold date fields.
  * <body> tag now gets class="tundra" attribute to support Dojo
widget formatting
  * css_common.xml gets the Dojo tundra CSS imports
  * js_common.xml gets the Dojo JavaScript required to support
dijit.DateTextBox; if we do start using more Dojo widgets, in the
longer term we might want to break this out into a separate file or
files if we don't want to load the whole Dojo stack for each page.

Regressions introduced:
  * An attempt to pick a hold activation date in the past no longer
outlines the box in red; it just silently refuses to do anything.
Haven't investigated the reason for this change in behaviour too
deeply yet.

Potential improvements:
  * Use a min: constraint of today to prevent picking dates before
today - this could short-circuit most of the current date comparison
code.
  * Use the Dojo date methods to perform comparisons instead of the
Date extension (DP_DateExtensions) class currently in use.
  * Use the Dojo date formatting methods to output dates in other
parts of the OPAC, such as the "Due date" and "Activate date" columns
in My Account
  * Use the DateTextBox throughout the staff client as well and delete
jscalendar entirely

Dojo also includes support for number and currency formatting
according to the user's preferred locale; assuming the date approach
is considered acceptable, these would be the next areas to tackle
(IMHO).

-- 
Dan Scott
Laurentian University
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dojocalendar.patch
Type: text/x-diff
Size: 8756 bytes
Desc: not available
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20080724/c32f020d/dojocalendar-0001.bin


More information about the Open-ils-dev mailing list