zips are now 5 or 9 digits
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 Jul 2006 14:24:31 +0000 (14:24 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 24 Jul 2006 14:24:31 +0000 (14:24 +0000)
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
Open-ILS/xul/staff_client/server/patron/ue.xhtml
Open-ILS/xul/staff_client/server/patron/ue_config.js

index a879caf..f4f2c8e 100644 (file)
@@ -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};
 }
 
index a13f80c..80eb850 100644 (file)
                                                                                                                <td><div class='wide right'>Zip</div></td>
                                                                                                                <td>
                                                                                                                        <div class='wide left'>
-                                                                                                                               <input type='text' name='ue_addr_zip' size='6' maxlength='6'/>
+                                                                                                                               <input type='text' name='ue_addr_zip' size='10' maxlength='10'/>
                                                                                                                        </div>
                                                                                                                </td>
                                                                                                        </tr>
index 9b713f4..9d9b19d 100644 (file)
@@ -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);