From 8c5bbd3f286135e2229be855492e00cd940c3550 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 1 Jan 2011 13:48:05 +0100 Subject: [PATCH] Displays group positions on group's main page. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/group.php | 8 +++++++- templates/xnetgrp/asso.tpl | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) 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} -- 2.1.4