Overview
SHA1:82c8c1fade8a6b05900a9bab6bdcefdc7adb3e54
Date: 2017-12-10 22:28:50
User: bohwaz
Comment:Corrige export champs multi lignes pour Excel, signalé par @David
Timelines: family | ancestors | descendants | both | trunk | stable
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2018-01-10
02:26
[c1d8c7b3f3] Permettre d'avoir WWW_URL et ADMIN_URL dans des endroits différents (user: bohwaz, tags: trunk, stable)
2017-12-10
22:28
[82c8c1fade] Corrige export champs multi lignes pour Excel, signalé par @David (user: bohwaz, tags: trunk, stable)
2017-11-08
00:22
[3ea371099b] Suppression facilités pour installer en sous-domaine avec apache, car ça ne marche pas (user: bohwaz, tags: trunk)
Changes

Modified src/include/lib/Garradin/Membres/Import.php from [098ef3dec9] to [4ee4e4e20f].

274
275
276
277
278
279
280
281
282
283
284
285
286
287
288

            if (!$header)
            {
                fputcsv($fp, array_keys($row));
                $header = true;
            }

            fputs($fp, Utils::row_to_csv($row) . "\n");
        }

        fclose($fp);

        return true;
    }
}







|







274
275
276
277
278
279
280
281
282
283
284
285
286
287
288

            if (!$header)
            {
                fputcsv($fp, array_keys($row));
                $header = true;
            }

            fputs($fp, Utils::row_to_csv($row) . "\r\n");
        }

        fclose($fp);

        return true;
    }
}

Modified src/include/lib/Garradin/Utils.php from [9570b55b87] to [dc41f212bc].

715
716
717
718
719
720
721
722
723
724
725
726
727
    }

    static public function row_to_csv($row)
    {
        $row = (array) $row;

        array_walk($row, function ($field) {
            return str_replace('"', '""', $field);
        });

        return '"' . implode('", "', $row) . '"';
    }
}







|





715
716
717
718
719
720
721
722
723
724
725
726
727
    }

    static public function row_to_csv($row)
    {
        $row = (array) $row;

        array_walk($row, function ($field) {
            return strtr($field, ['"' => '""', "\r\n" => "\n"]);
        });

        return '"' . implode('", "', $row) . '"';
    }
}