-// }}}
-// {{{ function getNbNotifs
-
-function getNbNotifs() {
- global $globals;
- if (!Session::has('uid')) {
- return 0;
- }
- $uid = Session::getInt('uid', -1);
- $watchlast = Session::get('watch_last');
-
- // selectionne les notifs de uid, sans detail sur le watcher, depuis $watchlast, meme ceux sans surveillance, non ordonnés
- $res = select_notifs(false, $uid, $watchlast, false);
- $n = $res->numRows();
- $res->free();
- $url = smarty_modifier_url('carnet/panel.php');
- if($n==0) { return; }
- if($n==1) { return "<a href='$url'>1 évènement !</a>"; }
- return "<a href='$url'>$n évènements !</a>";
+ public function getOrder()
+ {
+ if (!self::$order) {
+ self::$order = new UFO_ProfileUpdate();
+ }
+ return self::$order;
+ }
+
+ public function getDate(PlUser &$user)
+ {
+ 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
+ FROM watch_profile
+ WHERE pid = {?} AND ts > FROM_UNIXTIME({?}) AND field != ''
+ ORDER BY ts",
+ $user->profile()->id(), $this->date);
+ if (count($data) == 0) {
+ return null;
+ } else {
+ $text = array();
+ foreach ($data as $f) {
+ $text[] = self::$descriptions[$f];
+ }
+ return $text;
+ }
+ }