Overview
Comment:Modification de rappel automatique
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 03eb33c21205bf9dc012944638451a33beb2f3e3
User & Date: bohwaz on 2014-03-14 14:37:37
Other Links: manifest | tags
Context
2014-03-14
15:47
suppression de rappel automatique check-in: 1bb95bcff2 user: bohwaz tags: trunk
14:37
Modification de rappel automatique check-in: 03eb33c212 user: bohwaz tags: trunk
2014-03-13
15:34
Ajout/liste des rappels automatiques check-in: 210c37153e user: bohwaz tags: trunk
Changes

Added src/templates/admin/membres/cotisations/gestion/rappel_modifier.tpl version [e01ae6689d].





















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{include file="admin/_head.tpl" title="Modifier un rappel automatique" current="membres/cotisations"}

<ul class="actions">
    <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
    <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>
    <li><a href="{$admin_url}membres/cotisations/rappels.php">État des rappels</a></li>
    <li class="current"><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
</ul>

{if $error}
    <p class="error">
        {$error|escape}
    </p>
{/if}

<form method="post" action="{$self_url|escape}" id="f_add">

    <fieldset>
        <legend>Modifier un rappel automatique</legend>
        <dl>
            <dt><label for="f_id_cotisation">Cotisation associée</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd>
                <select name="id_cotisation" id="f_id_cotisation" required="required">
                    <option value="">--</option>
                    {foreach from=$cotisations item="co"}
                    <option value="{$co.id|escape}" {form_field name="id_cotisation" selected=$co.id data=$rappel}>
                        {$co.intitule|escape}
                        — {$co.montant|html_money} {$config.monnaie|escape}
                        — {if $co.duree}pour {$co.duree|escape} jours
                        {elseif $co.debut}
                            du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french}
                        {else}
                            ponctuelle
                        {/if}
                    </option>
                    {/foreach}
                </select>
            </dd>
            <dt><label for="f_sujet">Sujet du mail</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="text" name="sujet" id="f_sujet" value="{form_field name=sujet data=$rappel}" required="required" size="50" /></dd>
            <dt><label for="f_delai">Délai d'envoi</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="number" name="delai" step="1" min="1" max="900" size="5" id="f_delai" value="{form_field name=delai data=$rappel}" required="required" /> jours</dd>
            <dd><label><input type="radio" name="delai_pre" value="1" {form_field name="delai_pre" checked=1 data=$rappel} /> Avant l'expiration de la cotisation</label></dd>
            <dd><label><input type="radio" name="delai_pre" value="0" {form_field name="delai_pre" checked=0 data=$rappel} /> Après l'expiration de la cotisation</label></dd>
            <dt><label for="f_texte">Texte du mail</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><textarea name="texte" id="f_texte" cols="70" rows="15" required="required">{form_field name=texte data=$rappel}</textarea></dd>
            <dd class="help">Astuce : pour inclure dans le contenu du mail le nom du membre, utilisez #IDENTITE, pour inclure le délai de l'envoi utilisez #NB_JOURS.</dd>
        </dl>
    </fieldset>

    <p class="submit">
        {csrf_field key="edit_rappel_`$rappel.id`"}
        <input type="submit" name="save" value="Enregistrer &rarr;" />
    </p>

</form>

{include file="admin/_foot.tpl"}

Modified src/templates/admin/membres/cotisations/gestion/rappels.tpl from [7f3218c554] to [f787858143].

1
2
3
4
5
6
7
8





9
10
11
12
13
14
15
{include file="admin/_head.tpl" title="Gestion des rappels automatiques" current="membres/cotisations" js=1}

<ul class="actions">
    <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
    <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>
    <li><a href="{$admin_url}membres/cotisations/rappels.php">État des rappels</a></li>
    <li class="current"><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
</ul>






{if empty($liste)}
    <p class="alert">Aucun rappel automatique n'est enregistré.</p>
{else}
    <table class="list">
        <thead>
            <td>Cotisation</td>
|







>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{include file="admin/_head.tpl" title="Gestion des rappels automatiques" current="membres/cotisations"}

<ul class="actions">
    <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
    <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>
    <li><a href="{$admin_url}membres/cotisations/rappels.php">État des rappels</a></li>
    <li class="current"><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
