Overview
Comment:Liste des comptes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2aa40dcc59bba07f261c99656548bd7baf217a8f
User & Date: bohwaz on 2012-07-13 04:39:31
Other Links: manifest | tags
Context
2012-07-13
04:45
Style plus clair check-in: d11cf5f528 user: bohwaz tags: trunk
04:39
Liste des comptes check-in: 2aa40dcc59 user: bohwaz tags: trunk
04:08
Corrections sur gestion des catégories check-in: 5d85b7bfdd user: bohwaz tags: trunk
Changes

Modified include/class.compta_comptes.php from [c9ab428a1b] to [3880b0b425].

93
94
95
96
97
98
99
100
101
102



103






104
105
106
107
108
109
110

    public function getList($parent = 0)
    {
        $db = Garradin_DB::getInstance();
        return $db->simpleStatementFetch('SELECT * FROM compta_comptes WHERE parent = ? ORDER BY id;', $parent);
    }

    public function listTree($parent = 0)
    {
        $db = Garradin_DB::getInstance();



        $parent = $parent ? 'WHERE parent LIKE \''.$db->escapeString($parent).'%\' ' : '';






        return $db->simpleStatementFetch('SELECT * FROM compta_comptes '.$parent.' ORDER BY id;');
    }

    protected function _checkFields(&$data, $force_parent_check = false)
    {
        $db = Garradin_DB::getInstance();








|


>
>
>
|
>
>
>
>
>
>







93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119

    public function getList($parent = 0)
    {
        $db = Garradin_DB::getInstance();
        return $db->simpleStatementFetch('SELECT * FROM compta_comptes WHERE parent = ? ORDER BY id;', $parent);
    }

    public function listTree($parent = 0, $include_children = true)
    {
        $db = Garradin_DB::getInstance();

        if ($include_children)
        {
            $parent = $parent ? 'WHERE parent LIKE \''.$db->escapeString($parent).'%\' ' : '';
        }
        else
        {
            $parent = $parent ? 'WHERE parent = \''.$db->escapeString($parent).'\' ' : 'WHERE parent = 0';
        }

        return $db->simpleStatementFetch('SELECT * FROM compta_comptes '.$parent.' ORDER BY id;');
    }

    protected function _checkFields(&$data, $force_parent_check = false)
    {
        $db = Garradin_DB::getInstance();

Added templates/admin/compta/comptes.tpl version [62181114a8].





























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
{if empty($classe)}
    {include file="admin/_head.tpl" title="Comptes" current="compta/comptes"}
    <ul class="accountList">
    {foreach from=$classes item="_classe"}
        <li><h4><a href="?classe={$_classe.id|escape}">{$_classe.libelle|escape}</a></h4></li>
    {/foreach}
    </ul>
{else}
    {include file="admin/_head.tpl" title=$classe_compte.libelle current="compta/comptes"}

    <ul class="actions">
        <li><a href="{$www_url}admin/compta/comptes.php">Liste des classes</a></li>
        <li><a href="{$www_url}admin/compta/compte_ajouter.php">Ajouter un compte dans cette classe</a></li>
    </ul>

    <p class="help">
        Les comptes avec la mention <em>*</em> font partie du plan comptable standard
        et ne peuvent être modifiés ou supprimés.
    </p>

    {if !empty($liste)}
        <table class="list">
        {foreach from=$liste item="compte"}
            <tr>
                <th>{$compte.id|escape}</th>
                <td>{if strlen($compte.id) == 2}<strong>{$compte.libelle|escape}</strong>{else}{$compte.libelle|escape}{/if}</td>
                <td class="actions">
                    {if !$compte.plan_comptable}
                        <a href="{$www_url}admin/compta/compte_modifier.php?id={$compte.id|escape}">Modifier</a>
                        | <a href="{$www_url}admin/compta/compte_supprimer.php?id={$compte.id|escape}">Supprimer</a>
                    {else}
                        <em>*</em>
                    {/if}
                </td>
            </tr>
        {/foreach}
        </table>

    {else}
        <p class="alert">
            Aucun compte trouvé.
        </p>
    {/if}
{/if}

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

Added www/admin/compta/comptes.php version [bfe0236176].





















































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

require_once __DIR__ . '/_inc.php';

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

$classe = (int) utils::get('classe');

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

if (!$classe)
{
    $tpl->assign('classes', $comptes->listTree(0, false));
}
else
{
    $tpl->assign('classe_compte', $comptes->get($classe));
    $tpl->assign('liste', $comptes->listTree($classe));
}

$tpl->display('admin/compta/comptes.tpl');

?>

Modified www/admin/static/admin.css from [fafd35f304] to [344aaa17a3].

667
668
669
670
671
672
673














    color: #9c4f15;
    margin: .2em 0 .2em 2em;
}

.catList dd.actions {
    margin: .2em 0 1em 2em;
}





















>
>
>
>
>
>
>
>
>
>
>
>
>
>
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
    color: #9c4f15;
    margin: .2em 0 .2em 2em;
}

.catList dd.actions {
    margin: .2em 0 1em 2em;
}

.accountList {
    list-style-type: square;
    margin-left: 2em;
}

.accountList > li > h4 {
    font-weight: normal;
    font-size: 1.2em;
}

.accountList > li {
    margin-bottom: .8em;
}