facturation/www/admin/config.php

35 lines
1.0 KiB
PHP
Raw Normal View History

2019-11-02 17:53:27 +01:00
<?php
namespace Garradin;
require_once __DIR__ . '/_inc.php';
$session->requireAccess('compta', Membres::DROIT_ADMIN);
if (f('save') && $form->check('facturation_config'))
{
2019-11-03 17:51:31 +01:00
try {
2020-10-24 01:57:41 +02:00
$plugin->setConfig('rna_asso', trim(f('rna_asso')));
$plugin->setConfig('siret_asso', trim(f('siret_asso')));
$plugin->setConfig('validate_cp', f('validate_cp'));
$plugin->setConfig('unique_client_name', f('unique_name'));
$plugin->setConfig('footer', f('footer'));
2019-11-02 17:53:27 +01:00
2019-11-03 17:51:31 +01:00
Utils::redirect(PLUGIN_URL . 'config.php?ok');
2019-11-02 17:53:27 +01:00
}
catch (UserException $e)
{
2019-11-03 17:51:31 +01:00
$form->addError($e->getMessage());
2019-11-02 17:53:27 +01:00
}
}
$tpl->assign('ok', qg('ok') !== null);
2020-10-24 01:57:41 +02:00
$tpl->assign('rna_asso', $plugin->getConfig('rna_asso') ?: '');
$tpl->assign('siret_asso', $plugin->getConfig('siret_asso') ?: '');
$tpl->assign('footer', $plugin->getConfig('footer') ?: '');
$tpl->assign('validate_cp', $plugin->getConfig('validate_cp') ? 'checked':'');
$tpl->assign('unique_name', $plugin->getConfig('unique_client_name') ? 'checked':'');
2019-11-02 17:53:27 +01:00
$tpl->display(PLUGIN_ROOT . '/templates/config.tpl');