Overview
Comment:Gestion manuelle des rappels + Suivi des rappels
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 92b8bfe0a6c3c9d5991dba8e4d56b96e13759c59
User & Date: bohwaz on 2014-04-01 04:13:19
Other Links: manifest | tags
Context
2014-04-01
15:37
Déplacement check-in: 72a3a0a5fe user: bohwaz tags: trunk
04:13
Gestion manuelle des rappels + Suivi des rappels check-in: 92b8bfe0a6 user: bohwaz tags: trunk
2014-03-31
21:13
Envoi automatisé des rappels check-in: 12e7f0652b user: bohwaz tags: trunk
Changes

Modified src/include/class.cotisations_membres.php from [a8c69469ae] to [4cf0597b34].

210
211
212
213
214
215
216
217
218
219
220
221
222
223


















224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
	}

	/**
	 * Liste des membres qui sont inscrits à une cotisation
	 * @param  integer $id Numéro de la cotisation
	 * @return array     Liste des membres
	 */
	public function listMembersForCotisation($id, $page = 1)
	{
		$begin = ($page - 1) * self::ITEMS_PER_PAGE;

		$db = DB::getInstance();
		$champ_id = Config::getInstance()->get('champ_identite');



















		return $db->simpleStatementFetch('SELECT cm.id_membre, cm.date, cm.id,
			(SELECT '.$champ_id.' FROM membres WHERE id = cm.id_membre) AS nom, c.montant,
			CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') >= date()
			WHEN c.fin IS NOT NULL THEN c.fin >= date() ELSE 1 END AS a_jour
			FROM cotisations_membres AS cm
				INNER JOIN cotisations AS c ON c.id = cm.id_cotisation
			WHERE
				cm.id_cotisation = ?
			GROUP BY cm.id_membre ORDER BY cm.date DESC LIMIT ?,?;',
			\SQLITE3_ASSOC, (int)$id, $begin, self::ITEMS_PER_PAGE);
	}

	/**
	 * Liste des événements d'un membre
	 * @param  integer $id Numéro de membre
	 * @return array     Liste des événements de cotisation fait par ce membre







|






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








|







210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
	}

	/**
	 * Liste des membres qui sont inscrits à une cotisation
	 * @param  integer $id Numéro de la cotisation
	 * @return array     Liste des membres
	 */
	public function listMembersForCotisation($id, $page = 1, $order = null, $desc = true)
	{
		$begin = ($page - 1) * self::ITEMS_PER_PAGE;

		$db = DB::getInstance();
		$champ_id = Config::getInstance()->get('champ_identite');

		if (empty($order))
			$order = 'date';

		switch ($order)
		{
			case 'date':
			case 'a_jour':
				break;
			case 'identite':
				$order = 'transliterate_to_ascii('.$champ_id.') COLLATE NOCASE';
				break;
			default:
				$order = 'cm.id_membre';
				break;
		}

		$desc = $desc ? 'DESC' : 'ASC';

		return $db->simpleStatementFetch('SELECT cm.id_membre, cm.date, cm.id,
			(SELECT '.$champ_id.' FROM membres WHERE id = cm.id_membre) AS nom, c.montant,
			CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') >= date()
			WHEN c.fin IS NOT NULL THEN c.fin >= date() ELSE 1 END AS a_jour
			FROM cotisations_membres AS cm
				INNER JOIN cotisations AS c ON c.id = cm.id_cotisation
			WHERE
				cm.id_cotisation = ?
			GROUP BY cm.id_membre ORDER BY '.$order.' '.$desc.' LIMIT ?,?;',
			\SQLITE3_ASSOC, (int)$id, $begin, self::ITEMS_PER_PAGE);
	}

	/**
	 * Liste des événements d'un membre
	 * @param  integer $id Numéro de membre
	 * @return array     Liste des événements de cotisation fait par ce membre
257
258
259
260
261
262
263
264


265
266
267
268
269
270
271
	{
		$db = DB::getInstance();
		return $db->simpleStatementFetch('SELECT c.*,
			CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') >= date()
			WHEN c.fin IS NOT NULL THEN c.fin >= date()
			WHEN cm.id IS NOT NULL THEN 1 ELSE 0 END AS a_jour,
			CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\')
			WHEN c.fin IS NOT NULL THEN c.fin ELSE 1 END AS expiration


			FROM cotisations_membres AS cm
				INNER JOIN cotisations AS c ON c.id = cm.id_cotisation
			WHERE cm.id_membre = ?
			GROUP BY cm.id_cotisation
			ORDER BY cm.date DESC;', \SQLITE3_ASSOC, (int)$id);
	}








|
>
>







275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
	{
		$db = DB::getInstance();
		return $db->simpleStatementFetch('SELECT c.*,
			CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') >= date()
			WHEN c.fin IS NOT NULL THEN c.fin >= date()
			WHEN cm.id IS NOT NULL THEN 1 ELSE 0 END AS a_jour,
			CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\')
			WHEN c.fin IS NOT NULL THEN c.fin ELSE 1 END AS expiration,
			(julianday(date()) - julianday(CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\')
			WHEN c.fin IS NOT NULL THEN c.fin END)) AS nb_jours
			FROM cotisations_membres AS cm
				INNER JOIN cotisations AS c ON c.id = cm.id_cotisation
			WHERE cm.id_membre = ?
			GROUP BY cm.id_cotisation
			ORDER BY cm.date DESC;', \SQLITE3_ASSOC, (int)$id);
	}

Modified src/include/class.rappels.php from [6331104166] to [addb036ece].

126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
	 * @return array Liste des rappels
	 */
	public function listByCotisation()
	{
		return DB::getInstance()->simpleStatementFetch('SELECT r.*,
			c.intitule, c.montant, c.duree, c.debut, c.fin
			FROM rappels AS r
			INNER JOIN cotisations AS c ON c.id = r.id_cotisation ORDER BY r.id_cotisation, r.delai, r.sujet;');

	}

	/**
	 * Liste des rappels pour une cotisation donnée
	 * @param  integer $id Numéro du rappel
	 * @return array     Liste des rappels
	 */







|
>







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
	 * @return array Liste des rappels
	 */
	public function listByCotisation()
	{
		return DB::getInstance()->simpleStatementFetch('SELECT r.*,
			c.intitule, c.montant, c.duree, c.debut, c.fin
			FROM rappels AS r
			INNER JOIN cotisations AS c ON c.id = r.id_cotisation
			ORDER BY r.id_cotisation, r.delai, r.sujet;');
	}

	/**
	 * Liste des rappels pour une cotisation donnée
	 * @param  integer $id Numéro du rappel
	 * @return array     Liste des rappels
	 */
187
188
189
190
191
192
193

194
195
196
197
198
199
200
201
202


203

				WHERE id_cotisation = re.id_cotisation AND id = re.id_membre 
				AND re.date >= date(expiration, delai || \' days\')
			)
		/* Grouper par membre, pour n\'envoyer qu\'un seul rappel par membre/cotise */
		GROUP BY id, id_cotisation
		ORDER BY nb_jours DESC;';


		$st = $db->prepare($query);
		$res = $st->execute();
		$re = new Rappels_Envoyes;

		while ($row = $res->fetchArray(DB::ASSOC))
		{
			$re->sendAuto($row);
		}
	}


}








