Overview
Comment:Corrections bugs DB et cron
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 03918d4368e5bd496c663be0e10da14ea092559e
User & Date: bohwaz on 2014-03-26 17:51:32
Other Links: manifest | tags
Context
2014-03-26
18:03
Repasse champs requis check-in: 3c49d304ee user: bohwaz tags: trunk
17:51
Corrections bugs DB et cron check-in: 03918d4368 user: bohwaz tags: trunk
17:47
Vague de "required" dans les formulaires check-in: 6e539273e0 user: bohwaz tags: trunk
Changes

Modified src/cron.php from [4f820133c2] to [7ce5319fc9].

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

namespace Garradin;

require __DIR__ . '/include/init.php';

// Exécution des tâches automatiques

if ($config->get('frequence_sauvegardes') && $config->get('nombre_sauvegardes'))
{
	$s = new Sauvegarde;
	$s->auto();
}




|








1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

namespace Garradin;

require_once __DIR__ . '/include/init.php';

// Exécution des tâches automatiques

if ($config->get('frequence_sauvegardes') && $config->get('nombre_sauvegardes'))
{
	$s = new Sauvegarde;
	$s->auto();
}

Modified src/include/class.db.php from [aedffdc1cb] to [366f753ead].

255
256
257
258
259
260
261



262
263
264
265
266
267
268
        $fields_names = array_keys($fields);
        return $this->simpleStatement('INSERT INTO '.$table.' ('.implode(', ', $fields_names).')
            VALUES (:'.implode(', :', $fields_names).');', $fields);
    }

    public function simpleUpdate($table, $fields, $where)
    {



        $query = 'UPDATE '.$table.' SET ';

        foreach ($fields as $key=>$value)
        {
            $query .= $key . ' = :'.$key.', ';
        }








>
>
>







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
        $fields_names = array_keys($fields);
        return $this->simpleStatement('INSERT INTO '.$table.' ('.implode(', ', $fields_names).')
            VALUES (:'.implode(', :', $fields_names).');', $fields);
    }

    public function simpleUpdate($table, $fields, $where)
    {
        if (empty($fields))
            return false;
        
        $query = 'UPDATE '.$table.' SET ';

        foreach ($fields as $key=>$value)
        {
            $query .= $key . ' = :'.$key.', ';
        }

Modified src/include/class.membres.php from [0cd205af5e] to [db8b6f595c].

453
454
455
456
457
458
459





460
461
462
463
464
465
466
467
        }

        if (isset($data['id_categorie']) && empty($data['id_categorie']))
        {
            $data['id_categorie'] = Config::getInstance()->get('categorie_membres');
        }






        $db->simpleUpdate('membres', $data, 'id = '.(int)$id);
    }

    public function get($id)
    {
        $db = DB::getInstance();
        $config = Config::getInstance();








>
>
>
>
>
|







453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
        }

        if (isset($data['id_categorie']) && empty($data['id_categorie']))
        {
            $data['id_categorie'] = Config::getInstance()->get('categorie_membres');
        }

        if (empty($data))
        {
            return true;
        }

        return $db->simpleUpdate('membres', $data, 'id = '.(int)$id);
    }

    public function get($id)
    {
        $db = DB::getInstance();
        $config = Config::getInstance();

Modified src/include/lib.template.php from [24cd7e84eb] to [173c0a167e].

405
406
407
408
409
410
411





412
413
414
415
416
417
418
    $attributes = 'name="' . htmlspecialchars($params['name'], ENT_QUOTES, 'UTF-8') . '" ';
    $attributes .= 'id="f_' . htmlspecialchars($params['name'], ENT_QUOTES, 'UTF-8') . '" ';

    if (!empty($params['disabled']))
    {
        $attributes .= 'disabled="disabled" ';
    }






    if (!empty($params['user_mode']) && empty($config['editable']))
    {
        $out = '<dt>' . htmlspecialchars($config['title'], ENT_QUOTES, 'UTF-8') . '</dt>';
        $out .= '<dd>' . htmlspecialchars((trim($value) === '' ? 'Non renseigné' : $value), ENT_QUOTES, 'UTF-8') . '</dd>';
        return $out;
    }







>
>
>
>
>







405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
    $attributes = 'name="' . htmlspecialchars($params['name'], ENT_QUOTES, 'UTF-8') . '" ';
    $attributes .= 'id="f_' . htmlspecialchars($params['name'], ENT_QUOTES, 'UTF-8') . '" ';

    if (!empty($params['disabled']))
    {
        $attributes .= 'disabled="disabled" ';
    }

    if (!empty($config['mandatory']))
    {
        $attributes .= 'required="required" ';
    }

    if (!empty($params['user_mode']) && empty($config['editable']))
    {
        $out = '<dt>' . htmlspecialchars($config['title'], ENT_QUOTES, 'UTF-8') . '</dt>';
        $out .= '<dd>' . htmlspecialchars((trim($value) === '' ? 'Non renseigné' : $value), ENT_QUOTES, 'UTF-8') . '</dd>';
        return $out;
    }