fix bug IE geoloc
authorPascal Corpet <pascal.corpet@m4x.org>
Mon, 13 Jun 2005 09:34:28 +0000 (09:34 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:29:16 +0000 (23:29 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-712

include/geoloc.inc.php
templates/geoloc/form.address.tpl

index 216d786..9892c9f 100644 (file)
@@ -111,8 +111,8 @@ function get_address_text($adr) {
 // compares if two address matches
 // $b should be a complete valid address
 function compare_addresses_text($a, $b) {
-    $ta = strtoupper(preg_replace(array("/[,\"'#~:;_\-]/", "/\r\n/"), array(" ", "\n"), $a));
-    $tb = strtoupper(preg_replace(array("/[,\"'#~:;_\-]/", "/\r\n/"), array(" ", "\n"), $b));
+    $ta = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $a));
+    $tb = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $b));
    
     $la = explode("\n", $ta);
     $lb = explode("\n", $tb);
@@ -162,13 +162,12 @@ function localize_addresses($uid) {
                 $new['region'], $new['country'],
                 $uid, $a['adrid']);
                 $new['store'] = true;
-                if (!$new['cityid']) return $erreur[$a['adrid']] = $new;
+                if (!$new['cityid']) $erreur[$a['adrid']] = $new;
         } else {
             $new['store'] = false;
             $erreur[$a['adrid']] = $new;
         }
     }
-
     return $erreur;
 }
 
index 6ede47b..b59508f 100644 (file)
@@ -2,25 +2,22 @@
     <tr>
       <td class="cold" colspan="2">
         <input type="hidden" name="change{$adrid}" value="0"/>
-       <span class="erreur">La geolocalisation n'a pas donné un résultat certain, vérifie la nouvelle adresse ou modifie l'ancienne pour que ton adresse puisse être prise en compte.</span>
-       <div class="adresse">
-        <textarea name="txt[{$adrid}]" cols="23" rows="3" onchange="form.change{$adrid}.value=1"
+       <span class="erreur" wrap>La geolocalisation n'a pas donné un résultat certain, valide la nouvelle adresse ou modifie l'ancienne pour que ton adresse puisse être prise en compte.</span><br />
+        <textarea name="txt[{$adrid}]" cols="23" rows="4" onchange="form.change{$adrid}.value=1"
        {if !$adr.cityid}style="background:#FAA"{/if}
        >{$adr.txt}</textarea>
-       </div>
-       <div class="adresse">
-         <pre
-         style="border:2px inset threedface{if !$adr.geoloc_cityid};background:#FAA{/if}"
-       >{$adr.geoloc}</pre>
+         <textarea cols="23" rows="4"
+         style="border:inherit;background:#AFA"
+         onclick="blur()"
+       >{$adr.geoloc}</textarea>
        [<a href="{$smarty.server.PHP_SELF}?old_tab={$smarty.request.old_tab}&amp;parsevalid[{$adrid}]=1">Valider</a>]
-       </div>
       </td>
     </tr>
     {else}
     <tr class="center">
       <td class="cold" colspan="2">
         <input type="hidden" name="change{$adrid}" />
-        <textarea name="txt[{$adrid}]" cols="43" rows="3" onchange="form.change{$adrid}.value=1"
+        <textarea name="txt[{$adrid}]" cols="43" rows="4" onchange="form.change{$adrid}.value=1"
        {if $adr.nouvelle != 'new' && !$adr.cityid}style="background:#FAA"{/if}
        >{$adr.txt}</textarea>
       </td>