return $uf->iterUsers($limit);
}
+ public function iterToNotify()
+ {
+ if ($this->data['notify_all']) {
+ $condition = UFC_Group::BOTH;
+ } else {
+ $condition = UFC_Group::NOTIFIED;
+ }
+ $uf = New UserFilter(New UFC_Group($this->id, true, $condition));
+ return $uf->iterUsers();
+ }
+
public function getLogo($fallback = true)
{
if (!empty($this->logo)) {
$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(\'notify_all\', a.flags) AS notify_all,
(nls.id IS NOT NULL) AS has_nl, ad.text AS address,
p.display_tel AS phone, f.display_tel AS fax
FROM groups AS a
XDB::execute('DELETE FROM group_members
WHERE uid = {?} AND asso_id = {?}',
$uid, $group_id);
+ self::fix_notification($group_id);
+ }
+
+ static private function fix_notification($group_id)
+ {
+ $count = XDB::fetchOneCell("SELECT COUNT(uid)
+ FROM group_members
+ WHERE asso_id = {?} AND perms = 'admin' AND FIND_IN_SET('notify', flags)",
+ $group_id);
+ if ($count == 0) {
+ XDB::execute("UPDATE groups
+ SET flags = IF(flags = '', 'notify_all', CONCAT(flags, ',', 'notify_all'))
+ WHERE id = {?}",
+ $group_id);
+ }
}
}