facturation/www/admin/config.php

35 lines
873 B
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 {
$cfg->set('siret_asso', f('siret_asso'));
$cfg->set('validate_cp', f('validate_cp'));
$cfg->set('unique_client_name', f('unique_name'));
$cfg->set('footer', f('footer'));
2019-11-02 17:53:27 +01:00
2019-11-03 17:51:31 +01:00
$cfg->save();
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);
$tpl->assign('siret_asso', $cfg->get('siret_asso') ?: '');
$tpl->assign('footer', $cfg->get('footer') ?: '');
$tpl->assign('validate_cp', $cfg->get('validate_cp') ? 'checked':'');
$tpl->assign('unique_name', $cfg->get('unique_client_name') ? 'checked':'');
$tpl->display(PLUGIN_ROOT . '/templates/config.tpl');