X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fnotifs.inc.php;h=b114ae5dab05aa657477e3e82feb7d1ee8eb65ed;hb=cafb410fea6f257f45da08631c6cdb5c35f86b17;hp=045adee37fc7aafdfad7e5f484e8f691a089bdba;hpb=92d3e726a6cc8fbf6b5cc873ad0a73c8dd4f6b08;p=platal.git diff --git a/include/notifs.inc.php b/include/notifs.inc.php index 045adee..b114ae5 100644 --- a/include/notifs.inc.php +++ b/include/notifs.inc.php @@ -74,8 +74,9 @@ class WatchProfileUpdate extends WatchOperation public static function register(Profile &$profile, $field) { - XDB::execute('REPLACE INTO watch_profile (pid, ts, field) - VALUES ({?}, NOW(), {?})', + XDB::execute('INSERT INTO watch_profile (pid, ts, field) + VALUES ({?}, NOW(), {?}) + ON DUPLICATE KEY UPDATE ts = NOW()', $profile->id(), $field); } @@ -99,23 +100,6 @@ class WatchProfileUpdate extends WatchOperation return $user->profile()->last_change; } - static private $descriptions = 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', - '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'); public function getData(PlUser &$user) { $data = XDB::fetchColumn("SELECT field @@ -128,7 +112,7 @@ class WatchProfileUpdate extends WatchOperation } else { $text = array(); foreach ($data as $f) { - $text[] = self::$descriptions[$f]; + $text[] = Profile::$descriptions[$f]; } return $text; }