{
require_once 'geoloc.inc.php';
$success = true;
+ unset($address['geoloc']);
+ unset($address['geoloc_cityid']);
if (@$address['parsevalid'] || (@$address['text'] && @$address['changed']) || !@$address['cityid']) {
$address = array_merge($address, empty_address());
$new = get_address_infos(@$address['text']);
<input type="hidden" name="{$name}[changed]" value="0"/>
{if $adr.geoloc}
-<div class="erreur">
+<div class="erreur" id="{$id}_geoloc_error">
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.
</div>
<script type="text/javascript">setTimeout("document.location += '#{$adid}'", 10);</script>
{/if}
+<div>
<textarea name="{$name}[text]" cols="30" rows="4"
onchange="form['{$name}[changed]'].value=1"
{if !$adr.cityid && $adr.datemaj}class="error"{/if}
>{$adr.text}</textarea>
{if $adr.geoloc}
+<span id="{$id}_geoloc">
<textarea cols="30" rows="4"
class="valid"
+ name="{$name}[geoloc]"
onclick="blur()"
>{$adr.geoloc}</textarea>
-<p class="center">
- <input type="submit" name="{$name}[parsevalid]" value="Valider l'adresse" />
-</p>
+<input type="hidden" name="{$name}[parsevalid]" value="0" />
+</span>
+</div>
+<div class="center" id="{$id}_geoloc_valid">
+ <a href="javascript:validAddress('{$id}', '{$name}')">Valider ta version</a>
+ •
+ <a href="javascript:validGeoloc('{$id}', '{$name}')">Valider la version géolocalisée</a>
{/if}
+</div>
<input type="hidden" name="{$name}[cityid]" value="{$adr.cityid}" />
<input type="hidden" name="{$name}[adr1]" value="{$adr.adr1}" />
<input type="hidden" name="{$name}[adr2]" value="{$adr.adr2}" />
<div>{include file="include/flags.radio.tpl" name="`$adpref`[pub]" notable=true val=$adr.pub}</div>
<div style="clear: both"></div>
<div style="float: left">{include file="geoloc/form.address.tpl" name=$adpref id=$adid adr=$adr}</div>
- <div style="float: right">
+ <div style="float: left">
<div>
<input type="radio" name="{$adpref}[temporary]" id="{$adid}_temp_0" value="0"
{if !$adr.temporary}checked="checked"{/if} /><label for="{$adid}_temp_0">permanente</label>
Ajax.update_html(tel + i, 'profile/ajax/tel/' + id + '/' + i);
}
+function validGeoloc(id, pref)
+{
+ document.getElementById(id + '_geoloc').style.display = 'none';
+ document.getElementById(id + '_geoloc_error').style.display = 'none';
+ document.getElementById(id + '_geoloc_valid').style.display = 'none';
+ document.forms.prof_annu[pref + "[parsevalid]"] = "1";
+ document.forms.prof_annu[pref + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value;
+ attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
+ function() { document.forms.prof_annu[pref + "[text]"].blur(); });
+ document.forms.prof_annu[pref + "[text]"].className = '';
+}
+
+function validAddress(id, pref)
+{
+ document.getElementById(id + '_geoloc').style.display = 'none';
+ document.getElementById(id + '_geoloc_error').style.display = 'none';
+ document.getElementById(id + '_geoloc_valid').style.display = 'none';
+ document.forms.prof_annu[pref + "[parsevalid]"] = "0";
+ attachEvent(document.forms.prof_annu[pref + "[text]"], "click",
+ function() { document.forms.prof_annu[pref + "[text]"].blur(); });
+ document.forms.prof_annu[pref + "[text]"].className = '';
+}
+
{/literal}
//]]></script>