Commit f5fad726 authored by Skia's avatar Skia

Don't generate hidden asso mailing

parent 3156c2a3
......@@ -132,8 +132,7 @@ $site->add_contents ($tabl);
if ($site->user->is_in_group('root')) {
if(isset($_REQUEST['regenerate'])) {
$req = new requete($site->db, "SELECT *
FROM `asso`
WHERE hidden = 0");
FROM `asso`");
while($row = $req->get_row()) {
$asso = new asso($site->db);
$asso->load_by_id($row['id_asso']);
......
......@@ -135,7 +135,8 @@ if ( $asso->is_mailing_allowed() )
/* PAGE */
$cts->add_paragraph('<a href="manage.php?id_asso='.$asso->id.'&reset">Réinitialiser la mailing du bureau</a>');
if ($asso->hidden == 0)
$cts->add_paragraph('<a href="manage.php?id_asso='.$asso->id.'&reset">Réinitialiser la mailing du bureau</a>');
$mllist = $asso->get_existing_ml();
$mailing = new mailing($site->db);
......
......@@ -229,6 +229,10 @@ function reset_default_mailing($site, $asso) {
|| ($asso->nom_unix === "ae" && $mailing->nom === "bureau"))
$mailing->remove();
}
if ($asso->hidden == 1) {
error_log("Asso ".$asso->nom_unix." is hidden, not regenerating its mailing list");
return;
}
if ($asso->nom_unix === "ae")
$mailing->create("bureau", $asso->id, 1);
else
......
......@@ -59,6 +59,8 @@ while ( $row = $req->get_row() )
{
$mailing = new mailing($db);
$mailing->load_by_id($row['id_mailing']);
if (empty($mailing->get_subscribed_user()))
continue;
echo $mailing->get_full_name(),": ";
foreach($mailing->get_subscribed_user() as $user_id) {
$user = new utilisateur($db);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment