GROUP BY p.uid', $evt['eid']);
$ofs = Env::i('offset');
+ $part = get_event_participants($evt, $item_id, UserFilter::sortByName(),
+ NB_PER_PAGE, $ofs * NB_PER_PAGE);
+
$nbp = ceil($evt['user_count'] / NB_PER_PAGE);
if ($nbp > 1) {
$links = array();
}
$page->assign('absents', $absents);
- $page->assign('participants',
- get_event_participants($evt, $item_id, UserFilter::sortByName(),
- NB_PER_PAGE, $ofs * NB_PER_PAGE));
+ $page->assign('participants', $part);
}
}
return false;
}
- // smart calculation of the total number
if (!$item_id) {
- $res = XDB::query('SELECT MAX(nb)
- FROM group_events AS e
- INNER JOIN group_event_items AS ei ON (e.eid = ei.eid)
- LEFT JOIN group_event_participants AS ep ON (e.eid = ep.eid AND ei.item_id = ep.item_id)
- WHERE e.eid = {?}
- GROUP BY ep.uid', $evt['eid']);
- $evt['nb_tot'] = array_sum($res->fetchColumn());
+ /* Don't try to be to smart here, in case we're getting the global summary, we cannot have
+ * a general formula to estimate the total number of comers since 'moments' may (or may not be)
+ * disjuncted. As a consequence, we can only provides the number of user having fullfiled the
+ * registration procedure.
+ */
+ $evt['user_count'] = $evt['nb_tot'] = $evt['nb'];
$evt['titre'] = '';
$evt['item_id'] = 0;
$evt['csv_name'] = urlencode($evt['intitule']);
$eid, $uid);
while ($i = $res_->next()) {
$u[$i['item_id']] = $i['nb'];
- $u['montant'] += $i['montant']*$i['nb'];
+ $u['montant'] += $i['montant'] * $i['nb'];
}
$evt['telepaid'] += $u['telepayment'];
$evt['adminpaid'] += $u['adminpaid'];
<h1>{$asso->nom} : <a href='{$platal->ns}events'>Événements</a> </h1>
+{if $tout}
<p>
{$evt.nb_tot} personne{if $evt.nb_tot > 1}s ont réalisé leur {else} a réalisé son {/if}
inscription à l'événement {$evt.intitule} {if $evt.titre}- {$evt.titre} {/if}
qui aura lieu {$evt.date}.
</p>
+{else}
+<p>
+ {$evt.nb_tot} personne{if $evt.nb_tot > 1}s participeront {else} participera {/if}
+ à {$evt.intitule} - {$evt.titre}
+</p>
+{/if}
{if $evt.short_name && $participants|@count && $is_admin}
<p class="center">