From: Stéphane Jacob Date: Sat, 1 Jan 2011 12:48:05 +0000 (+0100) Subject: Displays group positions on group's main page. X-Git-Tag: xorg/1.1.0~243 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=8c5bbd3f286135e2229be855492e00cd940c3550;p=platal.git Displays group positions on group's main page. Signed-off-by: Stéphane Jacob --- diff --git a/classes/group.php b/classes/group.php index 48be876..7d21af4 100644 --- a/classes/group.php +++ b/classes/group.php @@ -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))); } } diff --git a/templates/xnetgrp/asso.tpl b/templates/xnetgrp/asso.tpl index d7a1904..1f5225a 100644 --- a/templates/xnetgrp/asso.tpl +++ b/templates/xnetgrp/asso.tpl @@ -47,6 +47,19 @@ {/if} + {if $asso->positions|count} + + + Bureau : + + + {foreach from=$asso->positions item=position} + • {$position.position} : {profile user=$position.uid promo=true}
+ {/foreach} + + + {/if} + {if $asso->forum}