}
global $globals;
- $res = XDB::query("SELECT u.hruid, u.promo,
+ $res = XDB::query("SELECT u.hruid, d.promo_display AS promo,
CONCAT(af.alias, '@{$globals->mail->domain}') AS forlife,
CONCAT(ab.alias, '@{$globals->mail->domain}') AS bestalias,
CONCAT(u.prenom, ' ', IF(u.nom_usage <> '', u.nom_usage, u.nom)) AS full_name,
q.core_mail_fmt AS email_format,
u.perms
FROM auth_user_md5 AS u
+ INNER JOIN profile_display AS d ON (d.uid = u.user_id)
LEFT JOIN auth_user_quick AS q ON (q.user_id = u.user_id)
LEFT JOIN aliases AS af ON (af.id = u.user_id AND af.type = 'a_vie')
LEFT JOIN aliases AS ab ON (ab.id = u.user_id AND FIND_IN_SET('bestalias', ab.flags))
function &get_user_details($login, $from_uid = '', $view = 'private')
{
- $reqsql = "SELECT u.user_id, u.promo, u.promo_sortie, u.prenom, u.nom, u.nom_usage, u.date, u.cv,
+ $reqsql = "SELECT u.user_id, d.promo_display, u.prenom, u.nom, u.nom_usage, u.date, u.cv,
u.perms IN ('admin','user','disabled') AS inscrit, FIND_IN_SET('femme', u.flags) AS sexe, u.deces != 0 AS dcd, u.deces,
q.profile_nick AS nickname, q.profile_from_ax, q.profile_freetext AS freetext,
q.profile_freetext_pub AS freetext_pub,
m.expertise != '' AS is_referent,
(COUNT(e.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif,
nd.display AS name_display, nd.tooltip AS name_tooltip
- FROM auth_user_md5 AS u
- INNER JOIN auth_user_quick AS q USING(user_id)
- INNER JOIN aliases AS a ON (u.user_id = a.id AND a.type = 'a_vie')
- INNER JOIN aliases AS a2 ON (u.user_id = a2.id AND FIND_IN_SET('bestalias', a2.flags))
- LEFT JOIN contacts AS c ON (c.uid = {?} and c.contact = u.user_id)
- LEFT JOIN profile_corps AS co ON (co.uid = u.user_id)
- LEFT JOIN geoloc_pays AS gp1 ON (gp1.a2 = u.nationalite)
- LEFT JOIN geoloc_pays AS gp2 ON (gp2.a2 = u.nationalite2)
- LEFT JOIN geoloc_pays AS gp3 ON (gp3.a2 = u.nationalite3)
- INNER JOIN sections AS s ON (s.id = u.section)
- LEFT JOIN photo AS p ON (p.uid = u.user_id)
- LEFT JOIN mentor AS m ON (m.uid = u.user_id)
- LEFT JOIN emails AS e ON (e.uid = u.user_id AND e.flags='active')
- INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)
+ FROM auth_user_md5 AS u
+ INNER JOIN auth_user_quick AS q USING(user_id)
+ INNER JOIN aliases AS a ON (u.user_id = a.id AND a.type = 'a_vie')
+ INNER JOIN aliases AS a2 ON (u.user_id = a2.id AND FIND_IN_SET('bestalias', a2.flags))
+ LEFT JOIN contacts AS c ON (c.uid = {?} and c.contact = u.user_id)
+ LEFT JOIN profile_corps AS co ON (co.uid = u.user_id)
+ LEFT JOIN geoloc_pays AS gp1 ON (gp1.a2 = u.nationalite)
+ LEFT JOIN geoloc_pays AS gp2 ON (gp2.a2 = u.nationalite2)
+ LEFT JOIN geoloc_pays AS gp3 ON (gp3.a2 = u.nationalite3)
+ INNER JOIN sections AS s ON (s.id = u.section)
+ LEFT JOIN photo AS p ON (p.uid = u.user_id)
+ LEFT JOIN mentor AS m ON (m.uid = u.user_id)
+ LEFT JOIN emails AS e ON (e.uid = u.user_id AND e.flags='active')
+ INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)
+ INNER JOIN profile_display AS d ON (d.uid = u.user_id)
WHERE a.alias = {?}
GROUP BY u.user_id";
$res = XDB::query($reqsql, $from_uid, $login);
$uid = $user['user_id'];
// hide orange status, cv, nickname, section
if (!has_user_right('private', $view)) {
- $user['promo_sortie'] = $user['promo'] + 3;
$user['cv'] = '';
$user['nickname'] = '';
$user['section'] = '';
public function fields()
{
global $globals;
- return "u.user_id AS id, u.*,
- CONCAT(a.alias, '@{$globals->mail->domain}') AS bestemail,
+ return "u.user_id AS id, u.*, d.promo_display,
u.perms != 'pending' AS inscrit,
u.perms != 'pending' AS wasinscrit,
u.deces != 0 AS dcd, u.deces, u.matricule_ax,
LEFT JOIN geoloc_pays AS gp ON (adr.country = gp.a2)
LEFT JOIN geoloc_region AS gr ON (adr.country = gr.a2 AND adr.region = gr.region)
LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = 'active')
- INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)" .
- (S::logged() ?
- "LEFT JOIN contacts AS c ON (c.contact = u.user_id AND c.uid = " . S::v('uid') . ")"
+ INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)
+ INNER JOIN profile_display AS d ON (d.uid = u.user_id)" . (S::logged() ?
+ "LEFT JOIN contacts AS c ON (c.contact = u.user_id AND c.uid = " . S::v('uid') . ")"
: "");
}
public function fields()
{
- return "m.uid, u.promo, u.hruid,
+ return "m.uid, d.promo_display, 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)";
+ return "INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)
+ INNER JOIN profile_display AS d ON (d.uid = u.user_id)";
}
public function bounds()
public function fields()
{
- return "u.user_id, nd.display AS name_display, nd.tooltip AS name_tooltip, nd.sort AS name_sort, 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, d.promo_display, u.hruid ";
}
public function joins()
{
- return "INNER JOIN photo AS p ON (p.uid = u.user_id)
+ return "INNER JOIN photo AS p ON (p.uid = u.user_id)
+ INNER JOIN profile_display AS d ON (d.uid = u.user_id)
INNER JOIN profile_names_display AS nd ON (nd.user_id = u.user_id)";
}
header('Content-Type: text/xml');
header('Pragma:');
$only_current = Env::v('only_current', false)? ' AND FIND_IN_SET(\'active\', adrf.statut)' : '';
- $it =& $this->set->get('u.user_id AS id, u.prenom, u.nom, u.promo, al.alias',
- "INNER JOIN adresses AS adrf ON (adrf.uid = u.user_id $only_current)
- LEFT JOIN aliases AS al ON (u.user_id = al.id
- AND FIND_IN_SET('bestalias', al.flags))
- INNER JOIN adresses AS avg ON (" . getadr_join('avg') . ")",
+ $it =& $this->set->get('u.user_id AS id, u.prenom, u.nom, d.promo_display, al.alias',
+ "INNER JOIN adresses AS adrf ON (adrf.uid = u.user_id $only_current)
+ INNER JOIN profile_display AS d ON (d.uid = u.user_id)
+ LEFT JOIN aliases AS al ON (u.user_id = al.id
+ AND FIND_IN_SET('bestalias', al.flags))
+ INNER JOIN adresses AS avg ON (" . getadr_join('avg') . ")",
'adrf.cityid = ' . Env::i('cityid'), null, null, 11);
$page->assign('users', $it);
break;
$this->stamp = date('YmdHis');
$this->unique = $_unique;
$this->type = $_type;
+ $res = XDB::query("SELECT promo_display AS promo
+ FROM profile_display
+ WHERE uid={?}", $_uid);
+ $this->promo = $res->fetchOneCell();
}
// }}}
public $promo_sortie;
- public $rules = "A priori accepter (la validation sert à repousser les
- petits malins). Refuse si tu connais la personne et que tu es sure
+ public $rules = "À priori accepter (la validation sert à repousser les
+ petits malins). Refuse si tu connais la personne et que tu es sûr
qu'elle n'est pas orange.";
// }}}
{
parent::__construct($_user, true, 'orange');
$this->promo_sortie = $_sortie;
- $res = XDB::query("SELECT promo FROM auth_user_md5 WHERE user_id = {?}", $_user->id());
+ $res = XDB::query("SELECT entry_year
+ FROM profile_education
+ WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $_uid);
+ $this->promo = $res->fetchOneCell();
}
// }}}
protected function _mail_body($isok)
{
if ($isok) {
- $res = " La demande de changement de promo de sortie que tu as demandée vient d'être effectuée.";
- return $res;
+ return " La demande de changement de promotion de sortie que tu as demandée vient d'être effectuée. "
+ . "Si tu le souhaites, tu peux maintenant modifier l'affichage de ta promotion sur le site sur la page suivante : "
+ . "https://www.polytechnique.org/profile/edit";
} else {
- return " La demande de changement de promo de sortie tu avais faite a été refusée.";
+ return " La demande de changement de promotion de sortie tu avais faite a été refusée.";
}
}
public function commit()
{
- XDB::execute("UPDATE auth_user_md5 set promo_sortie = {?} WHERE user_id = {?}",$this->promo_sortie, $this->user->id());
+ XDB::execute("UPDATE profile_education
+ SET grad_year = {?}
+ WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->promo_sortie, $this->uid);
return true;
}
$action = Env::v('valid_promo') == 'Ajouter des membres' ? 'add' : 'ax';
pl_redirect('admin/promo/' . $action . '/' . Env::i('promo'));
} else {
- $page->trigError('Promo non valide');
+ $page->trigError('Promotion non valide.');
}
}
// Fetch the events to display, along with their metadata.
$array = array();
- $it = XDB::iterator("SELECT e.id,e.titre,e.texte,e.post_id,a.user_id,a.nom,a.prenom,a.promo,a.hruid,
+ $it = XDB::iterator("SELECT e.id, e.titre, e.texte, e.post_id, a.user_id, a.nom, a.prenom, d.promo_display ,a.hruid,
p.x, p.y, p.attach IS NOT NULL AS img, FIND_IN_SET('wiki', e.flags) AS wiki,
FIND_IN_SET('important', e.flags) AS important,
e.creation_date > DATE_SUB(CURDATE(), INTERVAL 2 DAY) AS news,
e.peremption < DATE_ADD(CURDATE(), INTERVAL 2 DAY) AS end,
ev.user_id IS NULL AS nonlu
FROM evenements AS e
- LEFT JOIN evenements_photo AS p ON (e.id = p.eid)
- INNER JOIN auth_user_md5 AS a ON e.user_id=a.user_id
- LEFT JOIN evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
+ LEFT JOIN evenements_photo AS p ON (e.id = p.eid)
+ INNER JOIN auth_user_md5 AS a ON (e.user_id = a.user_id)
+ INNER JOIN profile_display AS d ON (d.uid = a.user_id)
+ LEFT JOIN evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
WHERE FIND_IN_SET('valide', e.flags) AND peremption >= NOW()
AND (e.promo_min = 0 || e.promo_min <= {?})
AND (e.promo_max = 0 || e.promo_max >= {?})
require_once 'validations.inc.php';
- $res = XDB::query(
- "SELECT u.promo, u.promo_sortie
- FROM auth_user_md5 AS u
- WHERE user_id={?}", S::v('uid'));
+ $res = XDB::query("SELECT e.entry_year, e.grad_year, d.promo_display, FIND_IN_SET('femme', u.flags) AS sexe
+ FROM auth_user_md5 AS u
+ INNER JOIN profile_display AS d ON (d.uid = u.user_id)
+ INNER JOIN profile_education AS e ON (e.uid = u.user_id AND FIND_IN_SET('primary', e.flags))
+ WHERE u.user_id = {?}", S::v('uid'));
- list($promo, $promo_sortie_old) = $res->fetchOneRow();
+ list($promo, $promo_sortie_old, $promo_display, $sexe) = $res->fetchOneRow();
$page->assign('promo_sortie_old', $promo_sortie_old);
- $page->assign('promo', $promo);
+ $page->assign('promo', $promo);
+ $page->assign('promo_display', $promo_display);
+ $page->assign('sexe', $sexe);
if (!Env::has('promo_sortie')) {
return;
$promo_sortie = Env::i('promo_sortie');
if ($promo_sortie < 1000 || $promo_sortie > 9999) {
- $page->trigError('L\'année de sortie doit être un nombre de quatre chiffres');
+ $page->trigError('L\'année de sortie doit être un nombre de quatre chiffres.');
}
elseif ($promo_sortie < $promo + 3) {
- $page->trigError('Trop tôt');
+ $page->trigError('Trop tôt !');
}
elseif ($promo_sortie == $promo_sortie_old) {
$page->trigWarning('Tu appartiens déjà à la promotion correspondante à cette année de sortie.');
}
elseif ($promo_sortie == $promo + 3) {
- XDB::execute(
- "UPDATE auth_user_md5 set promo_sortie={?}
- WHERE user_id={?}", $promo_sortie, S::v('uid'));
+ XDB::execute("UPDATE profile_education
+ SET grad_year = {?}
+ WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $promo_sortie, S::v('uid'));
$page->trigSuccess('Ton statut "orange" a été supprimé.');
$page->assign('promo_sortie_old', $promo_sortie);
}
$value = array();
$res = XDB::iterator("SELECT eduid, degreeid, fieldid, grad_year, program
FROM profile_education
- WHERE uid = {?}
+ WHERE uid = {?} AND !FIND_IN_SET('primary', flags)
ORDER BY id",
S::v('uid'));
while($edu = $res->next()) {
public function save(ProfilePage &$page, $field, $value)
{
XDB::execute("DELETE FROM profile_education
- WHERE uid = {?}",
+ WHERE uid = {?} AND !FIND_IN_SET('primary', flags)",
S::i('uid'));
foreach ($value as $eduid=>&$edu) {
if ($edu['eduid'] != '') {
= $this->settings['display_name']
= $this->settings['sort_name']
= $this->settings['tooltip_name']
+ = $this->settings['promo_display']
= null;
$this->settings['synchro_ax']
= new ProfileBool();
protected function _fetchData()
{
// Checkout all data...
- $res = XDB::query("SELECT u.promo, u.promo_sortie, u.nom_usage, u.nationalite,
- u.nationalite2, u.nationalite3, u.naissance,
+ $res = XDB::query("SELECT p.promo_display, e.entry_year AS entry_year, e.grad_year AS grad_year,
+ u.nom_usage, u.nationalite, u.nationalite2, u.nationalite3, u.naissance,
t.display_tel as mobile, t.pub as mobile_pub,
d.email_directory as email_directory,
q.profile_freetext as freetext, q.profile_freetext_pub as freetext_pub,
n.yourself, n.display AS display_name, n.sort AS sort_name,
n.tooltip AS tooltip_name
FROM auth_user_md5 AS u
- INNER JOIN auth_user_quick AS q ON(u.user_id = q.user_id)
- INNER JOIN profile_names_display AS n ON(n.user_id = u.user_id)
- LEFT JOIN profile_phones AS t ON(u.user_id = t.uid AND link_type = 'user')
- LEFT JOIN profile_directory AS d ON(d.uid = u.user_id)
+ INNER JOIN auth_user_quick AS q ON (u.user_id = q.user_id)
+ INNER JOIN profile_names_display AS n ON (n.user_id = u.user_id)
+ INNER JOIN profile_display AS p ON (p.uid = u.user_id)
+ INNER JOIN profile_education AS e ON (e.uid = u.user_id AND FIND_IN_SET('primary', e.flags))
+ LEFT JOIN profile_phones AS t ON (u.user_id = t.uid AND link_type = 'user')
+ LEFT JOIN profile_directory AS d ON (d.uid = u.user_id)
WHERE u.user_id = {?}", S::v('uid', -1));
$this->values = $res->fetchOneAssoc();
ORDER BY t.tel_id",
S::v('uid'));
$this->values['tels'] = $res->fetchAllAssoc();
+
+ // Proposes choice for promo_display
+ if ($this->values['entry_year'] != $this->values['grad_year'] - 3) {
+ for ($i = $this->values['entry_year']; $i < $this->values['grad_year'] - 2; $i++) {
+ $this->values['promo_choice'][] = "X" . $i;
+ }
+ }
}
protected function _saveData()
$this->values['nationalite3'] = NULL;
}
- XDB::execute("UPDATE auth_user_md5
- SET nationalite = {?}, nationalite2 = {?}, nationalite3 = {?}, nom={?}, prenom={?}, naissance={?}
- WHERE user_id = {?}",
- $this->values['nationalite'], $this->values['nationalite2'], $this->values['nationalite3'],
- $this->values['nom'], $this->values['prenom'],
- preg_replace('@(\d{2})/(\d{2})/(\d{4})@', '\3-\2-\1', $this->values['naissance']),
- S::v('uid'));
+ XDB::execute("UPDATE auth_user_md5
+ SET nationalite = {?}, nationalite2 = {?}, nationalite3 = {?}, nom={?}, prenom={?}, naissance={?}
+ WHERE user_id = {?}",
+ $this->values['nationalite'], $this->values['nationalite2'], $this->values['nationalite3'],
+ $this->values['nom'], $this->values['prenom'],
+ preg_replace('@(\d{2})/(\d{2})/(\d{4})@', '\3-\2-\1', $this->values['naissance']),
+ S::v('uid'));
}
if ($this->changed['nick'] || $this->changed['freetext'] || $this->changed['freetext_pub'] || $this->changed['synchro_ax']) {
XDB::execute("UPDATE auth_user_quick
}
if ($this->changed['yourself'] || $this->changed['sort_name'] ||
$this-> changed['display_name'] || $this->changed['tooltip_name']) {
- XDB::execute("UPDATE profile_names_display AS n
- SET n.yourself = {?},
- n.sort = {?}, ". // SET
- "n.display = {?}, ". // SET
- "n.tooltip = {?} ". // SET
- "WHERE n.user_id = {?}",
- $this->values['yourself'],
- $this->values['sort_name'],
- $this->values['display_name'],
- $this->values['tooltip_name'],
- S::v('uid'));
+ XDB::execute("UPDATE profile_names_display AS n
+ SET n.yourself = {?},
+ n.sort = {?}, ". // SET
+ "n.display = {?}, ". // SET
+ "n.tooltip = {?} ". // SET
+ "WHERE n.user_id = {?}",
+ $this->values['yourself'],
+ $this->values['sort_name'],
+ $this->values['display_name'],
+ $this->values['tooltip_name'],
+ S::v('uid'));
+ }
+ if ($this->changed['promo_display']) {
+ XDB::execute("UPDATE profile_display
+ SET promo_display = {?}
+ WHERE uid = {?}",
+ $this->values['promo_display'], S::v('uid'));
}
}
</div>
Annonce proposée par
<a href="profile/{$ev.hruid}" class="popup2">
- {$ev.prenom} {$ev.nom} X{$ev.promo}
+ {$ev.prenom} {$ev.nom} {$ev.promo_display}
</a>
</td>
</tr>
{if $c.iso3166_3}
<img src='images/flags/{$c.iso3166_3}.gif' alt='{$c.nat3}' height='11' title='{$c.nat3}' />
{/if}
- X {$c.promo}{if $c.eduname0}, {education_fmt name=$c.eduname0 url=$c.eduurl0 degree=$c.edudegree0
+ {$c.promo_display}{if $c.eduname0}, {education_fmt name=$c.eduname0 url=$c.eduurl0 degree=$c.edudegree0
grad_year=$c.edugrad_year0 field=$c.edufield0 program=$c.eduprogram0 sexe=$c.sexe}{*
*}{/if}{if $c.eduname1}, {education_fmt name=$c.eduname1 url=$c.eduurl1 degree=$c.edudegree1
grad_year=$c.edugrad_year1 field=$c.edufield1 program=$c.eduprogram1 sexe=$c.sexe}{*
<span {if $p.name_tooltip}class="hinted" title="{$p.name_tooltip}"{/if}>{$p.name_display}</span>
</div>
<div class="edu">
- X{$p.promo}
+ {$p.promo_display}
</div>
<div class="bits" style="width: 40%;">
<span class='smaller'>
<tr>
<td class="center" style="vertical-align: bottom; padding-bottom: 15px">
<a href="{$mainsiteurl}profile/{$set[trombi.index_prev].hruid}" class="popup2">
- <span {if $set[trombi.index_prev].name_tooltip}class="hinted" title="{$set[trombi.index_prev].name_tooltip}"{/if}>{$set[trombi.index_prev].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_prev].promo}){/if}
+ <span {if $set[trombi.index_prev].name_tooltip}class="hinted"
+ title="{$set[trombi.index_prev].name_tooltip}"{/if}>{$set[trombi.index_prev].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_prev].promo_display}){/if}
</a>
</td>
<td class="center" style="vertical-align: bottom; padding-bottom: 15px">
<a href="{$mainsiteurl}profile/{$set[trombi].hruid}" class="popup2">
- <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo}){/if}
+ <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo_display}){/if}
</a>
</td>
<td class="center" style="vertical-align: bottom; padding-bottom: 15px">
{if $set[trombi.index_next]}
<a href="{$mainsiteurl}profile/{$set[trombi.index_next].hruid}" class="popup2">
- <span {if $set[trombi.index_next].name_tooltip}class="hinted" title="{$set[trombi.index_next].name_tooltip}"{/if}>{$set[trombi.index_next].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_next].promo}){/if}
+ <span {if $set[trombi.index_next].name_tooltip}class="hinted" title="{$set[trombi.index_next].name_tooltip}"{/if}>{$set[trombi.index_next].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_next].promo_display}){/if}
</a>
{/if}
</td>
<tr style="margin-top: 0; padding-top: 0">
<td class="center" style="vertical-align: bottom">
<a href="{$mainsiteurl}profile/{$set[trombi].hruid}" class="popup2">
- <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo}){/if}
+ <a href="{$mainsiteurl}profile/{$set[trombi].forlife}" class="popup2">
+ <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo_display}){/if}
</a>
</td>
<td></td><td></td>
{/if}
<br />
<a href="{if $urlmainsite}{$urlmainsite}{/if}profile/{$p.forlife}" class="popup2">
- <span {if $p.name_tooltip}class="hinted" title="{$p.name_tooltip}"{/if}>{$p.name_display}</span>{if $trombi_show_promo} ({$p.promo}){/if}
+ <span {if $p.name_tooltip}class="hinted" title="{$p.name_tooltip}"{/if}>{$p.name_display}</span>{if $trombi_show_promo} ({$p.promo_display}){/if}
</a>
</td>
{if $loop eq "3"}
<span class="titre">Promotion</span>
</td>
<td>
- <span class="nom">X{$promo}{if ($promo != $promo_sortie - 3)} - X{math equation="a - b" a=$promo_sortie b=3}{/if}</span>
- <span class="lien"><a href="profile/orange" {if ($promo_sortie -3 == $promo)} {popup text="pour les oranges"}{/if}>{icon name="page_edit" title="modifier"}</a></span>
+ {if !$promo_choice}
+ <span class="nom">{$promo_display}</span>
+ {else}
+ <select name="promo_display">
+ {foreach from=$promo_choice item="promo_to_display"}
+ <option value="{$promo_to_display}" {if $promo_to_display eq $promo_display}selected="selected"{/if}>{$promo_to_display}</option>
+ {/foreach}
+ </select>
+ {/if}
+ <span class="lien"><a href="profile/orange" {if ($grad_year -3 == $entry_year)} {popup text="pour les oranges"}{/if}>{icon name="page_edit" title="modifier"}</a></span>
</td>
</tr>
<tr>
{else}
<p>
- Afin de pouvoir être considéré(e) à la fois dans ta promotion d'origine et ta
+ Afin de pouvoir être considéré{if $sexe}e{/if} à la fois dans ta promotion d'origine et ta
ou tes promotions d'adoption tu peux entrer ici ton année de sortie de l'école.
Plus précisément, il s'agit de l'année d'entrée en quatrième année ou année d'application.
- Pour tes cocons d'origine (X{$promo}) il s'agit de l'année {math equation="a + b" a=$promo b=3}.
+ Pour tes cocons d'origine ({$promo_display}) il s'agit de l'année {math equation="a + b" a=$promo b=3}.
</p>
<br />
{if $x.iso3166_3}
<img src='images/flags/{$x.iso3166_3}.gif' alt='{$x.nationalite3}' height='11' title='{$x.nationalite3}' />
{/if}
- X {$user->promo()}
- {if $x.promo_sortie && ($x.promo_sortie-3 > $x.promo)}
- - X {math equation="a-b" a=$x.promo_sortie b=3}
+ {$user->promo()}
+ {if $logged && $x.is_referent}
+ [<a href="referent/{$x.forlife}" class='popup2'>Ma fiche référent</a>]
{/if}
- {if $logged && $x.is_referent}
- [<a href="referent/{$user->login()}" class='popup2'>Ma fiche référent</a>]
- {/if}
{if $x.education}
- Formation :
<ul>
) CHARSET=utf8;
CREATE TABLE IF NOT EXISTS profile_education (
- id INT(2) NOT NULL DEFAULT 0,
+ id TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
uid INT(11) NOT NULL DEFAULT 0,
eduid INT(4) NOT NULL DEFAULT 0,
degreeid INT(4) NOT NULL DEFAULT 0,
--- /dev/null
+INSERT INTO profile_education (id, uid, grad_year, entry_year, eduid, degreeid, flags)
+ SELECT 100, user_id, promo_sortie, promo, 20, 2, 'primary'
+ FROM auth_user_md5;
+
+CREATE TABLE profile_display (
+ uid INT(11) NOT NULL DEFAULT 0,
+ promo_display VARCHAR(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY(uid)
+) CHARSET=utf8;
+
+INSERT IGNORE INTO profile_display (uid, promo_display)
+ SELECT uid, CONCAT("X", entry_year)
+ FROM profile_education
+ WHERE FIND_IN_SET('primary', flags);
+
+-- vim:set syntax=mysql: