X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fnotifs.inc.php;h=cf3023df891fb5621130fd02cf17b496cea173d7;hb=1dc71da137a384e771723b8a893539a7f5cc9fab;hp=eb70cc89ad1fded60a0d0833fdd7bc5b47a5c8ba;hpb=64087a3430249f84d999be01219697c925c5c7f7;p=platal.git diff --git a/include/notifs.inc.php b/include/notifs.inc.php index eb70cc8..cf3023d 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -34,25 +34,33 @@ function inscription_notifs_base($uid) // }}} // {{{ function register_watch_op -function register_watch_op($uid, $cid, $date='', $info='') +function register_watch_op($uid, $cid, $date = '', $info = '') { if (empty($date)) { $date = date('Y-m-d'); - }; - XDB::execute('REPLACE INTO watch_ops (uid,cid,known,date,info) + } + XDB::execute('REPLACE INTO watch_ops (uid, cid, known, date, info) VALUES ({?}, {?}, NOW(), {?}, {?})', $uid, $cid, $date, $info); - if($cid == WATCH_FICHE) { + if ($cid == WATCH_FICHE) { if ($info) { register_profile_update($uid, $info); } - XDB::execute('UPDATE auth_user_md5 SET DATE=NOW() WHERE user_id={?}', $uid); - } elseif($cid == WATCH_INSCR) { - XDB::execute('REPLACE INTO contacts (uid,contact) - SELECT uid,ni_id + XDB::execute('UPDATE auth_user_md5 + SET DATE = NOW() + WHERE user_id = {?}', $uid); + } elseif ($cid == WATCH_INSCR) { + XDB::execute('REPLACE INTO contacts (uid, contact) + SELECT uid, ni_id FROM watch_nonins - WHERE ni_id={?}', $uid); - XDB::execute('DELETE FROM watch_nonins WHERE ni_id={?}', $uid); + WHERE ni_id = {?}', $uid); + XDB::execute('DELETE FROM watch_nonins + WHERE ni_id = {?}', $uid); + } elseif ($cid == WATCH_DEATH) { + // We delete nonins watches both for the dead (if non registered), and + // for people watched by the dead. + XDB::execute('DELETE FROM watch_nonins + WHERE ni_id = {?} OR uid = {?}', $uid); } Platal::session()->updateNbNotifs(); } @@ -138,19 +146,21 @@ function select_notifs($mail, $uid=null, $last=null, $iterator=true) // {{{ global $prf_desc; -$prf_desc = array('nom' => 'Son patronyme', +$prf_desc = array('search_names' => 'L\'un de ses noms', 'freetext' => 'Le texte libre', 'mobile' => 'Son numéro de téléphone portable', 'nationalite' => 'Sa nationalité', + 'nationalite2' => 'Sa seconde nationalité', + 'nationalite3' => 'Sa troisième nationalité', 'nick' => 'Son surnom', - 'web' => 'L\'adresse de son site web', - 'appli1' => 'Son école d\'application', - 'appli2' => 'Son école de post-application', + 'networking' => 'La liste de ses adresses de networking', + 'edus' => 'Ses formations', 'addresses' => 'Ses adresses', 'section' => 'Sa section sportive', 'binets' => 'La liste de ses binets', 'medals' => 'Ses décorations', 'cv' => 'Son Curriculum Vitae', + 'corps' => 'Son Corps d\'État', 'jobs' => 'Ses informations professionnelles', 'photo' => 'Sa photographie');