Adds links for broken retrieval in xnet list et directory (Closes #1194).
authorStéphane Jacob <sj@m4x.org>
Thu, 15 Jul 2010 23:23:10 +0000 (01:23 +0200)
committerStéphane Jacob <sj@m4x.org>
Thu, 15 Jul 2010 23:24:46 +0000 (01:24 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
plugins/function.profile.php
templates/lists/members.tpl

index a355f8f..77909bd 100644 (file)
@@ -47,6 +47,9 @@ function smarty_function_profile($params, &$smarty)
             $name = '<a href="profile/' . $profile->hrid() . '" class="popup2">' . $name . '</a>';
         }
     }
+    if ($user->lost) {
+        $name .= ' <a href="https://www.polytechnique.org/marketing/broken/' . $user->hruid . '"><img src="images/icons/error.gif" alt="Patte cassée" /></a>';
+    }
     if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) {
         $name = '<strong>' . $name . '</strong>';
     }
index adaa262..8e66640 100644 (file)
 
   </tr>
 
-  {foreach from=$members item=xs key=promo}
-  {foreach from=$xs item=x name=all}
+  {foreach from=$members item=users key=promo}
+  {foreach from=$users item=user}
   <tr>
     <td class='titre' style="width: 20%">
       {if $smarty.foreach.all.first}
       {/if}
     </td>
     <td>
-      {if $promo && strpos($x.l, '@') === false}
-      {if $x.b}<a href="https://www.polytechnique.org/marketing/broken/{$x.l}">{icon name=error}</a>{/if}
-      <a href="profile/{$x.l}" class="popup2">{$x.n}</a>
-      {elseif $x.x}
-      <a href="{$platal->ns}member/{$x.x}">{if $x.n|trim}{$x.n}{else}{$x.l}{/if}</a>
-      {elseif $x.n}
-      {$x.n}
+      {if $promo && $user.x}
+      {profile user=$user.x promo=false}
+      {elseif $user.x}
+      <a href="{$platal->ns}member/{$user.x}">{if $user.n|trim}{$x.n}{else}{$user.l}{/if}</a>
+      {elseif $user.n}
+      {$user.n}
       {else}
-      {$x.l}
+      {$user.l}
       {/if}
     </td>
-    {if $x.p}
+    {if $user.p}
     <td class="right">
-      {$x.p}
+      {$user.p}
     </td>
     {/if}
   </tr>