<?php
/* GET /api/odt_templates.php — Liste der ODT-Deckblatt-Templates */
require_once __DIR__.'/_inc.php';

api_authenticate();

$list = bericht_list_templates();
$out = array();
foreach ($list as $fn) {
    $out[] = array(
        'filename' => $fn,
        'label' => preg_replace('/\.odt$/i', '', $fn),
    );
}
$default = getDolGlobalString('BERICHT_DEFAULT_TEMPLATE', '');
api_ok(array('templates' => $out, 'default' => $default));
