From: x2001corpet Date: Wed, 3 Aug 2005 17:53:20 +0000 (+0000) Subject: bug 332, precision de la raison du nom d'usage X-Git-Tag: xorg/0.9.9~182 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=21e9114cc7672187b9e30a42f684aefb9984a7bd;p=platal.git bug 332, precision de la raison du nom d'usage git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@13 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/ChangeLog b/ChangeLog index 4683703..6e608a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ Bug/Wish : * 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 diff --git a/htdocs/nomusage.php b/htdocs/nomusage.php index cdf8eaa..2e7a4a0 100644 --- a/htdocs/nomusage.php +++ b/htdocs/nomusage.php @@ -46,7 +46,10 @@ if (Env::has('submit') && ($nom_usage != $usage_old)) { $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); } diff --git a/include/validations/nomusage.inc.php b/include/validations/nomusage.inc.php index ef6662f..11d6b21 100644 --- a/include/validations/nomusage.inc.php +++ b/include/validations/nomusage.inc.php @@ -34,6 +34,7 @@ class UsageReq extends Validate var $oldalias; var $homonyme; + var $reason; var $rules = "Refuser tout ce qui n'est visiblement pas un nom de famille (ce qui est @@ -43,11 +44,12 @@ class UsageReq extends Validate // }}} // {{{ 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 = ""; diff --git a/templates/include/form.valid.nomusage.tpl b/templates/include/form.valid.nomusage.tpl index 649e7d0..090dc59 100644 --- a/templates/include/form.valid.nomusage.tpl +++ b/templates/include/form.valid.nomusage.tpl @@ -29,6 +29,10 @@ Nouvel alias : {$valid->alias|default:"suppression"} + + Raison : + {$valid->reason} + {if $valid->homonyme} diff --git a/templates/nomusage.tpl b/templates/nomusage.tpl index b99ba49..d5e4f90 100644 --- a/templates/nomusage.tpl +++ b/templates/nomusage.tpl @@ -71,7 +71,26 @@ Nom d'usage - + + + + + + + Raison du changement de nom + + + +
+ {if $usage_old} +
+ {/if} +
+
+ +