From efe9b23191f58f8800e49bddb3e17ebb8faf4737 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 24 Jul 2006 14:24:31 +0000 Subject: [PATCH] zips are now 5 or 9 digits git-svn-id: svn://svn.open-ils.org/ILS/trunk@5099 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Search/Zips.pm | 1 + Open-ILS/xul/staff_client/server/patron/ue.xhtml | 2 +- Open-ILS/xul/staff_client/server/patron/ue_config.js | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Zips.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Zips.pm index a879caf83a..f4f2c8e10e 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Zips.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Zips.pm @@ -63,6 +63,7 @@ sub search_zip { #return $e->event unless $e->checkauth; #return $e->event unless $e->allowed('VIEW_ZIP_DATA'); my( $self, $conn, $zip ) = @_; + $zip =~ s/(^\d{5}).*/$1/; # we don't care about the last 4 digits if they exist return $zips{$zip}; } diff --git a/Open-ILS/xul/staff_client/server/patron/ue.xhtml b/Open-ILS/xul/staff_client/server/patron/ue.xhtml index a13f80c70f..80eb8509fa 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue.xhtml +++ b/Open-ILS/xul/staff_client/server/patron/ue.xhtml @@ -449,7 +449,7 @@
Zip
- +
diff --git a/Open-ILS/xul/staff_client/server/patron/ue_config.js b/Open-ILS/xul/staff_client/server/patron/ue_config.js index 9b713f42b5..9d9b19d655 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue_config.js +++ b/Open-ILS/xul/staff_client/server/patron/ue_config.js @@ -27,6 +27,7 @@ const dlRegex = /^[a-zA-Z]{2}-\w+/; /* driver's license */ const phoneRegex = /\d{3}-\d{3}-\d{4}/; const nonumRegex = /^[a-zA-Z]\D*$/; /* no numbers, no beginning whitespace */ const dateRegex = /^\d{4}-\d{2}-\d{2}/; +const zipRegex = /^\d{5}(-\d{4}|$)/; /* 12345 or 12345-6789 */ function uEditUsrnameBlur(field) { @@ -677,7 +678,7 @@ function uEditBuildAddrFields(patron, address) { name : 'ue_addr_zip', type : 'input', disabled : disabled, - regex : /^\d{5}$/, + regex : zipRegex, onblur : function(f) { var v = uEditNodeVal(f); var req = new Request(ZIP_SEARCH, v); -- 2.11.0