* Profile :
- #330: Interface to delete usage name is clearer. -Car
+ - #332: User can precise why he asks for a usage name. -Car
* Xnet :
- Various bug fixes in events management. -Car
$page->assign('same', true);
} else { // le nom de mariage est distinct du nom à l'X
// on calcule l'alias pour l'afficher
- $myusage = new UsageReq(Session::getInt('uid'), $nom_usage);
+ $reason = Env::get('reason');
+ if ($reason == 'other')
+ $reason = Env::get('other_reason');
+ $myusage = new UsageReq(Session::getInt('uid'), $nom_usage, $reason);
$myusage->submit();
$page->assign('myusage', $myusage);
}
var $oldalias;
var $homonyme;
+ var $reason;
var $rules = "Refuser
tout ce qui n'est visiblement pas un nom de famille (ce qui est
// }}}
// {{{ constructor
- function UsageReq($_uid, $_usage)
+ function UsageReq($_uid, $_usage, $_reason)
{
global $globals;
$this->Validate($_uid, true, 'usage');
$this->nom_usage = $_usage;
+ $this->reason = $_reason;
$this->alias = make_username($this->prenom, $this->nom_usage);
if (!$this->nom_usage) $this->alias = "";
<td class="titre">Nouvel alias :</td>
<td>{$valid->alias|default:"<span class='erreur'>suppression</span>"}</td>
</tr>
+<tr class="impair">
+ <td class="titre">Raison :</td>
+ <td>{$valid->reason}</td>
+</tr>
{if $valid->homonyme}
<tr class="impair">
<td colspan="2">
<th>Nom d'usage</th>
</tr>
<tr>
- <td class="center"><input type="text" name="nom_usage" value="{$usage_old}" /></td>
+ <td class="center">
+ <input type="text" name="nom_usage" id="nom_usage" value="{$usage_old}" />
+ <script type="text/javascript">
+ document.getElementById("nom_usage").focus();
+ </script>
+ </td>
+ </tr>
+ <tr>
+ <th>Raison du changement de nom</th>
+ </tr>
+ <tr>
+ <td class="rt">
+ <input type="radio" name="reason" checked="checked" value="époux/se" id="reason_ep" onclick="this.form.other_reason.value=''" /><label for="reason_ep">Nom d'épouse / d'époux</label><br />
+ {if $usage_old}
+ <input type="radio" name="reason" value="divorce" id="reason_div" onclick="this.form.other_reason.value=''" /><label for="reason_div">Divorce</label><br />
+ {/if}
+ <input type="radio" name="reason" value="raccourci" id="reason_rac" onclick="this.form.other_reason.value=''" /><label for="reason_rac">Nom d'état civil simplifié, le nom officiel étant trop long</label><br />
+ <input type="radio" name="reason" value="other" id="reason_oth" /><label for="reason_oth">Autre :</label><br />
+ <input type="text" name="other_reason" onfocus="document.getElementById('reason_oth').checked='checked'" size="60" />
+ </td>
</tr>
<tr>
<td class="center">