Début ajout fonctionnalités demandées :

- paramétrer le numéro de reçu
- imprimer à la demande l'adresse de courriel

FossilOrigin-Name: 10c1ca642474c2b00b7d0197afc736f2c2aca3b453808ac1fda19e14b0acc092
This commit is contained in:
engel 2023-01-19 16:54:00 +00:00
parent b077f70fb3
commit e219afb405
5 changed files with 127 additions and 32 deletions

View file

@ -18,7 +18,9 @@ if (f('save') && $form->check('recusfiscaux_config'))
{
try {
// objet de l'association
$plugin->setConfig('objet_asso', trim(f('objet_asso')));
if ($plugin->getConfig('objet_asso') != trim(f('objet_asso'))) {
$plugin->setConfig('objet_asso', trim(f('objet_asso')));
}
// articles du CGI
$confArticles = $plugin->getConfig('articlesCGI');
@ -45,8 +47,14 @@ if (f('save') && $form->check('recusfiscaux_config'))
$plugin->setConfig("reduction", $confTaux);
// nom, fonction et signature du responsable
$plugin->setConfig('nom_responsable', trim(f('nom_responsable')));
$plugin->setConfig('fonction_responsable', trim(f('fonction_responsable')));
if ($plugin->getConfig('nom_responsable') != trim(f('nom_responsable'))) {
$plugin->setConfig('nom_responsable', trim(f('nom_responsable')));
}
if ($plugin->getConfig('fonction_responsable') != trim(f('fonction_responsable'))) {
$plugin->setConfig('fonction_responsable', trim(f('fonction_responsable')));
}
// signature
if (isset($_SESSION['sig_file']) && count($_SESSION['sig_file']) > 0)
{
// supprimer la signature précédente, si besoin
@ -63,7 +71,9 @@ if (f('save') && $form->check('recusfiscaux_config'))
// autres informations
// ville
$plugin->setConfig('ville_asso', trim(f('ville_asso')));
if ($plugin->getConfig('ville_asso') != trim(f('ville_asso'))) {
$plugin->setConfig('ville_asso', trim(f('ville_asso')));
}
// champs pour le nom et prénom
foreach ($champsNom as $nom => $champ)
@ -85,6 +95,11 @@ if (f('save') && $form->check('recusfiscaux_config'))
}
}
$conf_numerotation = $plugin->getConfig('numerotation');
$chaine_numerotation = (isset($conf_numerotation->prefixe) && $conf_numerotation->prefixe != "") ? $conf_numerotation->prefixe : 'XXX';
$chaine_numerotation .= $conf_numerotation->separateur . $conf_numerotation->defaut;
$afficher_courriel = false;
// trier les champs de nom pour l'affichage
uasort($champsNom, function ($a, $b)
{
@ -93,9 +108,11 @@ uasort($champsNom, function ($a, $b)
$tpl->assign('ok', qg('ok') !== null);
$path = qg('path') ?: File::CONTEXT_CONFIG;
$tpl->assign('path', $path);
//$tpl->assign('path', $path);
$tpl->assign('default_signature', \Garradin\WWW_URL . "plugin/recusfiscaux/default_signature.png");
$tpl->assign('plugin_config', $plugin->getConfig());
$tpl->assign('champsNom', $champsNom);
//$tpl->assign('champsNom', $champsNom);
$tpl->assign('plugin_css', ['style.css']);
//$tpl->assign('chaine_numerotation', $chaine_numerotation);
$tpl->assign(compact('path', 'champsNom', 'chaine_numerotation', 'afficher_courriel'));
$tpl->display(PLUGIN_ROOT . '/templates/config.tpl');

View file

@ -10,6 +10,11 @@ if (! isset($_SESSION['annee_recu']) || $_SESSION['annee_recu'] == "")
$_SESSION['annee_recu'] = date("Y") - 1;
}
// error_log("config=" . print_r($plugin->getConfig(), true));
// error_log("articlesCGI=" . print_r($plugin->getConfig('articlesCGI'), true));
// error_log("reduction=" . print_r($plugin->getConfig('reduction'), true));
// error_log("numerotation=" . print_r($plugin->getConfig('numerotation'), true));
// nombre de taux de réduction activés
$nbTaux = 0;
foreach ($plugin->getConfig('reduction') as $taux)

View file

@ -85,7 +85,25 @@ div.versements
/* config */
dl.config
{
padding : 1ex 0;
padding-bottom : 1ex;
padding-right : 1em;
}
div#articles_cgi
{
display: flex;
}
div.article
{
margin-right : 3em;
}
div#config_nom_fonction
{
display: flex;
}
div#numerotation
{
display:flex;
align-items: last baseline;
}
div.champnom
{