[OPEN-ILS-DEV] Suggestion for handling country-specific variations in org_unit.html

Dan Scott dan at coffeecode.net
Wed Sep 16 21:58:18 EDT 2009


On Wed, 2009-09-16 at 17:53 -0400, Ben Ostrowsky wrote:
> At the moment, org_unit.html requires a county, which doesn't have a
> whole lot of meaning in Canada, and uses a hardcoded regex for the
> postal code.  For Canada, the regex
> /^[ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ][\s]?[0-9][ABCEFGHJKLMNPRSTVWXYZ][0-9]$/
> is appropriate.

Good catch!

> Should this be stored in an org_unit_setting?  Should it be an entity
> like &conify.org_unit.addresses_pane.zip.regex; instead?  I leave it
> to y'all to find the most sensible implementation.

Tough question. mod_xmlent is probably the easiest short-term way of
handling sets of regional settings like this - but it would also
introduce more complexity for translators (who shouldn't be expected to
have to maintain regular expressions). 

Raw org_unit settings are a bit unwieldy, if a "required" boolean and a
validation regex would need to be manually maintained for each
individual field. Perhaps there's a middle ground where one could choose
a region for an org_unit (e.g. "Canada") when initially creating it, and
that would set the corresponding org_unit settings - which could then be
subject to a manual override.





More information about the Open-ils-dev mailing list