Displays details about main education (field and program).
authorStéphane Jacob <sj@m4x.org>
Wed, 20 Apr 2011 13:37:22 +0000 (15:37 +0200)
committerStéphane Jacob <sj@m4x.org>
Thu, 21 Apr 2011 16:33:53 +0000 (18:33 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/profile.php
templates/profile/profile.tpl

index 92a5ae2..4305938 100644 (file)
@@ -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,
index c5a2517..956dfc4 100644 (file)
@@ -170,7 +170,7 @@ $($.closeOnEsc);
       <img src='images/flags/{$code}.gif' alt='{$code}' height='11' title='{$country}' />&nbsp;
       {/foreach}
 
-      {$profile->promo()}
+      {$profile->promo('details')}
 
       {if $logged && $profile->mentor_expertise}
       [<a href="referent/{$profile->hrid()}" class='popup2'>Ma fiche référent</a>]
@@ -178,7 +178,6 @@ $($.closeOnEsc);
 
       {assign var=educations value=$profile->getEducations(32)}
       {if count($educations) > 0}
-        &nbsp;-&nbsp;Formation&nbsp;:
         <ul>
         {foreach from=$educations item=edu}
           <li>{display_education edu=$edu profile=$profile full=true}</li>