</ul>

<p class="help">
    Les rappels automatiques sont envoyés aux membres disposant d'une adresse e-mail
    selon le délai défini. Il est possible de définir plusieurs rappels pour une même cotisation.
</p>

{if empty($liste)}
    <p class="alert">Aucun rappel automatique n'est enregistré.</p>
{else}
    <table class="list">
        <thead>
            <td>Cotisation</td>

Modified src/www/admin/membres/cotisations/gestion/modifier.php from [45088888d9] to [f3131b49eb].

1
2
3
4
5
6
7
8
9





10
11
12
13
14
15
16
<?php
namespace Garradin;

require_once __DIR__ . '/../../../_inc.php';

if ($user['droits']['membres'] < Membres::DROIT_ADMIN)
{
    throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
}






$cotisations = new Cotisations;

$co = $cotisations->get(utils::get('id'));
$cats = new Compta_Categories;

if (!$co)









>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
namespace Garradin;

require_once __DIR__ . '/../../../_inc.php';

if ($user['droits']['membres'] < Membres::DROIT_ADMIN)
{
    throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
}

if (!utils::get('id') || !is_numeric(utils::get('id')))
{
    throw new UserException("Argument du numéro de cotisation manquant.");
}

$cotisations = new Cotisations;

$co = $cotisations->get(utils::get('id'));
$cats = new Compta_Categories;

if (!$co)

Added src/www/admin/membres/cotisations/gestion/rappel_modifier.php version [e83ba15aae].







































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
namespace Garradin;

require_once __DIR__ . '/../../../_inc.php';

if ($user['droits']['membres'] < Membres::DROIT_ADMIN)
{
    throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
}

if (!utils::get('id') || !is_numeric(utils::get('id')))
{
    throw new UserException("Argument du numéro de rappel manquant.");
}

$rappels = new Rappels;

$rappel = $rappels->get(utils::get('id'));

if (!$rappel)
{
    throw new UserException("Ce rappel n'existe pas.");
}

$cotisations = new Cotisations;

$error = false;

if (!empty($_POST['save']))
{
    if (!utils::CSRF_check('edit_rappel_' . $rappel['id']))
    {
        $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
    }
    else
    {
        try {
        	$delai = (int) utils::post('delai');
            $delai = utils::post('delai_pre') ? -$delai : $delai;

            $rappels->edit($rappel['id'], [
                'sujet'		=>	utils::post('sujet'),
                'texte'		=>	utils::post('texte'),
                'delai'		=>	$delai,
                'id_cotisation'	=>	utils::post('id_cotisation'),
            ]);

            utils::redirect('/admin/membres/cotisations/gestion/rappels.php');
        }
        catch (UserException $e)
        {
            $error = $e->getMessage();
        }
    }
}

$tpl->assign('error', $error);

$rappel['delai_pre'] = $rappel['delai'] > 0 ? 0 : 1;
$rappel['delai'] = abs($rappel['delai']);

$tpl->assign('rappel', $rappel);
$tpl->assign('cotisations', $cotisations->listCurrent());

$tpl->display('admin/membres/cotisations/gestion/rappel_modifier.tpl');

?>

Modified src/www/admin/membres/cotisations/gestion/supprimer.php from [3faa09989a] to [975df94532].

1
2
3
4
5
6
7
8
9





10
11
12
13
14
15
16
<?php
namespace Garradin;

require_once __DIR__ . '/../../../_inc.php';

if ($user['droits']['membres'] < Membres::DROIT_ADMIN)
{
    throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
}






$cotisations = new Cotisations;

$co = $cotisations->get(utils::get('id'));

if (!$co)
{









>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
namespace Garradin;

require_once __DIR__ . '/../../../_inc.php';

if ($user['droits']['membres'] < Membres::DROIT_ADMIN)
{
    throw new UserException("Vous n'avez pas le droit d'accéder à cette page.");
}

if (!utils::get('id') || !is_numeric(utils::get('id')))
{
    throw new UserException("Argument du numéro de cotisation manquant.");
}

$cotisations = new Cotisations;

$co = $cotisations->get(utils::get('id'));

if (!$co)
{