From d718e91c1eefd9ef7f5bec10fb6988ba5bbcc10a Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Wed, 20 Apr 2011 15:37:22 +0200 Subject: [PATCH] Displays details about main education (field and program). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/profile.php | 16 ++++++++++++++-- templates/profile/profile.tpl | 3 +-- 2 files changed, 15 insertions(+), 4 deletions(-) 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 :