>








|
>
>

>
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
				WHERE id_cotisation = re.id_cotisation AND id = re.id_membre 
				AND re.date >= date(expiration, delai || \' days\')
			)
		/* Grouper par membre, pour n\'envoyer qu\'un seul rappel par membre/cotise */
		GROUP BY id, id_cotisation
		ORDER BY nb_jours DESC;';

		$db->exec('BEGIN');
		$st = $db->prepare($query);
		$res = $st->execute();
		$re = new Rappels_Envoyes;

		while ($row = $res->fetchArray(DB::ASSOC))
		{
			$re->sendAuto($row);
		}

		$db->exec('END;');
		return true;
}
}

Modified src/include/class.rappels_envoyes.php from [8aeb0ab1be] to [e6a9adfabc].

164
165
166
167
168
169
170
171

172
173
174
175
176
177
178
179
180
	/**
	 * Liste des rappels envoyés à un membre
	 * @param integer $id Numéro du membre
	 * @return array Liste des rappels
	 */
	public function listForMember($id)
	{
		return DB::getInstance()->simpleStatementFetch('SELECT re.*, r.id_cotisation, r.delai, c.intitule

			FROM rappels_envoyes AS re INNER JOIN rappels AS r ON r.id = re.id_rappel
			INNER JOIN cotisations ON c.id = r.id_cotisation 
			WHERE re.id_membre = ?
			ORDER BY re.date DESC;', \SQLITE3_ASSOC, (int)$id);
	}

	/**
	 * Liste des rappels pour une cotisation donnée
	 * @param  integer $id Numéro de la cotisation







|
>
|
|







164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
	/**
	 * Liste des rappels envoyés à un membre
	 * @param integer $id Numéro du membre
	 * @return array Liste des rappels
	 */
	public function listForMember($id)
	{
		return DB::getInstance()->simpleStatementFetch('SELECT
			re.*, c.intitule, c.montant
			FROM rappels_envoyes AS re 
				INNER JOIN cotisations AS c ON c.id = re.id_cotisation 
			WHERE re.id_membre = ?
			ORDER BY re.date DESC;', \SQLITE3_ASSOC, (int)$id);
	}

	/**
	 * Liste des rappels pour une cotisation donnée
	 * @param  integer $id Numéro de la cotisation
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
	{
		return DB::getInstance()->simpleQuerySingle('SELECT COUNT(*) FROM rappels_envoyes
			WHERE id_rappel IN (SELECT id FROM rappels WHERE id_cotisation = ?);',
			false, (int)$id);
	}

	/**
	 * Nombre de rappels envoyés pour un rappel automatique
	 * @param  integer $id Numéro du rappel
	 * @param  integer $page Numéro de page de liste
	 * @return array Liste des rappels envoyés
	 */
	public function listForRappel($id, $page = 1)
	{
		$begin = ($page - 1) * self::ITEMS_PER_PAGE;







|







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
	{
		return DB::getInstance()->simpleQuerySingle('SELECT COUNT(*) FROM rappels_envoyes
			WHERE id_rappel IN (SELECT id FROM rappels WHERE id_cotisation = ?);',
			false, (int)$id);
	}

	/**
	 * Liste des rappels envoyés pour un rappel automatique
	 * @param  integer $id Numéro du rappel
	 * @param  integer $page Numéro de page de liste
	 * @return array Liste des rappels envoyés
	 */
	public function listForRappel($id, $page = 1)
	{
		$begin = ($page - 1) * self::ITEMS_PER_PAGE;

Modified src/include/data/0.6.0.sql from [99e36ee7c6] to [95aac309bf].

48
49
50
51
52
53
54


55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
    sujet TEXT NOT NULL,
    texte TEXT NOT NULL
);

CREATE TABLE rappels_envoyes
-- Enregistrement des rappels envoyés à qui et quand
(


    id_membre INTEGER NOT NULL REFERENCES membres (id),
    id_cotisation INTEGER NOT NULL REFERENCES cotisations (id),

    date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,

    media INTEGER NOT NULL, -- Média utilisé pour le rappel : 1 = email, 2 = courrier, 3 = autre
    
    PRIMARY KEY(id_membre, id_cotisation, date)
);

CREATE TABLE plugins
-- Plugins / extensions
(
    id TEXT PRIMARY KEY,
    officiel INTEGER NOT NULL DEFAULT 0,







>
>





|
<
<







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62


63
64
65
66
67
68
69
    sujet TEXT NOT NULL,
    texte TEXT NOT NULL
);

CREATE TABLE rappels_envoyes
-- Enregistrement des rappels envoyés à qui et quand
(
    id INTEGER PRIMARY KEY,

    id_membre INTEGER NOT NULL REFERENCES membres (id),
    id_cotisation INTEGER NOT NULL REFERENCES cotisations (id),

    date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,

    media INTEGER NOT NULL -- Média utilisé pour le rappel : 1 = email, 2 = courrier, 3 = autre


);

CREATE TABLE plugins
-- Plugins / extensions
(
    id TEXT PRIMARY KEY,
    officiel INTEGER NOT NULL DEFAULT 0,

Modified src/include/data/schema.sql from [f478267547] to [4b228fc114].

80
81
82
83
84
85
86


87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
    sujet TEXT NOT NULL,
    texte TEXT NOT NULL
);

CREATE TABLE rappels_envoyes
-- Enregistrement des rappels envoyés à qui et quand
(


    id_membre INTEGER NOT NULL REFERENCES membres (id),
    id_cotisation INTEGER NOT NULL REFERENCES cotisations (id),

    date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,

    media INTEGER NOT NULL, -- Média utilisé pour le rappel : 1 = email, 2 = courrier, 3 = autre
    
    PRIMARY KEY(id_membre, id_cotisation, date)
);

--
-- WIKI
--

CREATE TABLE wiki_pages







>
>





|
<
<







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94


95
96
97
98
99
100
101
    sujet TEXT NOT NULL,
    texte TEXT NOT NULL
);

CREATE TABLE rappels_envoyes
-- Enregistrement des rappels envoyés à qui et quand
(
    id INTEGER PRIMARY KEY,

    id_membre INTEGER NOT NULL REFERENCES membres (id),
    id_cotisation INTEGER NOT NULL REFERENCES cotisations (id),

    date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,

    media INTEGER NOT NULL -- Média utilisé pour le rappel : 1 = email, 2 = courrier, 3 = autre


);

--
-- WIKI
--

CREATE TABLE wiki_pages

Modified src/templates/admin/membres/cotisations.tpl from [bc85f86c2a] to [c5041f4091].

46
47
48
49
50
51
52

53
54
55
56
57
58
59
{if !empty($cotisations_membre)}
    {foreach from=$cotisations_membre item="co"}
    <dd>{$co.intitule|escape} — 
        {if $co.a_jour}
            <span class="confirm">À jour</span>{if $co.expiration} — Expire le {$co.expiration|format_sqlite_date_to_french}{/if}
        {else}
            <span class="error">En retard</span>

        {/if}
    </dd>
    {/foreach}
{/if}
    <dt><form method="get" action="{$admin_url}membres/cotisations/ajout.php"><input type="submit" value="Enregistrer une cotisation &rarr;" /><input type="hidden" name="id" value="{$membre.id|escape}" /></form></dt>
</dl>








>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{if !empty($cotisations_membre)}
    {foreach from=$cotisations_membre item="co"}
    <dd>{$co.intitule|escape} — 
        {if $co.a_jour}
            <span class="confirm">À jour</span>{if $co.expiration} — Expire le {$co.expiration|format_sqlite_date_to_french}{/if}
        {else}
            <span class="error">En retard</span>
            — <a href="{$admin_url}membres/cotisations/rappels.php?id={$membre.id|escape}">Suivi des rappels</a>
        {/if}
    </dd>
    {/foreach}
{/if}
    <dt><form method="get" action="{$admin_url}membres/cotisations/ajout.php"><input type="submit" value="Enregistrer une cotisation &rarr;" /><input type="hidden" name="id" value="{$membre.id|escape}" /></form></dt>
</dl>

Modified src/templates/admin/membres/cotisations/ajout.tpl from [406c2a793b] to [4ac3bc61b8].

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    </ul>
{else}
    {include file="admin/_head.tpl" title="Enregistrer une cotisation" current="membres/cotisations" js=1}

    <ul class="actions">
        <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
        <li class="current"><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>
        {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN}
            <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
        {/if}
    </ul>
{/if}

{if $error}







<







11
12
13
14
15
16
17

18
19
20
21
22
23
24
    </ul>
{else}
    {include file="admin/_head.tpl" title="Enregistrer une cotisation" current="membres/cotisations" js=1}

    <ul class="actions">
        <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
        <li class="current"><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>

        {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN}
            <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
        {/if}
    </ul>
{/if}

{if $error}

Modified src/templates/admin/membres/cotisations/gestion/modifier.tpl from [67facd5358] to [9a276088f3].

1
2
3
4
5

6

7
8
9
10
11
12
13
{include file="admin/_head.tpl" title="Modifier une cotisation" current="membres/cotisations" js=1}

<ul class="actions">
    <li class="current"><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>

</ul>

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





>
|
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{include file="admin/_head.tpl" title="Modifier une cotisation" current="membres/cotisations" js=1}

<ul class="actions">
    <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
    <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>
    {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN}
        <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
    {/if}
</ul>

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

Modified src/templates/admin/membres/cotisations/gestion/rappel_modifier.tpl from [6dc6f7d3b6] to [e1815f9594].

1
2
3
4
5
6
7
8
9
10
11
12
13
{include file="admin/_head.tpl" title="Modifier un rappel automatique" 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 $error}
    <p class="error">
        {$error|escape}
    </p>





<







1
2
3
4
5

6
7
8
9
10
11
12
{include file="admin/_head.tpl" title="Modifier un rappel automatique" 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 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>

Modified src/templates/admin/membres/cotisations/gestion/rappel_supprimer.tpl from [decb9f66e0] to [51a4232ffb].

1
2
3
4
5
6
7
8
9
10
11
12
13
{include file="admin/_head.tpl" title="Supprimer 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>





<







1
2
3
4
5

6
7
8
9
10
11
12
{include file="admin/_head.tpl" title="Supprimer 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 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>

Modified src/templates/admin/membres/cotisations/gestion/rappels.tpl from [7ed644ebd3] to [9cdc09224d].

1
2
3
4
5
6
7
8
9
10
11
12
13
{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>

<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>





<







1
2
3
4
5

6
7
8
9
10
11
12
{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 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>

Modified src/templates/admin/membres/cotisations/gestion/supprimer.tpl from [2f9798dae5] to [72c2730600].

1
2
3
4
5

6

7
8
9
10
11
12
13
{include file="admin/_head.tpl" title="Supprimer une cotisation" current="membres/cotisations"}

<ul class="actions">
    <li class="current"><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>

</ul>

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





>
|
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{include file="admin/_head.tpl" title="Supprimer une cotisation" current="membres/cotisations"}

<ul class="actions">
    <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
    <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>
    {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN}
        <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
    {/if}
</ul>

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

Modified src/templates/admin/membres/cotisations/index.tpl from [b7d00e7e37] to [e71ccf919c].

1
2
3
4
5
6
7
8
9
10
11
12
13
{include file="admin/_head.tpl" title="Cotisations" current="membres/cotisations" js=1}

<ul class="actions">
    <li class="current"><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>
    {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN}
        <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
    {/if}
</ul>

<table class="list">
    <thead>





<







1
2
3
4
5

6
7
8
9
10
11
12
{include file="admin/_head.tpl" title="Cotisations" current="membres/cotisations" js=1}

<ul class="actions">
    <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
    <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>

    {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN}
        <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
    {/if}
</ul>

<table class="list">
    <thead>

Added src/templates/admin/membres/cotisations/rappels.tpl version [434fa8281b].













































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{include file="admin/_head.tpl" title="Rappels pour cotisations du membre" current="membres/cotisations" js=1}

<ul class="actions">
    <li><a href="{$admin_url}membres/fiche.php?id={$membre.id|escape}"><b>{$membre.identite|escape}</b></a></li>
    <li><a href="{$admin_url}membres/modifier.php?id={$membre.id|escape}">Modifier</a></li>
    {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN}
        <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id|escape}">Supprimer</a></li>
    {/if}
    <li class="current"><a href="{$admin_url}membres/cotisations.php?id={$membre.id|escape}">Suivi des cotisations</a></li>
</ul>

<form method="post" action="{$self_url}">
    <fieldset>
        <legend>Enregistrer un rappel fait à ce membre</legend>
        <dl>
            <dt><label for="f_id_cotisation">Cotisation</label></dt>
            <dd>
                <select id="f_id_cotisation" name="id_cotisation">
                {foreach from=$cotisations item="co"}
                    <option value="{$co.id}">{$co.intitule|escape} — 
                    {if $co.a_jour}
                        Expire dans {$co.nb_jours|escape} jours
                    {else}
                        EXPIRÉE depuis {$co.nb_jours|escape} jours
                    {/if}
                    </option>
                {/foreach}
                </select>
            </dd>
            <dt><label for="f_date">Date du rappel</label></dt>
            <dd><input type="date" name="date" id="f_date" required="required" value="{form_field name="date" default=$default_date}" /></dd>
            <dt><label for="f_media_email">Moyen de communication utilisé</label></dt>
            <dd>
                <label>
                    <input id="f_media_email" type="radio" name="media" value="{Garradin\Rappels_envoyes::MEDIA_EMAIL}" />
                    E-Mail
                </label>
            </dd>
            {* FIXME: proposer d'envoyer un email au membre *}
            <dd>
                <label>
                    <input type="radio" name="media" value="{Garradin\Rappels_envoyes::MEDIA_TELEPHONE}" />
                    Téléphone
                </label>
            </dd>
            {* FIXME: afficher les différents numéros de téléphone de la fiche membre *}
            <dd>
                <label>
                    <input type="radio" name="media" value="{Garradin\Rappels_envoyes::MEDIA_COURRIER}" />
                    Courrier postal
                </label>
            </dd>
            <dd>
                <label>
                    <input type="radio" name="media" value="{Garradin\Rappels_envoyes::MEDIA_AUTRE}" />
                    Autre
                </label>
            </dd>
        </dl>
        <p class="submit">
            {csrf_field key="add_rappel_`$membre.id`"}
            <input type="submit" name="save" value="Enregistrer le rappel &rarr;" />
        </p>
    </fieldset>
</form>

{if !empty($rappels)}
<table class="list">
    <thead>
        <th>Date du rappel</th>
        <td>Moyen de communication</td>
        <td>Cotisation</td>
        <td class="actions"></td>
    </thead>
    <tbody>
        {foreach from=$rappels item="r"}
            <tr>
                <th>{$r.date|format_sqlite_date_to_french}</th>
                <td>
                    {if $r.media == Garradin\Rappels_envoyes::MEDIA_AUTRE}
                        Autre
                    {elseif $r.media == Garradin\Rappels_envoyes::MEDIA_COURRIER}
                        Courrier
                    {elseif $r.media == Garradin\Rappels_envoyes::MEDIA_TELEPHONE}
                        Téléphone
                    {else}
                        E-Mail
                    {/if}
                </td>
                <td>
                    {$r.intitule|escape} — 
                    {$r.montant|html_money} {$config.monnaie|escape}
                </td>
                <td class="actions">
                </td>
            </tr>
        {/foreach}
    </tbody>
</table>
{/if}

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

Modified src/templates/admin/membres/cotisations/voir.tpl from [9f7b26684d] to [0e760a7ce8].

1
2
3
4
5

6

7
8
9
10
11
12
13
{include file="admin/_head.tpl" title="Membres ayant cotisé" current="membres/cotisations"}

<ul class="actions">
    <li class="current"><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>

</ul>

<dl class="cotisation">
    <dt>Cotisation</dt>
    <dd>{$cotisation.intitule|escape} — 
        {if $cotisation.duree}
            {$cotisation.duree|escape} jours





>
|
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{include file="admin/_head.tpl" title="Membres ayant cotisé" current="membres/cotisations"}

<ul class="actions">
    <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li>
    <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li>
    {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN}
        <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li>
    {/if}
</ul>

<dl class="cotisation">
    <dt>Cotisation</dt>
    <dd>{$cotisation.intitule|escape} — 
        {if $cotisation.duree}
            {$cotisation.duree|escape} jours
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
    <dd>{$cotisation.nb_membres|escape}</dd>
</dl>

{if !empty($liste)}
    <table class="list">
        <thead>
            <tr>
                <td></td>
                <th>Membre</th>
                <td>Statut</td>
                <td>Date de cotisation</td>
                <td></td>
            </tr>
        </thead>
        <tbody>
            {foreach from=$liste item="co"}
                <tr>
                    <td class="num"><a class="icn" href="{$admin_url}membres/fiche.php?id={$co.id_membre|escape}">{$co.id_membre|escape}</a></td>
                    <th>{$co.nom|escape}</th>
                    <td>{if $co.a_jour}<b class="confirm">À jour</b>{else}<b class="error">En retard</b>{/if}</td>
                    <td>{$co.date|format_sqlite_date_to_french}</td>
                    <td class="actions">
                        <a href="{$admin_url}membres/cotisations/ajout.php?id={$co.id_membre|escape}&amp;cotisation={$cotisation.id|escape}">Saisir</a>
                        | <a href="{$admin_url}membres/cotisations.php?id={$co.id_membre|escape}">Cotisations de ce membre</a>

                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>

    {pagination url=$pagination_url page=$page bypage=$bypage total=$total}
{/if}


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







|
|
|
|












|
>











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
    <dd>{$cotisation.nb_membres|escape}</dd>
</dl>

{if !empty($liste)}
    <table class="list">
        <thead>
            <tr>
                <td class="{if $order == "id"} cur {if $desc}desc{else}asc{/if}{/if}"><a href="?id={$cotisation.id|escape}&amp;o=id&amp;a">&darr;</a><a href="?id={$cotisation.id|escape}&amp;o=id&amp;d">&uarr;</a></td>
                <th class="{if $order == "identite"} cur {if $desc}desc{else}asc{/if}{/if}">Membre <a href="?id={$cotisation.id|escape}&amp;o=identite&amp;a">&darr;</a><a href="?id={$cotisation.id|escape}&amp;o=identite&amp;d">&uarr;</a></th>
                <td class="{if $order == "a_jour"} cur {if $desc}desc{else}asc{/if}{/if}">Statut <a href="?id={$cotisation.id|escape}&amp;o=a_jour&amp;a">&darr;</a><a href="?id={$cotisation.id|escape}&amp;o=a_jour&amp;d">&uarr;</a></td>
                <td class="{if $order == "date"} cur {if $desc}desc{else}asc{/if}{/if}">Date de cotisation <a href="?id={$cotisation.id|escape}&amp;o=date&amp;a">&darr;</a><a href="?id={$cotisation.id|escape}&amp;o=date&amp;d">&uarr;</a></td>
                <td></td>
            </tr>
        </thead>
        <tbody>
            {foreach from=$liste item="co"}
                <tr>
                    <td class="num"><a class="icn" href="{$admin_url}membres/fiche.php?id={$co.id_membre|escape}">{$co.id_membre|escape}</a></td>
                    <th>{$co.nom|escape}</th>
                    <td>{if $co.a_jour}<b class="confirm">À jour</b>{else}<b class="error">En retard</b>{/if}</td>
                    <td>{$co.date|format_sqlite_date_to_french}</td>
                    <td class="actions">
                        <a href="{$admin_url}membres/cotisations/ajout.php?id={$co.id_membre|escape}&amp;cotisation={$cotisation.id|escape}">Saisir</a>
                        | <a href="{$admin_url}membres/cotisations.php?id={$co.id_membre|escape}" title="Voir toutes les cotisations de ce membre">Cotisations</a>
                        | <a href="{$admin_url}membres/cotisations/rappels.php?id={$co.id_membre|escape}">Rappels</a>
                    </td>
                </tr>
            {/foreach}
        </tbody>
    </table>

    {pagination url=$pagination_url page=$page bypage=$bypage total=$total}
{/if}


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

Added src/www/admin/membres/cotisations/rappels.php version [fb5f6d07a6].

































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
<?php
namespace Garradin;

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

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

if (empty($_GET['id']) || !is_numeric($_GET['id']))
{
    throw new UserException("Argument du numéro de membre manquant.");
}

$id = (int) $_GET['id'];

$membre = $membres->get($id);

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

$re = new Rappels_Envoyes;
$cm = new Cotisations_Membres;

$error = false;

if (utils::post('save'))
{
    if (!utils::CSRF_check('add_rappel_'.$membre['id']))
    {
        $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
    }
    else
    {
        try {
			$re->add([
				'id_cotisation'	=>	utils::post('id_cotisation'),
				'id_membre'		=>	$membre['id'],
				'media'			=>	utils::post('media'),
				'date'			=>	utils::post('date'),
			]);

            utils::redirect('/admin/membres/cotisations/rappels.php?id=' . $membre['id'] . '&ok');
        }
        catch (UserException $e)
        {
            $error = $e->getMessage();
        }
    }
}

$tpl->assign('error', $error);
$tpl->assign('ok', isset($_GET['ok']));
$tpl->assign('membre', $membre);
$tpl->assign('cotisations', $cm->listSubscriptionsForMember($membre['id']));
$tpl->assign('default_date', date('Y-m-d'));
$tpl->assign('rappels', $re->listForMember($membre['id']));

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

?>

Modified src/www/admin/membres/cotisations/voir.php from [f7d9d16550] to [964a03044e].

29
30
31
32
33
34
35


36

37
38
39
40

$tpl->assign('page', $page);
$tpl->assign('bypage', Cotisations_Membres::ITEMS_PER_PAGE);
$tpl->assign('total', $m_cotisations->countMembersForCotisation($co['id']));
$tpl->assign('pagination_url', utils::getSelfUrl(true) . '?id=' . $co['id'] . '&amp;p=[ID]');

$tpl->assign('cotisation', $co);


$tpl->assign('liste', $m_cotisations->listMembersForCotisation($co['id'], $page));


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

?>







>
>
|
>




29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

$tpl->assign('page', $page);
$tpl->assign('bypage', Cotisations_Membres::ITEMS_PER_PAGE);
$tpl->assign('total', $m_cotisations->countMembersForCotisation($co['id']));
$tpl->assign('pagination_url', utils::getSelfUrl(true) . '?id=' . $co['id'] . '&amp;p=[ID]');

$tpl->assign('cotisation', $co);
$tpl->assign('order', utils::get('o') ?: 'date');
$tpl->assign('desc', !isset($_GET['a']));
$tpl->assign('liste', $m_cotisations->listMembersForCotisation(
	$co['id'], $page, utils::get('o'), isset($_GET['a']) ? false : true));

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

?>