Overview
Comment:Améliorations formulaire
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 33bfa4019b91dd080ef296bce6eb452e76de87d8
User & Date: bohwaz on 2014-01-28 02:17:21
Other Links: manifest | tags
Context
2014-01-28
16:35
Correction positionnement datepickr check-in: 88132e46e5 user: bohwaz tags: trunk
02:17
Améliorations formulaire check-in: 33bfa4019b user: bohwaz tags: trunk
02:15
Mauvais nom de champ check-in: 8a98ac815b user: bohwaz tags: trunk
Changes

Modified src/templates/admin/membres/transactions/gestion/index.tpl from [616c857021] to [ee140183ef].

1
2
3
4
5
6
7
8
{include file="admin/_head.tpl" title="Cotisations et activités" current="membres/transactions/admin"}

<table class="list">
    <thead>
        <th>Intitulé</th>
        <td>Montant</td>
        <td>Période</td>
        <td></td>
|







1
2
3
4
5
6
7
8
{include file="admin/_head.tpl" title="Cotisations et activités" current="membres/transactions/admin" js=1}

<table class="list">
    <thead>
        <th>Intitulé</th>
        <td>Montant</td>
        <td>Période</td>
        <td></td>
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

{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"}







|


|







<
<
<
<



|
>
>
>
>
>
>
>
>
>
>
>
>
>
>










>
>
>
>

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

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
103
104
105

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

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

    <fieldset>
        <legend>Ajouter une activité ou cotisation</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>
                <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">Catégorie comptable</label></dt>
            <dd class="cat_compta">{select_compte comptes=$comptes name="id_categorie_compta"}</dd>

            <dt><label for="f_periodicite_jours">Période de validité</label></dt>
            <dd><input type="radio" name="periodicite" id="f_periodicite_ponctuel" value="ponctuel" {form_field checked="ponctuel" name=periodicite} /> <label for="f_periodicite_ponctuel">Pas de période (activité ou cotisation ponctuelle)</label></dd>
            <dd><input type="radio" name="periodicite" id="f_periodicite_jours" value="jours" {form_field checked="jours" name=periodicite} /> <label for="f_periodicite_jours">En nombre de jours</label></dd>
            <dt class="periode_jours"><label for="f_duree">Durée de validité</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd class="periode_jours"><input type="number" step="1" size="5" min="1" name="duree" id="f_duree" value="{form_field name="duree"}" /></dd>

            <dd><input type="radio" name="periodicite" id="f_periodicite_date" value="date" {form_field checked="date" name=periodicite} /> <label for="f_periodicite_date">Période définie</label></dd>

            <dt class="periode_dates"><label for="f_date_debut">Date de début</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd class="periode_dates"><input type="date" name="date_debut" value="{form_field name=date_debut}" id="f_date_debut" /></dd>
            <dt class="periode_dates"><label for="f_date_fin">Date de fin</label> <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd class="periode_dates"><input type="date" name="date_fin" value="{form_field name=date_fin}" id="f_date_fin" /></dd>
        </dl>
    </fieldset>

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

</form>

<script type="text/javascript">
{literal}
(function () {
    toggleElementVisibility(['.cat_compta', '.periode_jours', '.dates'], false);

    $('#f_categorie').onchange = function() {
        toggleElementVisibility('.cat_compta', this.checked);
        return true;
    };

    function togglePeriode()
    {
        toggleElementVisibility(['.periode_jours', '.periode_dates'], false);

        if (this.checked && this.value == 'jours')
            toggleElementVisibility('.periode_jours', true);
        else if (this.checked && this.value == 'date')
            toggleElementVisibility('.periode_dates', true);
    }

    $('#f_periodicite_ponctuel').onchange = togglePeriode;
    $('#f_periodicite_date').onchange = togglePeriode;
    $('#f_periodicite_jours').onchange = togglePeriode;
})();
{/literal}
</script>

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

Modified src/www/admin/membres/transactions/gestion/index.php from [95058668d9] to [d57fbd4de0].

1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
<?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'))
    {



|







>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?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;
$comptes = new Compta_Comptes;

$error = false;

if (!empty($_POST['save']))
{
    if (!utils::CSRF_check('new_transaction'))
    {
34
35
36
37
38
39
40

41
42
43
44
        }
    }
}

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

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


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

?>







>

|


35
36
37
38
39
40
41
42
43
44
45
46
        }
    }
}

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

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

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

?>