Remplacement identificateurs et fonctions ; ajout session_start()

FossilOrigin-Name: 66cba3dd1a9082a7481da1d448e40d14964dfbfc95fff099be86f599ad6bf50b
This commit is contained in:
engel 2023-11-10 11:35:29 +00:00
parent 8091c8b87d
commit 263770b9c7
2 changed files with 15 additions and 12 deletions

View File

@ -1,6 +1,7 @@
<?php
namespace Paheko;
session_start();
use Paheko\Files\Files;
use Paheko\Entities\Files\File;
@ -105,7 +106,7 @@ function genererRecusPDF($totalPersonnes,
$prefixeNum = getNumPrefixe($configNum);
$numero_sequentiel = getNumSequentiel($configNum);
foreach ($totalPersonnes as $idPersonne => $personne) {
$tpl = new UserTemplate();
$tpl = new UserTemplate(null);
$tpl->setSource(PLUGIN_ROOT . '/templates/recu.skel');
$tpl->assignArray(compact('signature', 'logo_asso', 'texteArticles'));
@ -193,11 +194,11 @@ function genererRecusPDF($totalPersonnes,
// echo $link;
// faire une archive zip
// $fichierZip = Utils::makeArchive(
// $listeFichiersPDF,
// $_SESSION['annee_recu'],
// PLUGIN_ROOT . "/zip"
// );
$fichierZip = Utils::makeArchive(
$listeFichiersPDF,
$_SESSION['annee_recu'],
PLUGIN_ROOT . "/zip"
);
//supprimer les fichiers pdf
// foreach ($listeFichiersPDF as $f) {
@ -242,8 +243,8 @@ function generererRecusHTML($tpl,
$tpl->assign('prefixeNum', getNumPrefixe($configNum));
$tpl->assign('membre', $configNum->membre);
$tpl->assign('numero_sequentiel', getNumSequentiel($configNum));
$tpl->assign('nom_asso', Config::getInstance()->get('nom_asso'));
$tpl->assign('adresse_asso', Config::getInstance()->get('adresse_asso'));
$tpl->assign('org_name', Config::getInstance()->get('org_name'));
$tpl->assign('org_address', Config::getInstance()->get('org_address'));
$tpl->assign('objet_asso', $plugin->getConfig('objet_asso'));
$tpl->assign('courriel', $plugin->getConfig('imprimerCourriel'));
$tpl->assign('complements', mentionsComplémentaires());
@ -323,7 +324,6 @@ function cumulerVersementsTarif($versements)
$dateMax = -1;
$totalVersements = 0;
foreach ($versements as $ligne) {
error_log("\nligne=" . print_r($ligne, true));
if (
$ligne->idTarif != $idTarifCourant ||
$ligne->idUser != $idPersonneCourant ||

View File

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