ajouts fichiers oubliés ; suppression fichiers inutiles

FossilOrigin-Name: 28fb218f925df004a6471dfeb2df98aac1da5c505559adf051425ac76cc1dead
This commit is contained in:
engel 2022-02-25 17:07:24 +00:00
parent 0554b6fda0
commit 26c113349a
6 changed files with 43 additions and 16 deletions

View File

14
LICENCE
View File

@ -1,14 +0,0 @@
Plugin Facturation pour Garradin
Copyright (C) 2019 zou
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>

View File

@ -2,7 +2,7 @@ nom="Reçus fiscaux"
description="Génération de reçus fiscaux pour les dons des membres" description="Génération de reçus fiscaux pour les dons des membres"
auteur="jce" auteur="jce"
url="https://git.roflcopter.fr/lesanges/recus-fiscaux-garradin" url="https://git.roflcopter.fr/lesanges/recus-fiscaux-garradin"
version="0.4" version="0.5"
menu=1 menu=1
config=1 config=1
min_version="1.1" min_version="1.1"

View File

@ -2,7 +2,7 @@
namespace Garradin; namespace Garradin;
use Garradin\Entities\Files\File; use Garradin\Entities\Files\File;
// « signature » par défaut à remplacer (voir configuration) // « signature » par défaut à remplacer (voir l'onglet de configuration)
$path = __DIR__ . '/data/default_signature.png'; $path = __DIR__ . '/data/default_signature.png';
$default_signature_file = (new File)->createAndStore('skel/plugin/recusFiscaux','default_signature.png', $path, null); $default_signature_file = (new File)->createAndStore('skel/plugin/recusFiscaux','default_signature.png', $path, null);

18
templates/upload.tpl Normal file
View File

@ -0,0 +1,18 @@
{include file="admin/_head.tpl" title="Envoi de fichier"}
{form_errors}
<form method="post" action="{$self_url}" enctype="multipart/form-data" data-focus="1">
<fieldset>
<legend>Téléverser des fichiers</legend>
<dl>
{input type="file" name="file[]" multiple=true label="Fichiers à envoyer" data-enhanced=1}
</dl>
<p class="submit">
{csrf_field key=$csrf_key}
{button type="submit" name="upload" label="Envoyer" shape="upload" class="main"}
</p>
</fieldset>
</form>
{include file="admin/_foot.tpl"}

23
www/admin/upload.php Normal file
View File

@ -0,0 +1,23 @@
<?php
namespace Garradin;
use Garradin\Entities\Files\File;
use Garradin\Files\Files;
$parent = qg('p');
if (!File::checkCreateAccess($parent, $session)) {
throw new UserException('Vous n\'avez pas le droit d\'ajouter de fichier.');
}
$csrf_key = 'upload_file_' . md5($parent);
$form->runIf('upload', function () use ($parent) {
$sig_file = File::uploadMultiple($parent, 'file');
$_SESSION['sig_file'] = $sig_file;
}, $csrf_key, PLUGIN_ROOT . '/www/admin/config.php');
$tpl->assign(compact('parent', 'csrf_key'));
$tpl->display(PLUGIN_ROOT . '/templates/upload.tpl');