Overview
SHA1:73da92d6c9ba5b964fa591a30af94aa62f68041d
Date: 2017-05-08 00:12:58
User: bohwaz
Comment:possibilité de créer des comptes directement à la racine d'une classe
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2017-06-07
05:03
[51d79b2eee] Nouvelle version stable (user: bohwaz, tags: trunk, stable, 0.7.7)
2017-05-08
00:13
[0e42b2b443] Merge avec trunk (user: bohwaz, tags: dev)
00:12
[73da92d6c9] possibilité de créer des comptes directement à la racine d'une classe (user: bohwaz, tags: trunk)
2017-04-28
07:28
[2f39cf54bf] Implémentation de l'utilisation d'un SMTP externe (optionnel) pour l'envoi de mails (user: bohwaz, tags: trunk, stable)
Changes

Modified src/include/lib/Garradin/Compta/Comptes.php from [3f5ee84310] to [a19b8ea425].

265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284



285
286
287
288
289
290
291
292

    public function getListAll($parent = 0)
    {
        $db = DB::getInstance();
        return $db->queryFetchAssoc('SELECT id, libelle FROM compta_comptes ORDER BY id;');
    }

    public function listTree($parent = 0, $include_children = true)
    {
        $db = 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 = DB::getInstance();

        if (empty($data['libelle']) || !trim($data['libelle']))







|





|



|


>
>
>
|







265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295

    public function getListAll($parent = 0)
    {
        $db = DB::getInstance();
        return $db->queryFetchAssoc('SELECT id, libelle FROM compta_comptes ORDER BY id;');
    }

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

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

        $query = 'SELECT * FROM compta_comptes WHERE id = \'%s\' OR %s ORDER BY id;';
        $query = sprintf($query, $db->escapeString($parent_id), $parent_where);

        return $db->simpleStatementFetch($query);
    }

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

        if (empty($data['libelle']) || !trim($data['libelle']))

Modified src/include/lib/Garradin/Template.php from [d428ff4e65] to [291763512c].

338
339
340
341
342
343
344
345
346
347
348
349
350
351
352

    foreach ($comptes as $compte)
    {
        // Ne pas montrer les comptes désactivés
        if (!empty($compte['desactive']))
            continue;

        if (!isset($compte['id'][1]))
        {
            $out.= '<optgroup label="'.htmlspecialchars($compte['libelle'], ENT_QUOTES, 'UTF-8', false).'" class="niveau_1"></optgroup>';
        }
        elseif (!isset($compte['id'][2]) && empty($params['create']))
        {
            if ($compte['id'] > 10)
                $out.= '</optgroup>';







|







338
339
340
341
342
343
344
345
346
347
348
349
350
351
352

    foreach ($comptes as $compte)
    {
        // Ne pas montrer les comptes désactivés
        if (!empty($compte['desactive']))
            continue;

        if (!isset($compte['id'][1]) && empty($params['create']))
        {
            $out.= '<optgroup label="'.htmlspecialchars($compte['libelle'], ENT_QUOTES, 'UTF-8', false).'" class="niveau_1"></optgroup>';
        }
        elseif (!isset($compte['id'][2]) && empty($params['create']))
        {
            if ($compte['id'] > 10)
                $out.= '</optgroup>';

Modified src/www/admin/static/admin.css from [da88202611] to [c54095f31a].

283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
    z-index: 2;
}

select.large {
    width: 95%;
}

select.large optgroup.niveau_1 {
    background: #333;
    color: #fff;
    font-style: normal;
    font-size: 1.2em;
}

select.large optgroup.niveau_2 {







|







283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
    z-index: 2;
}

select.large {
    width: 95%;
}

select.large .niveau_1 {
    background: #333;
    color: #fff;
    font-style: normal;
    font-size: 1.2em;
}

select.large optgroup.niveau_2 {