Changes geocoding engine to gmaps v3.
[platal.git] / templates / geoloc / form.address.tpl
index 229d1e8..033c3c0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 {*                                                                        *}
 {**************************************************************************}
 
-{if $address.geoloc}
-<div class="erreur center {$prefid}_geoloc">
-  Le géocodage n'a pas donné un résultat certain&nbsp;! Tu as le choix entre&nbsp;:
-</div>
-<div class="{$prefid}_geoloc">
-  <ul>
-    <li><a href="javascript:validGeoloc('{$prefid}', '{$id}', 0)" style="color: red">ton adresse (à gauche)</a>&nbsp;;</li>
-    <li><a href="javascript:validGeoloc('{$prefid}', '{$id}', 1)" style="color: green">notre suggestion (à droite)</a>&nbsp;;</li>
-    <li><a href="javascript:validGeoloc('{$prefid}', '{$id}', 2)"
-           title="Garder le texte de l'adresse que tu as renseignée tout en utilisant les informations trouvées par le géocodage pour te localiser sur le planisphère et dans lors d'une recherche dans l'annuaire.">
-      le texte de ton adresse localisé à l'endroit que nous te suggérons</a>.</li>
-  </ul>
-</div>
-{/if}
-
-<div>
-  <textarea name="{$prefname}[text]" cols="30" rows="4" onkeyup="addressChanged('{$prefid}')"
-            {if $address.geoloc}class="error"{/if}>{$address.text}</textarea>
-{if $address.geoloc}
-  <textarea cols="30" rows="4" class="valid {$prefid}_geoloc"
-            name="{$prefname}[geoloc]">{$address.geoloc}</textarea>
-{/if}
-</div>
-{if $address.geoloc}
-<input type="hidden" name="{$prefname}[geoloc_choice]" value="1" />
-<input type="hidden" name="{$prefname}[geoloc]" value="{$address.geoloc}" />
-<input type="hidden" name="{$prefname}[geocodedPostalText]" value="{$address.geocodedPostalText}" />
-<input type="hidden" name="{$prefname}[updateTime]" value="{$address.updateTime}" />
-{/if}
-<input type="hidden" name="{$prefname}[accuracy]" value="{$address.accuracy}" />
-<input type="hidden" name="{$prefname}[postalText]" value="{$address.postalText}" />
-<input type="hidden" name="{$prefname}[postalCode]" value="{$address.postalCode}" />
-<input type="hidden" name="{$prefname}[administrativeAreaId]" value="{$address.administrativeAreaId}" />
-<input type="hidden" name="{$prefname}[subAdministrativeAreaId]" value="{$address.subAdministrativeAreaId}" />
-<input type="hidden" name="{$prefname}[localityId]" value="{$address.localityId}" />
-<input type="hidden" name="{$prefname}[countryId]" value="{$address.countryId}" />
-<input type="hidden" name="{$prefname}[latitude]" value="{$address.latitude}" />
-<input type="hidden" name="{$prefname}[longitude]" value="{$address.longitude}" />
-<input type="hidden" name="{$prefname}[north]" value="{$address.north}" />
-<input type="hidden" name="{$prefname}[south]" value="{$address.south}" />
-<input type="hidden" name="{$prefname}[east]" value="{$address.east}" />
-<input type="hidden" name="{$prefname}[west]" value="{$address.west}" />
-<input type="hidden" name="{$prefname}[cedex]" value="{$address.cedex}" />
-<input type="hidden" name="{$prefname}[updateTime]" value="{$address.updateTime}" />
-<input type="hidden" name="{$prefname}[changed]" value="0" />
-<input type="hidden" name="{$prefname}[removed]" value="0" />
+<tr{if t($class)} class="{$class}"{/if}>
+  <td>
+    <textarea name="{$prefname}[text]" cols="30" rows="4" onkeyup="addressChanged('{$prefid}')">{$address.text}</textarea>
+    <input type="hidden" name="{$prefname}[postalText]" value="{$address.postalText}" />
+    <input type="hidden" name="{$prefname}[types]" value="{$address.types}" />
+    <input type="hidden" name="{$prefname}[formatted_address]" value="{$address.formatted_address}" />
+    <input type="hidden" name="{$prefname}[latitude]" value="{$address.latitude}" />
+    <input type="hidden" name="{$prefname}[longitude]" value="{$address.longitude}" />
+    <input type="hidden" name="{$prefname}[southwest_latitude]" value="{$address.southwest_latitude}" />
+    <input type="hidden" name="{$prefname}[southwest_longitude]" value="{$address.southwest_longitude}" />
+    <input type="hidden" name="{$prefname}[northeast_latitude]" value="{$address.northeast_latitude}" />
+    <input type="hidden" name="{$prefname}[northeast_longitude]" value="{$address.northeast_longitude}" />
+    <input type="hidden" name="{$prefname}[location_type]" value="{$address.location_type}" />
+    <input type="hidden" name="{$prefname}[partial_match]" value="{$address.partial_match}" />
+    <input type="hidden" name="{$prefname}[componentsIds]" value="{$address.componentsIds}" />
+    <input type="hidden" name="{$prefname}[changed]" value="0" />
+    <input type="hidden" name="{$prefname}[removed]" value="0" />
+  </td>
+  <td>
+  {if t($address.latitude)}
+    <img src="https://maps.googleapis.com/maps/api/staticmap?size=300x100&amp;markers=color:{$profile->promoColor()}%7C{$address.latitude},{$address.longitude}&amp;zoom=12&amp;sensor=false"
+         alt="Position de l'adresse" />
+    <br />
+    <small><a href="javascript:deleteGeocoding()">{icon name=cross title="Adresse mal localisée"} Signaler que le repère est mal placé</a></small>
+  {/if}
+  </td>
+</tr>
 
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}