Overview
SHA1:20f13bfbabd2eb9e433ae235162097b0d4a81e1a
Date: 2019-01-26 10:40:36
User: bohwaz
Comment:Ne pas essayer d'envoyer des mails à des adresses vides (signalé par @Nicolas)
Timelines: family | ancestors | descendants | both | trunk | stable
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2019-01-26
12:13
[7e98e7c8ee] Correction ajout cotisation membre (user: bohwaz, tags: trunk, stable)
10:40
[20f13bfbab] Ne pas essayer d'envoyer des mails à des adresses vides (signalé par @Nicolas) (user: bohwaz, tags: trunk, stable)
10:37
[06e018482d] Le numéro doit être dans les numéros, pas les ID (user: bohwaz, tags: trunk, stable)
Changes

Modified src/include/lib/Garradin/Membres.php from [f75ceb8321] to [89209054f9].

346
347
348
349
350
351
352
353
354

355
356
357
358
359
360
361
362
        {
            Utils::sendEmail(Utils::EMAIL_CONTEXT_BULK, $config->get('email_asso'), $subject, $message);
        }

        return true;
    }

    public function listAllByCategory($id_categorie)
    {

        return DB::getInstance()->get('SELECT id, email FROM membres WHERE id_categorie = ?;', (int)$id_categorie);
    }

    public function listByCategory($cat, $fields, $page = 1, $order = null, $desc = false)
    {
        $begin = ($page - 1) * self::ITEMS_PER_PAGE;

        $db = DB::getInstance();







|

>
|







346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
        {
            Utils::sendEmail(Utils::EMAIL_CONTEXT_BULK, $config->get('email_asso'), $subject, $message);
        }

        return true;
    }

    public function listAllByCategory($id_categorie, $only_with_email = false)
    {
        $where = $only_with_email ? ' AND email IS NOT NULL' : '';
        return DB::getInstance()->get('SELECT id, email FROM membres WHERE id_categorie = ?' . $where, (int)$id_categorie);
    }

    public function listByCategory($cat, $fields, $page = 1, $order = null, $desc = false)
    {
        $begin = ($page - 1) * self::ITEMS_PER_PAGE;

        $db = DB::getInstance();

Modified src/www/admin/membres/message_collectif.php from [528d973d74] to [4372383f21].

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
        'recipients' => 'required|string',
    ]);

    if (preg_match('/^(categorie|recherche)_(\d+)$/', f('recipients'), $match))
    {
        if ($match[1] == 'categorie')
        {
            $recipients = $membres->listAllByCategory($match[2]);
        }
        else
        {
            $recipients = $recherche->search($match[2], 'id, email');
        }

        if (!count($recipients) || !isset($recipients[0]->email))







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
        'recipients' => 'required|string',
    ]);

    if (preg_match('/^(categorie|recherche)_(\d+)$/', f('recipients'), $match))
    {
        if ($match[1] == 'categorie')
        {
            $recipients = $membres->listAllByCategory($match[2], true);
        }
        else
        {
            $recipients = $recherche->search($match[2], 'id, email');
        }

        if (!count($recipients) || !isset($recipients[0]->email))