From: Raphaël Barrois Date: Sat, 29 Jan 2011 23:37:49 +0000 (+0100) Subject: Enable link to NL pages in X.net groups. (Closes #774) X-Git-Tag: xorg/1.0.2~4 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=c40a0fb3934306dce746e9a82d504ff371582784;p=platal.git Enable link to NL pages in X.net groups. (Closes #774) Signed-off-by: Raphaël Barrois --- diff --git a/classes/group.php b/classes/group.php index 0149d9b..e3ed9b6 100644 --- a/classes/group.php +++ b/classes/group.php @@ -113,9 +113,11 @@ class Group } $res = XDB::query('SELECT a.*, d.nom AS domnom, FIND_IN_SET(\'wiki_desc\', a.flags) AS wiki_desc, - FIND_IN_SET(\'notif_unsub\', a.flags) AS notif_unsub + FIND_IN_SET(\'notif_unsub\', a.flags) AS notif_unsub, + (nls.id IS NOT NULL) AS has_nl FROM groups AS a LEFT JOIN group_dom AS d ON d.id = a.dom + LEFT JOIN newsletters AS nls ON (nls.group_id = a.id) WHERE ' . $where); if ($res->numRows() != 1) { if ($can_be_shortname && (is_int($id) || ctype_digit($id))) { diff --git a/classes/xnetpage.php b/classes/xnetpage.php index 0ef5cfb..42bf9e9 100644 --- a/classes/xnetpage.php +++ b/classes/xnetpage.php @@ -100,6 +100,9 @@ class XnetPage extends PlPage if ($globals->asso('mail_domain')) { $sub['listes de diffusion'] = "$dim/lists"; } + if ($globals->asso('has_nl')) { + $sub['newsletter'] = "$dim/nl"; + } } $sub['événement'] = "$dim/events"; if ($perms->hasFlag('groupmember')) {