From cc6c46f59df4c8a732d2f42cc071a815788b6233 Mon Sep 17 00:00:00 2001 From: engel <> Date: Wed, 2 Mar 2022 12:38:15 +0000 Subject: [PATCH] =?UTF-8?q?suppression=20fichiers=20cr=C3=A9=C3=A9s=20lors?= =?UTF-8?q?=20d=C3=A9sinstallation=20;=20suppression=20majuscule=20dans=20?= =?UTF-8?q?nom=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FossilOrigin-Name: 2134225b5757bee55253c1af81ba9f3dab5ea2f948c93ae42d76d3af6164f370 --- README.md | 4 ++-- install.php | 3 +-- lib/pdf.css | 3 ++- uninstall.php | 11 +++++++++++ www/admin/config.php | 4 ++-- www/admin/generer_activites.php | 2 +- www/admin/generer_personnes.php | 2 +- www/admin/style.css | 3 ++- www/admin/upload.php | 4 +--- 9 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 uninstall.php diff --git a/README.md b/README.md index c2570fb..3e4bc27 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Plugin reçus fiscaux pour Garradin -Plugin de reçus fiscaux pour le logiciel de gestion d'association Garradin ( https://garradin.eu/ - https://fossil.kd2.org/garradin ). +Plugin de reçus fiscaux pour le logiciel de gestion d'association Garradin (https://garradin.eu/ - https://fossil.kd2.org/garradin). Source : https://git.roflcopter.fr/lesanges/recus-fiscaux-garradin ## Installation -Vous pouvez télécharger l'archive .tar.gz depuis la page des [releases](https://), et la placer directement dans le dossier plugins de Garradin. +Vous pouvez télécharger [l'archive .tar.gz](https://git.roflcopter.fr/lesanges/recus-fiscaux-garradin/-/archive/master/recus-fiscaux-garradin-master.tar.gz), et la désarchiver dans le dossier plugins de Garradin. ## Fonctionnalités - Créer des reçus fiscaux pour des dons et génération du cerfa correspondant diff --git a/install.php b/install.php index 6abc40a..6fb3e16 100644 --- a/install.php +++ b/install.php @@ -4,5 +4,4 @@ use Garradin\Entities\Files\File; // « signature » par défaut à remplacer (voir l'onglet de configuration) $path = __DIR__ . '/data/default_signature.png'; -$default_signature_file = (new File)->createAndStore('skel/plugin/recusFiscaux','default_signature.png', $path, null); - +$_SESSION['default_signature_file'] = (new File)->createAndStore('skel/plugin/recusfiscaux','default_signature.png', $path, null); diff --git a/lib/pdf.css b/lib/pdf.css index f1f7603..9ae6ceb 100644 --- a/lib/pdf.css +++ b/lib/pdf.css @@ -113,7 +113,8 @@ body #signature { display: block; - width : 7cm; + max-width : 7cm; + max-height : 2cm; margin: 0 auto; padding-bottom : 2mm; } diff --git a/uninstall.php b/uninstall.php new file mode 100644 index 0000000..b4bf885 --- /dev/null +++ b/uninstall.php @@ -0,0 +1,11 @@ +delete(); + +// signature réelle +$_SESSION['sig_file'][0]->delete(); diff --git a/www/admin/config.php b/www/admin/config.php index c7aca5a..fb7f621 100644 --- a/www/admin/config.php +++ b/www/admin/config.php @@ -32,7 +32,7 @@ if (f('save') && $form->check('recusfiscaux_config')) // nom, fonction et signature du responsable $plugin->setConfig('nom_responsable', trim(f('nom_responsable'))); $plugin->setConfig('fonction_responsable', trim(f('fonction_responsable'))); - if (isset($_SESSION['sig_file'])) { + if (isset($_SESSION['sig_file']) && count($_SESSION['sig_file']) > 0) { $plugin->setConfig('signature', $_SESSION['sig_file'][0]->path); } @@ -46,7 +46,7 @@ if (f('save') && $form->check('recusfiscaux_config')) $tpl->assign('ok', qg('ok') !== null); $tpl->assign('path', $path); -$tpl->assign('default_signature', \Garradin\WWW_URL . "plugin/recusFiscaux/default_signature.png"); +$tpl->assign('default_signature', \Garradin\WWW_URL . "plugin/recusfiscaux/default_signature.png"); $tpl->assign('plugin_config', $plugin->getConfig()); $tpl->assign('plugin_css', ['style.css']); $tpl->display(PLUGIN_ROOT . '/templates/config.tpl'); diff --git a/www/admin/generer_activites.php b/www/admin/generer_activites.php index 8678893..0776adf 100644 --- a/www/admin/generer_activites.php +++ b/www/admin/generer_activites.php @@ -24,7 +24,7 @@ $adresseAsso = Utils::getAdresseAsso(); $signature = (null !== $plugin->getConfig('signature')) ? \Garradin\Files\Files::get($plugin->getConfig('signature'))->fullpath() : - \Garradin\WWW_URL . "plugin/recusFiscaux/default_signature.png"; + \Garradin\WWW_URL . "plugin/recusfiscaux/default_signature.png"; // articles du CGI $articlesCGI = array(); diff --git a/www/admin/generer_personnes.php b/www/admin/generer_personnes.php index 1866bdc..3b4bfcb 100644 --- a/www/admin/generer_personnes.php +++ b/www/admin/generer_personnes.php @@ -22,7 +22,7 @@ $adresseAsso = Utils::getAdresseAsso(); $signature = (null !== $plugin->getConfig('signature')) ? \Garradin\Files\Files::get($plugin->getConfig('signature'))->fullpath() : - \Garradin\WWW_URL . "plugin/recusFiscaux/default_signature.png"; + \Garradin\WWW_URL . "plugin/recusfiscaux/default_signature.png"; // articles du CGI $articlesCGI = array(); diff --git a/www/admin/style.css b/www/admin/style.css index b3a08bc..b158dbb 100644 --- a/www/admin/style.css +++ b/www/admin/style.css @@ -32,7 +32,8 @@ input[type="text"] { } #signature { - width:300px; + max-width: 300px; + max-height 150px; } dl.config { diff --git a/www/admin/upload.php b/www/admin/upload.php index 945ce80..7fd5387 100644 --- a/www/admin/upload.php +++ b/www/admin/upload.php @@ -13,9 +13,7 @@ if (!File::checkCreateAccess($parent, $session)) { $csrf_key = 'upload_file_' . md5($parent); $form->runIf('upload', function () use ($parent) { - $sig_file = File::uploadMultiple($parent, 'file'); - $_SESSION['sig_file'] = $sig_file; - + $_SESSION['sig_file'] = File::uploadMultiple($parent, 'file'); }, $csrf_key, PLUGIN_ROOT . '/www/admin/config.php'); $tpl->assign(compact('parent', 'csrf_key'));