From e219afb405fb385cdb5d1d8dca1e4d0236e42de1 Mon Sep 17 00:00:00 2001 From: engel <> Date: Thu, 19 Jan 2023 16:54:00 +0000 Subject: [PATCH] =?UTF-8?q?D=C3=A9but=20ajout=20fonctionnalit=C3=A9s=20dem?= =?UTF-8?q?and=C3=A9es=20:=20-=20param=C3=A9trer=20le=20num=C3=A9ro=20de?= =?UTF-8?q?=20re=C3=A7u=20-=20imprimer=20=C3=A0=20la=20demande=20l'adresse?= =?UTF-8?q?=20de=20courriel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FossilOrigin-Name: 10c1ca642474c2b00b7d0197afc736f2c2aca3b453808ac1fda19e14b0acc092 --- config.json | 7 +++- templates/config.tpl | 98 +++++++++++++++++++++++++++++++++----------- www/admin/config.php | 29 ++++++++++--- www/admin/index.php | 5 +++ www/admin/style.css | 20 ++++++++- 5 files changed, 127 insertions(+), 32 deletions(-) diff --git a/config.json b/config.json index 6c0b346..35c9d50 100644 --- a/config.json +++ b/config.json @@ -26,5 +26,10 @@ "remarque" : "aide aux personnes en difficulté", "valeur" : 0 } - ] + ], + "numerotation" : { + "prefixe" : "", + "separateur" : "-", + "defaut" : "%a-%m" + } } diff --git a/templates/config.tpl b/templates/config.tpl index 3bc3e43..e812ef3 100644 --- a/templates/config.tpl +++ b/templates/config.tpl @@ -15,7 +15,7 @@
(obligatoire)
- {input type="textarea" name="objet_asso" source=$plugin.config label="" required="required" cols="50" rows="4" maxlength=300} + {input type="textarea" name="objet_asso" source=$plugin.config label="" required="required" cols="100" rows="3" maxlength=300}
@@ -23,17 +23,19 @@ (obligatoire ; sélectionnez tous les articles qui s'appliquent à l'association) - {foreach from=$plugin_config->articlesCGI key="key" item="article"} - {* +
+ {foreach from=$plugin_config->articlesCGI key="key" item="article"} + {* À VÉRIFIER : {input : checked ne fonctionne pas si l'attribut name est un tableau... {input type="checkbox" name="articlesCGI[]" value=$key label=$article.titre} *} -
- - -
- {/foreach} +
+ + +
+ {/foreach} +
@@ -54,16 +56,37 @@
Nom, fonction et signature du responsable -
-
- {input type="text" name="nom_responsable" source=$plugin.config label="" maxlength=50} -
+
-
-
- {input type="text" name="fonction_responsable" source=$plugin.config label="" maxlength=50} -
+ {* Nom du responsable *} +
+ {* +
+

du responsable

+*} + {input type="text" name="nom_responsable" source=$plugin.config label="Nom" help="du responsable" required=true maxlength=50} +
+ {* Fonction du responsable *} +
+{* +
+

du responsable

+*} + {input type="text" name="fonction_responsable" source=$plugin.config label="Fonction" help="du responsable" maxlength=50} +
+ + {* Ville avant signature *} +
+{* +
+

Précède la date sur le formulaire

+*} + {input type="text" name="ville_asso" source=$plugin.config label="Ville" help="précède la date sur le formulaire" maxlength=50} +
+
+ + {* Signature *}

L'image de la signature doit être d'une taille « raisonnable » et avoir un fond transparent

@@ -78,11 +101,37 @@
Autres informations -
-
-

Précède la date sur le formulaire

- {input type="text" name="ville_asso" source=$plugin.config label="" maxlength=50} -
+ + {* Numérotation des reçus *} +
+
+ {* +
+

%a : année ; %m : numéro membre ; %n : numéro séquentiel ; Exemple : HA-%a-%n donne HA-2022-51

+*} + {input type="text" name="numerotation" default=$chaine_numerotation label="Numérotation des reçus" maxlength=50} +
+ +
+ + Saisir ici un texte qui décrit le format de la numérotation des reçus. + +
+ Symboles spéciaux : +
    +
  • %a : année du reçu
  • +
  • %m : numéro de membre
  • +
  • %n : numéro d'ordre séquentiel (1, 2, ...)
  • +
+ Exemple : HAL-%a-%m donnera « Reçu numéro HAL-2022-51 » pour le membre de numéro 51 +
+
+
+ + {* Adresse de courriel *} +
+ {input type="checkbox" name="afficher_courriel" value=$afficher_courriel label="Imprimer adresse courriel" help="Cocher pour imprimer l'adresse de courriel des membres"} +
{* les champs de nom *} @@ -95,8 +144,9 @@
- - + +
{/foreach} diff --git a/www/admin/config.php b/www/admin/config.php index c5b406a..298ad01 100644 --- a/www/admin/config.php +++ b/www/admin/config.php @@ -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'); diff --git a/www/admin/index.php b/www/admin/index.php index a7e73a5..284ff06 100644 --- a/www/admin/index.php +++ b/www/admin/index.php @@ -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) diff --git a/www/admin/style.css b/www/admin/style.css index c79f6f3..82485ec 100644 --- a/www/admin/style.css +++ b/www/admin/style.css @@ -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 {