From: Stéphane Jacob Date: Wed, 20 Apr 2011 13:37:22 +0000 (+0200) Subject: Displays details about main education (field and program). X-Git-Tag: xorg/1.1.1~81 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=d718e91c1eefd9ef7f5bec10fb6988ba5bbcc10a;p=platal.git Displays details about main education (field and program). Signed-off-by: Stéphane Jacob --- diff --git a/classes/profile.php b/classes/profile.php index 92a5ae2..4305938 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -182,8 +182,20 @@ 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; } @@ -881,7 +893,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.promo_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, diff --git a/templates/profile/profile.tpl b/templates/profile/profile.tpl index c5a2517..956dfc4 100644 --- a/templates/profile/profile.tpl +++ b/templates/profile/profile.tpl @@ -170,7 +170,7 @@ $($.closeOnEsc); {$code}  {/foreach} - {$profile->promo()} + {$profile->promo('details')} {if $logged && $profile->mentor_expertise} [Ma fiche référent] @@ -178,7 +178,6 @@ $($.closeOnEsc); {assign var=educations value=$profile->getEducations(32)} {if count($educations) > 0} -  - Formation :