Displays group positions on group's main page.
authorStéphane Jacob <sj@m4x.org>
Sat, 1 Jan 2011 12:48:05 +0000 (13:48 +0100)
committerStéphane Jacob <sj@m4x.org>
Sat, 1 Jan 2011 12:48:05 +0000 (13:48 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/group.php
templates/xnetgrp/asso.tpl

index 48be876..7d21af4 100644 (file)
@@ -126,7 +126,13 @@ class Group
             }
             return null;
         }
-        return new Group($res->fetchOneAssoc());
+        $data = $res->fetchOneAssoc();
+        $positions = XDB::fetchAllAssoc('SELECT  position, uid
+                                           FROM  group_members
+                                          WHERE  asso_id = {?} AND position IS NOT NULL
+                                       ORDER BY  position',
+                                        $data['id']);
+        return new Group(array_merge($data, array('positions' => $positions)));
     }
 }
 
index d7a1904..1f5225a 100644 (file)
   </tr>
   {/if}
 
+  {if $asso->positions|count}
+  <tr>
+    <td class="titre">
+      Bureau&nbsp;:
+    </td>
+    <td>
+      {foreach from=$asso->positions item=position}
+      <em>&bull;&nbsp;{$position.position}&nbsp;:</em> {profile user=$position.uid promo=true}<br />
+      {/foreach}
+    </td>
+  </tr>
+  {/if}
+
   {if $asso->forum}
   <tr>
     <td class="titre">