From: Vincent Zanotti Date: Sun, 19 Oct 2008 03:11:17 +0000 (+0200) Subject: Merge commit 'origin/master' into fusionax X-Git-Tag: xorg/1.0.0~332^2~503 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=acc9be56f2cc773f7e684f9cd3201141bc126ee2;p=platal.git Merge commit 'origin/master' into fusionax Conflicts: include/userset.inc.php modules/email.php templates/include/minifiche.tpl templates/include/plview.trombi.tpl templates/profile/profile.tpl Signed-off-by: Vincent Zanotti --- acc9be56f2cc773f7e684f9cd3201141bc126ee2 diff --cc ChangeLog index bd76ce4,164bcfd..0013ddb --- a/ChangeLog +++ b/ChangeLog @@@ -1,19 -1,10 +1,23 @@@ ================================================================================ +VERSION 0.f.0 XX XX XXXX + +New: + * Core: + - Centralises email management through an email combobox -JAC + +Bug/Wish: + * Profile: + - #188: Adds informations about the Corps d'État -JAC + - #209: Thoroughly changes education's implementation -JAC + - #386: Adds the possibility to fill in multiple nationalities -JAC + +================================================================================ VERSION 0.9.18 XX XX XXXX + New: + * Core: + - Introduction of 'hruid' as a replacement for 'forlife' -VZA + Bug/Wish: * Search: diff --cc bin/cron/checkdb.php index 66b74aa,f70e566..9d4794c --- a/bin/cron/checkdb.php +++ b/bin/cron/checkdb.php @@@ -81,9 -83,12 +81,13 @@@ check("SELECT u.user_id, nom, prenom, OR (profile_medals_pub != 'private' AND profile_medals_pub != 'public')", "Utilisateur n'ayant pas de flag de publicite pour leurs donnees de profil"); check("select uid from adresses where pub != 'private' and pub !='ax' and pub != 'public'", "Utiliseur n'ayant pas de flag de publicite pour une adresse"); -check("select uid from tels where tel_pub != 'private' and tel_pub !='ax' and tel_pub != 'public'", "Utiliseur n'ayant pas de flag de publicite pour un numero de telephone"); +check("select uid from profile_phones where pub != 'private' and pub != 'ax' and pub != 'public'", "Utiliseur n'ayant pas de flag de publicite pour un numero de téléphone"); +check("select uid from profile_networking where pub != 'private' and pub != 'public'", "Utiliseur n'ayant pas de flag de publicité pour une adresse de networking"); + /* validite des hruid */ + check("SELECT user_id, nom, prenom, promo FROM auth_user_md5 WHERE hruid IS NULL OR hruid = ''", + "Utilisateur n'ayant pas de hruid."); + /* validite de aliases */ check("SELECT a.* FROM aliases AS a diff --cc include/emails.combobox.inc.php index 1b05890,0000000..d91cf9b mode 100644,000000..100644 --- a/include/emails.combobox.inc.php +++ b/include/emails.combobox.inc.php @@@ -1,107 -1,0 +1,109 @@@ +id()); + $email_directory = $res->fetchOneCell(); + if ($email_directory) { + $page->assign('email_directory', $email_directory); + list($alias, $domain) = explode('@', $email_directory); + } else { + $page->assign('email_directory', ''); + $email_type = NULL; + $alias = $domain = ''; + } + + $res = XDB::query( + "SELECT alias + FROM virtual + INNER JOIN virtual_redirect USING(vid) - WHERE (redirect={?} OR redirect={?}) ++ WHERE (redirect = {?} OR redirect = {?}) + AND alias LIKE '%@{$globals->mail->alias_dom}'", - $forlife . '@' . $globals->mail->domain, $forlife . '@' . $globals->mail->domain2); ++ $user->forlifeEmail(), ++ // TODO: remove this über-ugly hack. The issue is that you need ++ // to remove all @m4x.org addresses in virtual_redirect first. ++ $user->login() . '@' . $globals->mail->domain2); + $melix = $res->fetchOneCell(); + if ($melix) { + list($melix) = explode('@', $melix); + $page->assign('melix', $melix); + if (($domain == $globals->mail->alias_dom) || ($domain == $globals->mail->alias_dom2)) { + $email_type = "melix"; + } + } + + $res = XDB::query( + "SELECT alias + FROM aliases - WHERE id={?} AND (type='a_vie' OR type='alias')", $uid); ++ WHERE id={?} AND (type='a_vie' OR type='alias')", $user->id()); + $res = $res->fetchAllAssoc(); + $page->assign('list_email_X', $res); + if (($domain == $globals->mail->domain) || ($domain == $globals->mail->domain2)) { + foreach ($res as $res_it) { + if ($alias == $res_it['alias']) { + $email_type = "X"; + } + } + } + + require_once 'emails.inc.php'; - $redirect = new Redirect($uid); ++ $redirect = new Redirect($user); + $redir = array(); + foreach ($redirect->emails as $redirect_it) { + if ($redirect_it instanceof EmailRedirection) { + $redir[] = $redirect_it->email; + if ($email_directory == $redirect_it->email) { + $email_type = "redir"; + } + } + } + $page->assign('list_email_redir', $redir); + + $res = XDB::query( + "SELECT email + FROM entreprises - WHERE uid={?}", $uid); ++ WHERE uid = {?}", $user->id()); + $res = $res->fetchAllAssoc(); + $pro = array(); + foreach ($res as $res_it) { + if ($res_it['email'] != '') { + $pro[] = $res_it['email']; + if ($email_directory == $res_it['email']) { + $email_type = "pro"; + } + } + } + $page->assign('list_email_pro', $pro); + + $page->assign('email_type', $email_type); +} + +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +?> diff --cc include/userset.inc.php index 5d66dc1,1fddfc3..e81fef2 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@@ -269,15 -245,8 +268,14 @@@ class MentorView extends MultipageVie public function fields() { - return "m.uid, u.promo, - a.alias AS bestalias, m.expertise, mp.pid, - ms.secteur, ms.ss_secteur, - return "m.uid, u.prenom, u.nom, u.promo, u.hruid, - m.expertise, mp.pid, ms.secteur, ms.ss_secteur"; ++ return "m.uid, u.promo, u.hruid, ++ m.expertise, mp.pid, ms.secteur, ms.ss_secteur, + nd.display AS name_display, nd.tooltip AS name_tooltip, nd.sort AS name_sort"; + } + + public function joins() + { + return "INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)"; } public function bounds() @@@ -319,7 -288,7 +317,7 @@@ class TrombiView extends MultipageVie public function fields() { - return "u.user_id, nd.display AS name_display, nd.tooltip AS name_tooltip, nd.sort AS name_sort, u.promo, a.alias AS forlife "; - return "u.user_id, IF(u.nom_usage != '', u.nom_usage, u.nom) AS nom, u.prenom, u.promo, u.hruid "; ++ return "u.user_id, nd.display AS name_display, nd.tooltip AS name_tooltip, nd.sort AS name_sort, u.promo, u.hruid "; } public function joins() @@@ -464,8 -432,8 +462,7 @@@ class GadgetView implements PlVie public function fields() { - return "u.user_id AS id, - u.*, a.alias AS forlife," . + return "u.user_id AS id, u.*," . - (S::logged() ? "q.profile_mobile AS mobile, " : "IF(q.profile_mobile_pub = 'public', q.profile_mobile, NULL) as mobile, ") . "u.perms != 'pending' AS inscrit, u.perms != 'pending' AS wasinscrit, u.deces != 0 AS dcd, u.deces, diff --cc modules/email.php index 09cfe6e,6f1e98d..3a0721e --- a/modules/email.php +++ b/modules/email.php @@@ -289,16 -303,13 +311,16 @@@ class EmailModule extends PLModul "SELECT alias,expire FROM aliases WHERE id={?} AND (type='a_vie' OR type='alias') - ORDER BY !FIND_IN_SET('usage',flags), LENGTH(alias)", $uid); - + ORDER BY !FIND_IN_SET('usage',flags), LENGTH(alias)", $user->id()); $page->assign('alias', $res->fetchAllAssoc()); - $page->assign('emails',$redirect->emails); + $page->assign('emails', $redirect->emails); + // Display GoogleApps acount information. require_once 'googleapps.inc.php'; - $page->assign('googleapps', GoogleAppsAccount::account_status($uid)); + $page->assign('googleapps', GoogleAppsAccount::account_status($user->id())); + + require_once 'emails.combobox.inc.php'; + fill_email_combobox($page); } function handler_antispam(&$page, $statut_filtre = null) diff --cc modules/search/classes.inc.php index 8383991,5f01c97..0fefe5d --- a/modules/search/classes.inc.php +++ b/modules/search/classes.inc.php @@@ -29,19 -29,11 +29,18 @@@ u.perms IN (\'admin\',\'user\', \'disabled\') AS inscrit, u.perms != \'pending\' AS wasinscrit, FIND_IN_SET(\'femme\', u.flags) AS sexe, -- a.alias AS forlife, - ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type, - ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type, + ede0.name AS eduname0, ede0.url AS eduurl0, edd0.degree AS edudegree0, + edu0.grad_year AS edugrad_year0, f0.field AS edufield0, edu0.program AS eduprogram0, + ede1.name AS eduname1, ede1.url AS eduurl1, edd1.degree AS edudegree1, + edu1.grad_year AS edugrad_year1, f1.field AS edufield1, edu1.program AS eduprogram1, + ede2.name AS eduname2, ede2.url AS eduurl2, edd2.degree AS edudegree2, + edu2.grad_year AS edugrad_year2, f2.field AS edufield2, edu2.program AS eduprogram2, + ede3.name AS eduname3, ede3.url AS eduurl3, edd3.degree AS edudegree3, + edu3.grad_year AS edugrad_year3, f3.field AS edufield3, edu3.program AS eduprogram3, es.label AS secteur, ef.fonction_fr AS fonction, - IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166, + IF(n1.nat=\'\',n1.pays,n1.nat) AS nat1, n1.a2 AS iso3166_1, + IF(n2.nat=\'\',n2.pays,n2.nat) AS nat2, n2.a2 AS iso3166_2, + IF(n3.nat=\'\',n3.pays,n3.nat) AS nat3, n3.a2 AS iso3166_3, (COUNT(em.email) > 0 OR FIND_IN_SET("googleapps", u.mail_storage) > 0) AS actif,'; // hide private information if not logged if (S::logged()) diff --cc templates/gadgets/ig-minifiche.tpl index c501e94c,2a403ee..f99e56b --- a/templates/gadgets/ig-minifiche.tpl +++ b/templates/gadgets/ig-minifiche.tpl @@@ -24,19 -24,13 +24,19 @@@
{if $c.sexe}•{/if} - {if !$c.dcd && $c.inscrit}{/if} + {if !$c.dcd && ($c.inscrit || $smarty.session.auth eq AUTH_PUBLIC)}{/if} {if $c.nom_usage}{$c.nom_usage} {$c.prenom}
({$c.nom}){else}{$c.nom} {$c.prenom}{/if} - {if !$c.dcd && $c.inscrit}
{/if} + {if !$c.dcd && ($c.inscrit || $smarty.session.auth eq AUTH_PUBLIC)}{/if}
- {if $c.iso3166} - {$c.nat}  + {if $c.iso3166_1} + {$c.nat1}  + {/if} + {if $c.iso3166_2} + {$c.nat2}  + {/if} + {if $c.iso3166_3} + {$c.nat3}  {/if} (X {$c.promo}) {if $c.dcd}décédé{if $c.sexe}e{/if} le {$c.deces|date_format}{/if} diff --cc templates/include/minifiche.tpl index bc3a644,9efa2fc..54aeb9b --- a/templates/include/minifiche.tpl +++ b/templates/include/minifiche.tpl @@@ -25,15 -25,15 +25,15 @@@
{if $smarty.session.auth ge AUTH_COOKIE}
- {$c.prenom} {$c.nom} + alt="{$c.name_display}" />
{/if} diff --cc templates/include/plview.trombi.tpl index 9c4bd58,bdedf25..7bd988c --- a/templates/include/plview.trombi.tpl +++ b/templates/include/plview.trombi.tpl @@@ -58,19 -58,19 +58,19 @@@ - + - {$set[trombi.index_prev].prenom} {$set[trombi.index_prev].nom}{if $trombi_with_promo} ({$set[trombi.index_prev].promo}){/if} + {$set[trombi.index_prev].name_display}{if $trombi_with_promo} ({$set[trombi.index_prev].promo}){/if} - + - {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if} + {$set[trombi].name_display}{if $trombi_with_promo} ({$set[trombi].promo}){/if} {if $set[trombi.index_next]} - + - {$set[trombi.index_next].prenom} {$set[trombi.index_next].nom}{if $trombi_with_promo} ({$set[trombi.index_next].promo}){/if} + {$set[trombi.index_next].name_display}{if $trombi_with_promo} ({$set[trombi.index_next].promo}){/if} {/if} @@@ -89,8 -89,8 +89,8 @@@ - + - {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if} + {$set[trombi].name_display}{if $trombi_with_promo} ({$set[trombi].promo}){/if} diff --cc templates/profile/profile.tpl index 54c6b07,ad3816d..25d28b6 --- a/templates/profile/profile.tpl +++ b/templates/profile/profile.tpl @@@ -71,19 -57,20 +71,19 @@@ function chgMainWinLoc(strPage
- {if $x.sexe}•{/if} + {if $user->isFemale()}•{/if} - {$user->fullName()}{if $x.nom_usage neq ""} ({$x.nom}){/if} + {$x.name_display} {if $logged} {if $x.nickname} (alias {$x.nickname}){/if} {/if} - {if $x.web} {icon name="world_go" title="Site Web"}{/if} {if $logged} -  {if !$x.dcd}{* +  {if !$x.dcd}{* *}{icon name=vcard title="Afficher la carte de visite"}{/if} {if !$x.is_contact} - + {icon name=add title="Ajouter à mes contacts"} {else} - + {icon name=cross title="Retirer de mes contacts"} {/if} {if hasPerm('admin')} @@@ -131,29 -120,19 +131,29 @@@
{/if}
- {if $x.iso3166} - {$x.nationalite}  + {if $x.iso3166_1} + {$x.nationalite}  + {/if} + {if $x.iso3166_2} + {$x.nationalite2}  + {/if} + {if $x.iso3166_3} + {$x.nationalite3}  {/if} - X {$x.promo} - {if ($x.promo_sortie-3 > $x.promo)} + X {$user->promo()} + {if $x.promo_sortie && ($x.promo_sortie-3 > $x.promo)} - X {math equation="a-b" a=$x.promo_sortie b=3} {/if} - {if $x.applis_join} -  - Formation : {$x.applis_join|smarty:nodefaults} + {if $x.education} +  - Formation : {$x.education|smarty:nodefaults} {/if} {if $logged && $x.is_referent} - [Ma fiche référent] + [Ma fiche référent] {/if} + {if $x.corps} +
+ {$x.corps|smarty:nodefaults} + {/if}
{if $x.adr}