[OPEN-ILS-DEV] What I did on my summer vacation
Bill Erickson
erickson at esilibrary.com
Fri Jul 25 16:48:24 EDT 2008
On Thursday 24 July 2008 11:05 Dan Scott wrote:
> 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).
Works in FF2 as well.
>
> 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.
I believe it's calling holdsVerifyThawDate() on the raw input value and not
the ISO8601-ized value. Easy enough to fix post-patch.
>
> 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).
Agreed all around.
The patch looks and behaves sanely. +1 from me for committing.
-b
--
Bill Erickson
| VP, Software Development & Integration
| Equinox Software, Inc. / The Evergreen Experts
| phone: 877-OPEN-ILS (673-6457)
| email: erickson at esilibrary.com
| web: http://esilibrary.com
More information about the Open-ils-dev
mailing list