Overview
Comment:Evitons les conflits de noms de champs quand quelqu'un a déjà créé un champ nommé "catégorie"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA1: 96c5022fb38cc9742841ce4e7ed9017017c3ceac
User & Date: bohwaz on 2018-08-26 01:19:38
Other Links: manifest | tags
References
2020-12-08
23:25 Wiki page "Changelog/0.9" artifact: b9c916b4d1 user: bohwaz
Context
2018-09-06
20:53
Vérifications sur le numéro de compte et le numéro du parent check-in: d7a2da4080 user: bohwaz tags: trunk, stable
2018-08-26
01:19
Evitons les conflits de noms de champs quand quelqu'un a déjà créé un champ nommé "catégorie" check-in: 96c5022fb3 user: bohwaz tags: trunk, stable
2018-08-02
22:52
Erreur plus explicite quand on essaye de modifier une écriture qui n'existe pas check-in: a0c15d9d73 user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Membres/Import.php from [032b787733] to [4f9e17fd62].

267
268
269
270
271
272
273
274
275
276
277

278
279
280
281
282
283
284
	protected function export()
	{
        $db = DB::getInstance();

        $champs = Config::getInstance()->get('champs_membres')->getKeys();
        $champs_sql = 'm.' . implode(', m.', $champs);

        $res = $db->prepare('SELECT ' . $champs_sql . ', c.nom AS categorie FROM membres AS m 
            LEFT JOIN membres_categories AS c ON m.id_categorie = c.id ORDER BY c.id;')->execute();

        return [array_merge($champs, ['categorie']), $res];

	}

    public function toCSV()
    {
    	list($champs, $result) = $this->export();

        $fp = fopen('php://output', 'w');







|


|
>







267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
	protected function export()
	{
        $db = DB::getInstance();

        $champs = Config::getInstance()->get('champs_membres')->getKeys();
        $champs_sql = 'm.' . implode(', m.', $champs);

        $res = $db->prepare('SELECT ' . $champs_sql . ', c.nom AS categorie_membre FROM membres AS m 
            LEFT JOIN membres_categories AS c ON m.id_categorie = c.id ORDER BY c.id;')->execute();

        $champs[] = 'categorie_membre';
        return [$champs, $res];
	}

    public function toCSV()
    {
    	list($champs, $result) = $this->export();

        $fp = fopen('php://output', 'w');