Overview
Comment:Début gestion transactions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1b4f728d6125ed4c7fac92891353012fafe42e72
User & Date: bohwaz on 2013-06-18 09:04:41
Other Links: manifest | tags
Context
2013-06-19
12:27
Merge stable vers trunk check-in: f8af42f2cf user: bohwaz tags: trunk
2013-06-18
09:04
Début gestion transactions check-in: 1b4f728d61 user: bohwaz tags: trunk
09:04
Corrections check-in: 3fcc27ed05 user: bohwaz tags: trunk
Changes

Added templates/admin/membres/transactions/index.tpl version [b686009736].











































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
{include file="admin/_head.tpl" title="Transactions" current="membres/transactions"}

<table class="list">
    <thead>
        <th>Intitulé</th>
        <td>Montant</td>
        <td>Période</td>
        <td></td>
    </thead>
    <tbody>
        {foreach from=$liste item="tr"}
            <tr>
                <th>{$tr.intitule|escape}</th>
                <td class="num">{$tr.montant|escape_money} {$config.monnaie|escape}</td>
                <td>
                    {if $tr.duree}
                        {$tr.duree|escape} jours
                    {elseif $tr.debut}
                        du {$tr.debut|format_sqlite_date_to_french} au {$tr.fin|format_sqlite_date_to_french}
                    {else}
                        ponctuelle
                    {/if}
                </td>
                <td class="actions">
                    <a href="{$admin_url}membres/transactions/modifier.php?id={$cat.id|escape}">Modifier</a>
                    | <a href="{$admin_url}membres/transactions/supprimer.php?id={$cat.id|escape}">Supprimer</a>
                </td>
            </tr>
        {/foreach}
    </tbody>
</table>

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

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

    <fieldset>
        <legend>Ajouter une transaction</legend>
        <dl>
            <dt><label for="f_intitule">Intitulé</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="text" name="intitule" id="f_intitule" value="{form_field name=intitule}" /></dd>
            <dt><label for="f_description">Description</label></dt>
            <dd><textarea name="description" id="f_description" cols="50" rows="3">{form_field name=description}</textarea></dd>
            <dt><label for="f_montant">Montant</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="number" name="montant" step="0.01" min="0.00" id="f_montant" value="{form_field default=20 name=montant_cotisation default=0.00}" /></dd>
            <dt><label for="f_periodicite_jours">Validité de la transaction</label></dt>
            <dd><input type="radio" name="periodicite" id="f_periodicite_jours" value="jours" {form_field checked="jours" name=periodicite} /> <label for="f_periodicite_jours">En jours</label></dd>
            <dd><input type="radio" name="periodicite" id="f_periodicite_date" value="date" {form_field checked="date" name=periodicite} /> <label for="f_periodicite_date">De date à date</label></dd>
            <dd><input type="radio" name="periodicite" id="f_periodicite_ponctuel" value="ponctuel" {form_field checked="ponctuel" name=periodicite} /> <label for="f_periodicite_ponctuel">Ponctuelle</label></dd>
            <dt>
                <input type="checkbox" name="categorie" id="f_categorie" value="1" {form_field name="categorie" checked=1} /> <label for="f_categorie">Enregistrer les transactions dans la comptabilité</label>
            </dt>
            <dt class="cat_compta"><label for="f_id_categorie_compta">
        </dl>
    </fieldset>

    <p class="submit">
        {csrf_field key="new_transaction"}
        <input type="submit" name="save" value="Ajouter &rarr;" />
    </p>

</form>


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

Added www/admin/membres/transactions/index.php version [cfa65ab136].

























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
<?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.");
}

$transactions = new Transactions;

$error = false;

if (!empty($_POST['save']))
{
    if (!utils::CSRF_check('new_transaction'))
    {
        $error = 'Une erreur est survenue, merci de renvoyer le formulaire.';
    }
    else
    {
        try {
            $transactions->add(array(
                'intitule'          =>  utils::post('intitule'),
                'montant'           =>  (float) utils::post('montant'),
            ));

            utils::redirect('/admin/membres/transactions/');
        }
        catch (UserException $e)
        {
            $error = $e->getMessage();
        }
    }
}

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

$tpl->assign('liste', $transactions->listByName());

$tpl->display('admin/membres/transactions/index.tpl');

?>