adds links to the binets section of the profile
authorThomas Minvielle <thomas.minvielle@polytechnique.org>
Mon, 14 Nov 2011 12:14:10 +0000 (13:14 +0100)
committerThomas Minvielle <thomas.minvielle@polytechnique.org>
Mon, 14 Nov 2011 12:34:55 +0000 (13:34 +0100)
classes/profile.php
templates/profile/profile.tpl

index 48d209a..605a3ff 100644 (file)
@@ -952,6 +952,17 @@ class Profile implements PlExportable
             return array();
         }
     }
+    public function getFullBinets()
+    {
+        if ($this->visibility->isVisible(Visibility::EXPORT_PRIVATE)) {
+            return XDB::fetchAllAssoc('SELECT  binet_id, text, url
+                                         FROM  profile_binets AS pb
+                                    LEFT JOIN  profile_binet_enum AS pbe ON (pbe.id = pb.binet_id)
+                                        WHERE  pid = {?}', $this->id());
+        } else {
+            return array();
+        }
+    }
     public function getBinetsNames()
     {
         if ($this->visibility->isVisible(Visibility::EXPORT_PRIVATE)) {
index f005f45..5f99005 100644 (file)
@@ -50,9 +50,14 @@ $($.closeOnEsc);
       <h2>À l'X&hellip;</h2>
       {if $profile->section}<div><em class="intitule">Section&nbsp;: </em><span>{$profile->section}</span></div>{/if}
 
-      {assign var=binets value=$profile->getBinets()}
+      {assign var=binets value=$profile->getFullBinets()}
       {if $binets|@count}<div><em class="intitule">Binet{if count($binets) > 1}s{/if}&nbsp;: </em>
-      <span>{', '|implode:$profile->getBinetsNames()}</span></div>{/if}
+      <span> <br />
+      {foreach from=$binets item=binet name=binets}
+        {if !$smarty.foreach.binets.first}, {/if}
+        <span title="{$binet.text}">{if $binet.url}<a href="{$binet.url}">{/if}{$binet.text}{if $binet.url}</a>{/if}</span>
+      {/foreach}
+      </span></div>{/if}
 
       {if $owner && $view->isVisible(#Visibility::EXPORT_AX#)}
         {assign var=groups value=$owner->groups(true,true)}