X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fprofile.php;h=249de86e58336680d22dfaaf180472609c63ea34;hb=e4860774e45eac2d62cf80d4fd70fac2e0cf1da1;hp=73a9fff6f7d7830c2c361167fb90ff099eb2e320;hpb=5ed1cce8c4b38941d65e578ed3c3bf593a3cc576;p=platal.git diff --git a/classes/profile.php b/classes/profile.php index 73a9fff..249de86 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -48,6 +48,17 @@ class Profile implements PlExportable const DEGREE_M = 'Master'; const DEGREE_D = 'Doctorat'; + static public $cycles = array( + self::DEGREE_X => 'polytechnicien', + self::DEGREE_M => 'master', + self::DEGREE_D => 'docteur' + ); + static public $cycle_prefixes = array( + self::DEGREE_X => 'X', + self::DEGREE_M => 'M', + self::DEGREE_D => 'D' + ); + static public $name_variants = array( self::LASTNAME => array(self::VN_MARITAL, self::VN_ORDINARY), self::FIRSTNAME => array(self::VN_ORDINARY, self::VN_INI, self::VN_OTHER) @@ -113,6 +124,7 @@ class Profile implements PlExportable 'networking' => 'Messageries…', 'tels' => 'Téléphones', 'edus' => 'Formations', + 'main_edus' => 'Formations à l\'X', 'promo' => 'Promotion de sortie', 'birthdate' => 'Date de naissance', 'yourself' => 'Nom affiché', @@ -181,14 +193,26 @@ class Profile implements PlExportable return false; } - public function promo() + public function promo($details = false) { + if ($details && ($this->program || $this->fieldid)) { + $text = array(); + if ($this->program) { + $text[] = $this->program; + } + if ($this->fieldid) { + $fieldsList = DirEnum::getOptions(DirEnum::EDUFIELDS); + $text[] = $fieldsList[$this->fieldid]; + } + return $this->promo . ' (' . implode(', ', $text) . ')'; + } + return $this->promo; } public function yearpromo() { - return intval(substr($this->promo, 1, 4)); + return $this->promo_year; } /** Check if user is an orange (associated with several promos) @@ -880,7 +904,7 @@ class Profile implements PlExportable IF ({?}, p.cv, NULL) AS cv, p.medals_pub, p.alias_pub, p.email_directory, p.last_change, p.nationality1, p.nationality2, p.nationality3, IF (p.freetext_pub IN {?}, p.freetext, NULL) AS freetext, - pe.entry_year, pe.grad_year, + pe.entry_year, pe.grad_year, pe.promo_year, pe.program, pe.fieldid, IF ({?}, pse.text, NULL) AS section, pn_f.name AS firstname, pn_l.name AS lastname, IF( {?}, pn_n.name, NULL) AS nickname,