simplification gestion logo

FossilOrigin-Name: b87bde43d3a8108761b33901f1555143153c30819b16f5ddf5120f9e968da491
This commit is contained in:
engel 2022-03-25 08:02:00 +00:00
parent d132832c77
commit 7d4d305cfa
6 changed files with 26 additions and 34 deletions

View File

@ -8,9 +8,3 @@ $default_signature_file = (new File)->createAndStore('skel/plugin/recusfiscaux',
'default_signature.png',
$path,
null);
// « logo » par défaut
$path = __DIR__ . '/data/default_logo.png';
$default_logo_file = (new File)->createAndStore('skel/plugin/recusfiscaux',
'default_logo.png',
$path,
null);

View File

@ -10,12 +10,6 @@ if (null !== $default_signature_file) {
$default_signature_file->delete();
}
// logo par défaut
$default_logo_file = \Garradin\Files\Files::get('skel/plugin/recusfiscaux/default_logo.png');
if (null !== $default_logo_file) {
$default_logo_file->delete();
}
// signature réelle
$signature = $plugin->getConfig('signature');
if (null !== $signature) {

View File

@ -10,9 +10,4 @@ $old_version = $plugin->getInfos('version');
if (version_compare($old_version, '0.6.0', '<'))
{
$path = __DIR__ . '/data/default_logo.png';
$default_logo_file = (new File)->createAndStore('skel/plugin/recusfiscaux',
'default_logo.png',
$path,
null);
}

View File

@ -27,10 +27,6 @@ if (! isset($confNoms))
$plugin->setConfig('nomChamps', $nomChamps);
}
$path = qg('path') ?: File::CONTEXT_CONFIG;
$context = Files::getContext($path);
$context_ref = Files::getContextRef($path);
if (f('save') && $form->check('recusfiscaux_config'))
{
try {
@ -111,6 +107,7 @@ uasort($nomChamps, function ($a, $b)
});
$tpl->assign('ok', qg('ok') !== null);
$path = qg('path') ?: File::CONTEXT_CONFIG;
$tpl->assign('path', $path);
$tpl->assign('default_signature', \Garradin\WWW_URL . "plugin/recusfiscaux/default_signature.png");
$tpl->assign('plugin_config', $plugin->getConfig());

View File

@ -2,6 +2,9 @@
namespace Garradin;
use Garradin\Files\Files;
use Garradin\Entities\Files\File;
use Garradin\Plugin\RecusFiscaux\RecusHTML;
use Garradin\Plugin\RecusFiscaux\Utils;
use Garradin\Plugin\RecusFiscaux\Personne;
@ -18,18 +21,19 @@ foreach ($lesLignes as $ligne) {
$totalPersonnes = cumulerVersements($versementsSelectionnes);
// informations pour les reçus
$nomAsso = Utils::getNomAsso();
$adresseAsso = Utils::getAdresseAsso();
$nomAsso = $config->get('nom_asso');
$adresseAsso = $config->get('adresse_asso');
$signature =
(null !== $plugin->getConfig('signature')) ?
\Garradin\Files\Files::get($plugin->getConfig('signature'))->fullpath() :
Files::get($plugin->getConfig('signature'))->fullpath() :
"";
// logo
$logo_file = Files::get(File::CONTEXT_CONFIG . '/logo.png');
$logoAsso =
(null !== $config->fileURL('logo')) ?
$config->fileURL('logo') :
\Garradin\Files\Files::get('skel/plugin/recusfiscaux/default_logo.png');
(null !== $logo_file) ?
Files::get($logo_file->path)->fullpath() :
"";
// articles du CGI
$articlesCGI = array();

View File

@ -2,6 +2,9 @@
namespace Garradin;
use Garradin\Files\Files;
use Garradin\Entities\Files\File;
use Garradin\Plugin\RecusFiscaux\RecusHTML;
use Garradin\Plugin\RecusFiscaux\Utils;
use Garradin\Plugin\RecusFiscaux\Personne;
@ -16,17 +19,22 @@ foreach ($lesLignes as $ligne) {
}
// informations pour les reçus
$nomAsso = Utils::getNomAsso();
$adresseAsso = Utils::getAdresseAsso();
$nomAsso = $config->get('nom_asso');
$adresseAsso = $config->get('adresse_asso');
$signature =
(null !== $plugin->getConfig('signature')) ?
\Garradin\Files\Files::get($plugin->getConfig('signature'))->fullpath() :
(null !== $plugin->getConfig('signature'))
?
Files::get($plugin->getConfig('signature'))->fullpath()
:
"";
// logo
$logo_file = Files::get(File::CONTEXT_CONFIG . '/logo.png');
$logoAsso =
(null !== $config->fileURL('logo')) ?
$config->fileURL('logo') :
\Garradin\Files\Files::get('skel/plugin/recusfiscaux/default_logo.png');
(null !== $logo_file)
?
Files::get($logo_file->path)->fullpath()
:
"";
// articles du CGI
$articlesCGI = array();