forked from yllen/pdf
-
Notifications
You must be signed in to change notification settings - Fork 5
Load logo from Branding when activated #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
stonebuzz
merged 13 commits into
pluginsGLPI:main
from
RomainLvr:feat/use-branding-logo
Feb 24, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
03e2d06
Load logo from Branding when activated
RomainLvr 0cc2bc7
Remove ReflectionClass method
RomainLvr 5d1cfda
Add toggle in config to enable Branding logo use
RomainLvr 6e2a0dd
In english please
RomainLvr 183bff3
Update CHANGELOG
RomainLvr 824a353
Update CHANGELOG.md
RomainLvr 795a12c
Drop support of old GLPI version for logo
RomainLvr b7de5f6
Use hook for Branding logo
RomainLvr ad02c6b
Use twig for config
RomainLvr 9696e6e
Fix cs fixer
RomainLvr 0815f03
Fix headers
RomainLvr 4fb321f
Update inc/simplepdf.class.php
RomainLvr 4b08be0
Update inc/simplepdf.class.php
RomainLvr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http://www.gnu.org/licenses/>. | ||
# | ||
# @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') | ||
) }} | ||
|
||
<input type="hidden" id="use_branding_logo_hidden" name="use_branding_logo" value="{{ (use_branding_logo and is_branding_active) ? 1 : 0 }}" /> | ||
<div class="form-field row align-items-center col-12 col-sm-6 mb-2"> | ||
<label class="col-form-label col-xxl-5 text-xxl-end "> | ||
<span class="d-inline-flex align-items-center"> | ||
<span>{{ __('Use logo from Branding plugin', 'pdf') }}</span> | ||
</span> | ||
</label> | ||
<div class ="col-1 field-container"> | ||
{% if is_branding_active %} | ||
<label class="form-switch mt-1" style="padding-left: 1rem;" | ||
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-trigger="hover" | ||
title="{{ __('The logo will be used in the header of generated PDFs.', 'pdf') }}"> | ||
<input type="checkbox" class="form-check-input ms-0 me-1 mt-0" id="use_branding_logo_checkbox" | ||
{{ use_branding_logo ? 'checked' : '' }} /> | ||
</label> | ||
<script> | ||
document.getElementById("use_branding_logo_checkbox").addEventListener("change", function () { | ||
document.getElementById("use_branding_logo_hidden").value = this.checked ? 1 : 0; | ||
}); | ||
</script> | ||
{% else %} | ||
<label class="form-switch mt-1" style="padding-left: 1rem;" | ||
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-trigger="hover" | ||
title="{{ __('The Branding plugin is disabled or non-existent', 'pdf') }}"> | ||
<input type="checkbox" class="form-check-input ms-0 me-1 mt-0" disabled /> | ||
</label> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
{{ fields.textareaField( | ||
'add_text', | ||
add_text, | ||
__('Text to add at the end of the PDF generation', 'pdf'), | ||
{ | ||
'rows': 5, | ||
'style': 'width:95%' | ||
} | ||
) }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.