Overview
SHA1: | 96c5022fb38cc9742841ce4e7ed9017017c3ceac |
---|---|
Date: | 2018-08-26 01:19:38 |
User: | bohwaz |
Comment: | Evitons les conflits de noms de champs quand quelqu'un a déjà créé un champ nommé "catégorie" |
Timelines: | family | ancestors | descendants | both | trunk | stable |
Downloads: | Tarball | ZIP archive |
Other Links: | files | file ages | folders | manifest |
Tags And Properties
- branch=trunk inherited from [e5099a03d9]
- sym-stable
- sym-trunk inherited from [e5099a03d9]
Context
2018-09-06
| ||
20:53 | [d7a2da4080] Vérifications sur le numéro de compte et le numéro du parent (user: bohwaz, tags: trunk, stable) | |
2018-08-26
| ||
01:19 | [96c5022fb3] Evitons les conflits de noms de champs quand quelqu'un a déjà créé un champ nommé "catégorie" (user: bohwaz, tags: trunk, stable) | |
2018-08-02
| ||
22:52 | [a0c15d9d73] Erreur plus explicite quand on essaye de modifier une écriture qui n'existe pas (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'); |