' . __('Text to add at the end of the PDF generation', 'pdf') . '
';
- echo "
";
- Html::textarea(['name' => 'add_text',
- 'value' => $config->fields['add_text'],
- 'rows' => '5',
- 'style' => 'width:95%']);
- echo '';
$config->showFormButtons(['candel' => false]);
diff --git a/inc/simplepdf.class.php b/inc/simplepdf.class.php
index ff04ef9..6dabf60 100644
--- a/inc/simplepdf.class.php
+++ b/inc/simplepdf.class.php
@@ -32,9 +32,7 @@
//use TCPDF;
-define('K_PATH_IMAGES', Plugin::getPhpDir('pdf') . '/pics/');
-
-
+define('K_PATH_IMAGES', '');
class PluginPdfSimplePDF
{
// Page orientation
@@ -120,17 +118,21 @@ public function setHeader($msg)
$this->header = $msg;
$this->pdf->resetHeaderTemplate();
$this->pdf->SetTitle($msg);
- $configurationValues = Config::getConfigurationValues('core', ['version']);
- $current_version = $configurationValues['version'];
- switch ($current_version) {
- case '0.85.3':
- case '0.85.4':
- case '0.85.5':
- $this->pdf->SetHeaderData('fd_logo.jpg', 15, $msg, '');
- break;
-
- default:
- $this->pdf->SetHeaderData('fd_logo.png', 15, $msg, '');
+ $config = PluginPdfConfig::getInstance();
+
+ $params = [
+ 'entities_id' => Session::getActiveEntity(),
+ 'logo' => '',
+ ];
+ $hook = Plugin::doHookFunction('import_logo', $params);
+ if (
+ !empty($hook['logo_path'])
+ && $config->getField('use_branding_logo')
+ ) {
+ $this->pdf->SetHeaderData($hook['logo_path'], 15, $msg, '');
+ } else {
+ $path = Plugin::getPhpDir('pdf') . '/pics/';
+ $this->pdf->SetHeaderData($path . 'fd_logo.png', 15, $msg, '');
}
}
diff --git a/templates/config.html.twig b/templates/config.html.twig
new file mode 100644
index 0000000..a1b4241
--- /dev/null
+++ b/templates/config.html.twig
@@ -0,0 +1,80 @@
+{#
+ # -------------------------------------------------------------------------
+ # LICENSE
+ #
+ # This file is part of PDF plugin for GLPI.
+ #
+ # PDF is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU Affero General Public License as published by
+ # the Free Software Foundation, either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # PDF 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 Affero General Public License for more details.
+ #
+ # You should have received a copy of the GNU Affero General Public License
+ # along with Reports. If not, see .
+ #
+ # @author Nelly Mahu-Lasson, Remi Collet, Teclib
+ # @copyright Copyright (c) 2009-2022 PDF plugin team
+ # @license AGPL License 3.0 or (at your option) any later version
+ # @link https://github.com/pluginsGLPI/pdf/
+ # @link http://www.glpi-project.org/
+ # @package pdf
+ # @since 2009
+ # http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ # --------------------------------------------------------------------------
+ #}
+
+{% import 'components/form/fields_macros.html.twig' as fields %}
+
+{% set candel = false %}
+
+{{ fields.dropdownArrayField(
+ 'currency',
+ selected_currency,
+ currency_options,
+ __('Choose your international currency', 'pdf')
+) }}
+
+
+
+
+{{ fields.textareaField(
+ 'add_text',
+ add_text,
+ __('Text to add at the end of the PDF generation', 'pdf'),
+ {
+ 'rows': 5,
+ 'style': 'width:95%'
+ }
+) }}