Extensions Paheko  Check-in [c9a3d31116]

Overview
Comment:Remove Brindille section
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: c9a3d3111675df1dfed8aef5764b7734d2d4c4dd
User & Date: bohwaz on 2023-04-11 15:20:59
Other Links: branch diff | manifest | tags
Context
2023-05-05
17:39
Upgraded to match the Paheko 1.3 new plugin API check-in: 67198020b5 user: tyryund tags: dev
2023-04-11
15:20
Remove Brindille section check-in: c9a3d31116 user: bohwaz tags: dev
15:20
Update to use new signals check-in: 7c7eafbe23 user: bohwaz tags: dev
Changes

Modified stock_velos/install.php from [6ea1e0bad7] to [ad96328658].

49
50
51
52
53
54
55
56
57
    CREATE INDEX IF NOT EXISTS prv_roues ON plugin_stock_velos (roues);
    CREATE INDEX IF NOT EXISTS prv_genre ON plugin_stock_velos (genre);
    CREATE INDEX IF NOT EXISTS prv_couleur ON plugin_stock_velos (couleur);
    CREATE INDEX IF NOT EXISTS prv_date_entree ON plugin_stock_velos (date_entree);
    CREATE INDEX IF NOT EXISTS prv_date_sortie ON plugin_stock_velos (date_sortie);
EOF
);

$plugin->registerSignal('usertemplate.init', [Velos::class, 'register']);







<
<
49
50
51
52
53
54
55


    CREATE INDEX IF NOT EXISTS prv_roues ON plugin_stock_velos (roues);
    CREATE INDEX IF NOT EXISTS prv_genre ON plugin_stock_velos (genre);
    CREATE INDEX IF NOT EXISTS prv_couleur ON plugin_stock_velos (couleur);
    CREATE INDEX IF NOT EXISTS prv_date_entree ON plugin_stock_velos (date_entree);
    CREATE INDEX IF NOT EXISTS prv_date_sortie ON plugin_stock_velos (date_sortie);
EOF
);


Modified stock_velos/lib/Velos.php from [9616a0f6dd] to [129e582303].

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
106
107
108
109
110
111
112
113
    protected $raisons_sortie = array(
        'Démonté',
        'Vendu',
        'Vendu en bourse',
        'Jeté',
    );

    static public function register(array $params)
    {
        $ut =& $params['template'];

        $ut->registerSection('velos', [self::class, 'section']);
    }

    static public function section(array $params)
    {
        if (isset($params['count'])) {
            $sql = 'SELECT COUNT(*) AS count FROM plugin_stock_velos WHERE prix > 0 AND date_sortie IS NULL;';
        }
        else {
            $sql = 'SELECT prix, modele, roues, type, genre, etiquette FROM plugin_stock_velos
                WHERE date_sortie IS NULL AND prix > 0 ORDER BY date_entree ASC;';
        }

        $db = DB::getInstance();
        foreach ($db->iterate($sql) as $row) {
            yield (array) $row;
        }
    }

    /**
     * Genres de vélos
     */

    public function listGenres()
    {
        return array_combine($this->genres, $this->genres);







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







77
78
79
80
81
82
83























84
85
86
87
88
89
90
    protected $raisons_sortie = array(
        'Démonté',
        'Vendu',
        'Vendu en bourse',
        'Jeté',
    );
























    /**
     * Genres de vélos
     */

    public function listGenres()
    {
        return array_combine($this->genres, $this->genres);

Modified stock_velos/upgrade.php from [13a881e41d] to [1b83fefe97].

1
2
3
4
5
6
7
<?php

namespace Garradin;

use Garradin\Plugin\Stock_Velos\Velos;

$plugin->registerSignal('usertemplate.init', [Velos::class, 'register']);






|
1
2
3
4
5
6
7
<?php

namespace Garradin;

use Garradin\Plugin\Stock_Velos\Velos;

$plugin->unregisterSignal('usertemplate.init');