From: Florent Bruneau Date: Wed, 24 Oct 2007 18:24:37 +0000 (+0200) Subject: Close #732: Adapt subscription text to the sex of the subscriber X-Git-Tag: xorg/0.9.16~259 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=3c0031cd03af02a143dc663e8a4d58a00940c12c;p=platal.git Close #732: Adapt subscription text to the sex of the subscriber Signed-off-by: Florent Bruneau --- diff --git a/ChangeLog b/ChangeLog index 8a290eb..baa1eee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,11 @@ New: * Carnet: - List updated fields in notifications -FRU +Bug/Wish: + + * XnetGrp: + - #732: Adapt subscription text to sex -FRU + ================================================================================ VERSION 0.9.15 08 10 2007 diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index d9700ad..db37f2a 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -475,13 +475,12 @@ class XnetGrpModule extends PLModule if (!is_null($u) && may_update()) { $page->assign('u', $u); - $res = XDB::query("SELECT nom, prenom, promo, user_id - FROM auth_user_md5 AS u - INNER JOIN aliases AS al ON (al.id = u.user_id - AND al.type != 'liste') - WHERE al.alias = {?}", $u); + $res = XDB::query("SELECT u.nom, u.prenom, u.promo, u.user_id, FIND_IN_SET('femme', u.flags) + FROM auth_user_md5 AS u + INNER JOIN aliases AS al ON (al.id = u.user_id AND al.type != 'liste') + WHERE al.alias = {?}", $u); - if (list($nom, $prenom, $promo, $uid) = $res->fetchOneRow()) { + if (list($nom, $prenom, $promo, $uid, $sexe) = $res->fetchOneRow()) { $res = XDB::query("SELECT COUNT(*) FROM groupex.membres AS m INNER JOIN aliases AS a ON (m.uid = a.id AND a.type != 'homonyme') @@ -502,7 +501,7 @@ class XnetGrpModule extends PLModule $mailer->setFrom('"'.S::v('prenom').' '.S::v('nom') .'" <'.S::v('forlife').'@polytechnique.org>'); $mailer->setSubject('['.$globals->asso('nom').'] Demande d\'inscription'); - $message = "Cher Camarade,\n" + $message = ($sexe ? 'Chère' : 'Cher') . " Camarade,\n" . "\n" . " Suite à ta demande d'adhésion à ".$globals->asso('nom').",\n" . "j'ai le plaisir de t'annoncer que ton inscription a été validée !\n" @@ -511,7 +510,7 @@ class XnetGrpModule extends PLModule . "{$_SESSION["prenom"]} {$_SESSION["nom"]}."; $mailer->setTxtBody($message); $mailer->send(); - $page->kill("$prenom $nom a bien été inscrit"); + $page->kill("$prenom $nom a bien été inscrit" . ($sexe ? 'e' : '')); } elseif (Env::has('refuse')) {