From 5df29b4fc43ef3b2e284f97152a3f1a353b27562 Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Tue, 18 Aug 2026 15:09:11 +0200 Subject: [PATCH] feature/glpi-12.0 --- .github/workflows/continuous-integration.yml | 2 +- CHANGELOG.md | 4 + composer.json | 3 - composer.lock | 721 +------------------ inc/appliance.class.php | 2 +- inc/cartridge.class.php | 2 +- inc/cartridgeitem.class.php | 2 +- inc/change.class.php | 2 +- inc/change_item.class.php | 6 +- inc/change_problem.class.php | 10 +- inc/change_ticket.class.php | 10 +- inc/changetask.class.php | 2 +- inc/changevalidation.class.php | 2 +- inc/common.class.php | 2 +- inc/commonitilcost.class.php | 2 +- inc/computer.class.php | 2 +- inc/computer_item.class.php | 2 +- inc/computer_softwarelicense.class.php | 2 +- inc/computer_softwareversion.class.php | 2 +- inc/config.class.php | 2 +- inc/consumableitem.class.php | 4 +- inc/contract.class.php | 2 +- inc/contract_item.class.php | 2 +- inc/document.class.php | 2 +- inc/domain_item.class.php | 2 +- inc/group.class.php | 2 +- inc/group_user.class.php | 2 +- inc/infocom.class.php | 2 +- inc/item_device.class.php | 2 +- inc/item_disk.class.php | 2 +- inc/item_knowbaseitem.class.php | 2 +- inc/item_operatingsystem.class.php | 2 +- inc/item_problem.class.php | 6 +- inc/item_softwarelicense.class.php | 2 +- inc/item_softwareversion.class.php | 2 +- inc/item_ticket.class.php | 6 +- inc/itemantivirus.class.php | 2 +- inc/itemvirtualmachine.class.php | 2 +- inc/itilfollowup.class.php | 2 +- inc/itilsolution.class.php | 2 +- inc/knowbaseitem.class.php | 2 +- inc/link.class.php | 2 +- inc/log.class.php | 2 +- inc/monitor.class.php | 2 +- inc/networkequipment.class.php | 2 +- inc/networkport.class.php | 2 +- inc/peripheral.class.php | 2 +- inc/phone.class.php | 2 +- inc/preference.class.php | 2 +- inc/printer.class.php | 2 +- inc/problem.class.php | 2 +- inc/problem_ticket.class.php | 10 +- inc/problemtask.class.php | 2 +- inc/profile.class.php | 6 +- inc/reservation.class.php | 2 +- inc/software.class.php | 2 +- inc/softwarelicense.class.php | 2 +- inc/softwareversion.class.php | 2 +- inc/ticket.class.php | 2 +- inc/ticket_contract.class.php | 2 +- inc/ticketsatisfaction.class.php | 2 +- inc/tickettask.class.php | 2 +- inc/ticketvalidation.class.php | 2 +- inc/user.class.php | 2 +- setup.php | 4 +- templates/preference_form.html.twig | 33 - 66 files changed, 90 insertions(+), 839 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 62d4e17d..b5c91c38 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -53,7 +53,7 @@ jobs: name: "Generate CI matrix" uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1" with: - glpi-version: "11.0.x" + glpi-version: "12.0.x" ci: name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}" needs: "generate-ci-matrix" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bf37c7b..8f7b7b78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +### Added + +- GLPI 12 compatibility + ### Fixed - Fix PDF export of tabs renamed in GLPI 11 diff --git a/composer.json b/composer.json index d3e2efd9..8f13b274 100644 --- a/composer.json +++ b/composer.json @@ -3,9 +3,6 @@ "php": ">=8.2", "symfony/yaml": "^7.3" }, - "require-dev": { - "glpi-project/tools": "^0.8.3" - }, "provide": { "tecnickcom/tcpdf": "*" }, diff --git a/composer.lock b/composer.lock index db8e0075..47656fca 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c577ebc4284d2e065e9d457bc09d619c", + "content-hash": "821cb13aed320faeafc865945d816564", "packages": [ { "name": "symfony/deprecation-contracts", @@ -233,724 +233,7 @@ "time": "2025-12-04T18:11:45+00:00" } ], - "packages-dev": [ - { - "name": "glpi-project/tools", - "version": "0.8.3", - "source": { - "type": "git", - "url": "https://github.com/glpi-project/tools.git", - "reference": "8ea2a7d4702a858f4b0360ba7d4f1841a5e77026" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/glpi-project/tools/zipball/8ea2a7d4702a858f4b0360ba7d4f1841a5e77026", - "reference": "8ea2a7d4702a858f4b0360ba7d4f1841a5e77026", - "shasum": "" - }, - "require": { - "symfony/console": "^5.4 || ^6.0", - "twig/twig": "^3.3" - }, - "require-dev": { - "nikic/php-parser": "^4.13", - "phpstan/phpstan-src": "^1.10" - }, - "bin": [ - "bin/extract-locales", - "bin/licence-headers-check", - "tools/plugin-release" - ], - "type": "library", - "autoload": { - "psr-4": { - "GlpiProject\\Tools\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Teclib'", - "email": "glpi@teclib.com", - "homepage": "http://teclib-group.com" - } - ], - "description": "Various tools for GLPI and its plugins", - "keywords": [ - "glpi", - "plugins", - "tools" - ], - "support": { - "issues": "https://github.com/glpi-project/tools/issues", - "source": "https://github.com/glpi-project/tools" - }, - "time": "2025-10-14T10:26:06+00:00" - }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "symfony/console", - "version": "v6.4.31", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "f9f8a889f54c264f9abac3fc0f7a371ffca51997" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f9f8a889f54c264f9abac3fc0f7a371ffca51997", - "reference": "f9f8a889f54c264f9abac3fc0f7a371ffca51997", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v6.4.31" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2025-12-22T08:30:34+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.33.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", - "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2025-06-27T09:58:17+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.33.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "3833d7255cc303546435cb650316bff708a1c75c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", - "reference": "3833d7255cc303546435cb650316bff708a1c75c", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.33.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "php": ">=7.2" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-12-23T08:48:59+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.6.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43", - "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.6-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.6.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2025-07-15T11:30:57+00:00" - }, - { - "name": "symfony/string", - "version": "v7.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "d50e862cb0a0e0886f73ca1f31b865efbb795003" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d50e862cb0a0e0886f73ca1f31b865efbb795003", - "reference": "d50e862cb0a0e0886f73ca1f31b865efbb795003", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.33", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "require-dev": { - "symfony/emoji": "^7.1|^8.0", - "symfony/http-client": "^6.4|^7.0|^8.0", - "symfony/intl": "^6.4|^7.0|^8.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0|^8.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v7.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2025-11-27T13:27:24+00:00" - }, - { - "name": "twig/twig", - "version": "v3.22.2", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "946ddeafa3c9f4ce279d1f34051af041db0e16f2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/946ddeafa3c9f4ce279d1f34051af041db0e16f2", - "reference": "946ddeafa3c9f4ce279d1f34051af041db0e16f2", - "shasum": "" - }, - "require": { - "php": ">=8.1.0", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" - }, - "require-dev": { - "phpstan/phpstan": "^2.0", - "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/Resources/core.php", - "src/Resources/debug.php", - "src/Resources/escaper.php", - "src/Resources/string_loader.php" - ], - "psr-4": { - "Twig\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Twig Team", - "role": "Contributors" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "https://twig.symfony.com", - "keywords": [ - "templating" - ], - "support": { - "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.22.2" - }, - "funding": [ - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/twig/twig", - "type": "tidelift" - } - ], - "time": "2025-12-14T11:28:47+00:00" - } - ], + "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": {}, diff --git a/inc/appliance.class.php b/inc/appliance.class.php index bbee4b13..e49d6608 100644 --- a/inc/appliance.class.php +++ b/inc/appliance.class.php @@ -32,7 +32,7 @@ class PluginPdfAppliance extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; /** * @param $obj (defult NULL) diff --git a/inc/cartridge.class.php b/inc/cartridge.class.php index efda6d04..9daa8cce 100644 --- a/inc/cartridge.class.php +++ b/inc/cartridge.class.php @@ -32,7 +32,7 @@ class PluginPdfCartridge extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; /** * @param $obj (defult NULL) diff --git a/inc/cartridgeitem.class.php b/inc/cartridgeitem.class.php index 63a09db5..cfa54ded 100644 --- a/inc/cartridgeitem.class.php +++ b/inc/cartridgeitem.class.php @@ -32,7 +32,7 @@ class PluginPdfCartridgeItem extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/change.class.php b/inc/change.class.php index 1a6d8ac4..43f9e64e 100644 --- a/inc/change.class.php +++ b/inc/change.class.php @@ -32,7 +32,7 @@ class PluginPdfChange extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/change_item.class.php b/inc/change_item.class.php index dca4a695..36140f55 100644 --- a/inc/change_item.class.php +++ b/inc/change_item.class.php @@ -32,7 +32,7 @@ class PluginPdfChange_Item extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { @@ -384,7 +384,7 @@ public static function pdfForItem(PluginPdfSimplePDF $pdf, CommonDBTM $item, $tr $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s'), __s('Requester') . '', ''); $pdf->displayText($texte, $col, 1); } @@ -425,7 +425,7 @@ public static function pdfForItem(PluginPdfSimplePDF $pdf, CommonDBTM $item, $tr $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s') . '', __s('Assigned to'), ''); $pdf->displayText($texte, $col, 1); } diff --git a/inc/change_problem.class.php b/inc/change_problem.class.php index 16eca1b7..6fe62f8f 100644 --- a/inc/change_problem.class.php +++ b/inc/change_problem.class.php @@ -32,7 +32,7 @@ class PluginPdfChange_Problem extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { @@ -225,7 +225,7 @@ public static function pdfForChange(PluginPdfSimplePDF $pdf, Change $change) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s'), __s('Requester') . '', ''); $pdf->displayText($texte, $col, 1); } @@ -266,7 +266,7 @@ public static function pdfForChange(PluginPdfSimplePDF $pdf, Change $change) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s') . '', ('Assigned to'), ''); $pdf->displayText($texte, $col, 1); } @@ -452,7 +452,7 @@ public static function pdfForProblem(PluginPdfSimplePDF $pdf, Problem $problem) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s'), __s('Requester') . '', ''); $pdf->displayText($texte, $col, 1); } @@ -493,7 +493,7 @@ public static function pdfForProblem(PluginPdfSimplePDF $pdf, Problem $problem) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s') . '', __s('Assigned to'), ''); $pdf->displayText($texte, $col, 1); } diff --git a/inc/change_ticket.class.php b/inc/change_ticket.class.php index 97127939..4b927a2e 100644 --- a/inc/change_ticket.class.php +++ b/inc/change_ticket.class.php @@ -32,7 +32,7 @@ class PluginPdfChange_Ticket extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { @@ -226,7 +226,7 @@ public static function pdfForChange(PluginPdfSimplePDF $pdf, Change $change) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s'), __s('Requester') . '', ''); $pdf->displayText($texte, $col, 1); } @@ -267,7 +267,7 @@ public static function pdfForChange(PluginPdfSimplePDF $pdf, Change $change) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s') . '', __s('Assigned to'), ''); $pdf->displayText($texte, $col, 1); } @@ -483,7 +483,7 @@ public static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $ticket) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s'), __s('Requester') . '', ''); $pdf->displayText($texte, $col, 1); } @@ -524,7 +524,7 @@ public static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $ticket) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s') . '', __s('Assigned to'), ''); $pdf->displayText($texte, $col, 1); } diff --git a/inc/changetask.class.php b/inc/changetask.class.php index c438de71..d782a3be 100644 --- a/inc/changetask.class.php +++ b/inc/changetask.class.php @@ -32,7 +32,7 @@ class PluginPdfChangeTask extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/changevalidation.class.php b/inc/changevalidation.class.php index 2a8e7132..486981b4 100644 --- a/inc/changevalidation.class.php +++ b/inc/changevalidation.class.php @@ -32,7 +32,7 @@ class PluginPdfChangeValidation extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/common.class.php b/inc/common.class.php index 49509e94..98acf9d7 100644 --- a/inc/common.class.php +++ b/inc/common.class.php @@ -37,7 +37,7 @@ abstract class PluginPdfCommon extends CommonGLPI protected $obj = null; protected $pdf = null; - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; /** * Constructor, should intialize $this->obj property diff --git a/inc/commonitilcost.class.php b/inc/commonitilcost.class.php index 8532c2bc..776e938e 100644 --- a/inc/commonitilcost.class.php +++ b/inc/commonitilcost.class.php @@ -32,7 +32,7 @@ class PluginPdfCommonItilCost extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/computer.class.php b/inc/computer.class.php index 0b610cf3..c0949d17 100644 --- a/inc/computer.class.php +++ b/inc/computer.class.php @@ -34,7 +34,7 @@ class PluginPdfComputer extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/computer_item.class.php b/inc/computer_item.class.php index b242e933..f04d731d 100644 --- a/inc/computer_item.class.php +++ b/inc/computer_item.class.php @@ -34,7 +34,7 @@ class PluginPdfComputer_Item extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/computer_softwarelicense.class.php b/inc/computer_softwarelicense.class.php index 67ac3f26..30e1f7dc 100644 --- a/inc/computer_softwarelicense.class.php +++ b/inc/computer_softwarelicense.class.php @@ -63,7 +63,7 @@ */ class PluginPdfComputer_SoftwareLicense extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/computer_softwareversion.class.php b/inc/computer_softwareversion.class.php index 306ba5a3..5c22df57 100644 --- a/inc/computer_softwareversion.class.php +++ b/inc/computer_softwareversion.class.php @@ -63,7 +63,7 @@ */ class PluginPdfComputer_SoftwareVersion extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/config.class.php b/inc/config.class.php index 7dc583b5..896a2d99 100644 --- a/inc/config.class.php +++ b/inc/config.class.php @@ -65,7 +65,7 @@ class PluginPdfConfig extends CommonDBTM { private static $_instance = null; - public static $rightname = 'config'; + public static string $rightname = 'config'; public static function canCreate(): bool { diff --git a/inc/consumableitem.class.php b/inc/consumableitem.class.php index 991a641f..737022bb 100644 --- a/inc/consumableitem.class.php +++ b/inc/consumableitem.class.php @@ -32,7 +32,7 @@ class PluginPdfConsumableItem extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { @@ -165,7 +165,7 @@ public static function pdfForConsumableItem(PluginPdfSimplePDF $pdf, ConsumableI 'ORDER' => $order], ); - if (!$number) { + if ($number === 0) { $pdf->setColumnsSize(100); $pdf->displayTitle(__s('No consumable')); } else { diff --git a/inc/contract.class.php b/inc/contract.class.php index c44664a0..c127dc1d 100644 --- a/inc/contract.class.php +++ b/inc/contract.class.php @@ -32,7 +32,7 @@ class PluginPdfContract extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/contract_item.class.php b/inc/contract_item.class.php index ed33e589..bbd41c25 100644 --- a/inc/contract_item.class.php +++ b/inc/contract_item.class.php @@ -32,7 +32,7 @@ class PluginPdfContract_Item extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/document.class.php b/inc/document.class.php index 418cd128..ad67286c 100644 --- a/inc/document.class.php +++ b/inc/document.class.php @@ -32,7 +32,7 @@ class PluginPdfDocument extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/domain_item.class.php b/inc/domain_item.class.php index 22e54562..cfc106b8 100644 --- a/inc/domain_item.class.php +++ b/inc/domain_item.class.php @@ -32,7 +32,7 @@ class PluginPdfDomain_Item extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/group.class.php b/inc/group.class.php index 31eea5d1..07ed6a4f 100644 --- a/inc/group.class.php +++ b/inc/group.class.php @@ -32,7 +32,7 @@ class PluginPdfGroup extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/group_user.class.php b/inc/group_user.class.php index a1d02b18..ed856f6d 100644 --- a/inc/group_user.class.php +++ b/inc/group_user.class.php @@ -32,7 +32,7 @@ class PluginPdfGroup_User extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/infocom.class.php b/inc/infocom.class.php index 37b45a45..d19a20ec 100644 --- a/inc/infocom.class.php +++ b/inc/infocom.class.php @@ -32,7 +32,7 @@ class PluginPdfInfocom extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/item_device.class.php b/inc/item_device.class.php index 27c715ff..37968590 100644 --- a/inc/item_device.class.php +++ b/inc/item_device.class.php @@ -33,7 +33,7 @@ class PluginPdfItem_Device extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/item_disk.class.php b/inc/item_disk.class.php index 7c0f1651..fe11cbad 100644 --- a/inc/item_disk.class.php +++ b/inc/item_disk.class.php @@ -32,7 +32,7 @@ class PluginPdfItem_Disk extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/item_knowbaseitem.class.php b/inc/item_knowbaseitem.class.php index 2096bc91..533238a1 100644 --- a/inc/item_knowbaseitem.class.php +++ b/inc/item_knowbaseitem.class.php @@ -32,7 +32,7 @@ class PluginPdfItem_Knowbaseitem extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/item_operatingsystem.class.php b/inc/item_operatingsystem.class.php index 50686fe7..15262ee7 100644 --- a/inc/item_operatingsystem.class.php +++ b/inc/item_operatingsystem.class.php @@ -32,7 +32,7 @@ class PluginPdfItem_OperatingSystem extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/item_problem.class.php b/inc/item_problem.class.php index 0ceb1fba..32a83683 100644 --- a/inc/item_problem.class.php +++ b/inc/item_problem.class.php @@ -63,7 +63,7 @@ */ class PluginPdfItem_Problem extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { @@ -472,7 +472,7 @@ public static function pdfForItem(PluginPdfSimplePDF $pdf, CommonDBTM $item, $tr $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s'), __s('Requester') . '', ''); $pdf->displayText($texte, $col, 1); } @@ -513,7 +513,7 @@ public static function pdfForItem(PluginPdfSimplePDF $pdf, CommonDBTM $item, $tr $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s') . '', __s('Assigned to'), ''); $pdf->displayText($texte, $col, 1); } diff --git a/inc/item_softwarelicense.class.php b/inc/item_softwarelicense.class.php index 35aa2cf7..9fff1670 100644 --- a/inc/item_softwarelicense.class.php +++ b/inc/item_softwarelicense.class.php @@ -63,7 +63,7 @@ */ class PluginPdfItem_SoftwareLicense extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/item_softwareversion.class.php b/inc/item_softwareversion.class.php index a67b47c1..b973d6ae 100644 --- a/inc/item_softwareversion.class.php +++ b/inc/item_softwareversion.class.php @@ -64,7 +64,7 @@ */ class PluginPdfItem_SoftwareVersion extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/item_ticket.class.php b/inc/item_ticket.class.php index 0c0a2ca8..e42b7128 100644 --- a/inc/item_ticket.class.php +++ b/inc/item_ticket.class.php @@ -63,7 +63,7 @@ */ class PluginPdfItem_Ticket extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { @@ -516,7 +516,7 @@ public static function pdfForItem(PluginPdfSimplePDF $pdf, CommonDBTM $item, $tr $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s'), __s('Requester') . '', ''); $pdf->displayText($texte, $col, 1); } @@ -557,7 +557,7 @@ public static function pdfForItem(PluginPdfSimplePDF $pdf, CommonDBTM $item, $tr $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s') . '', __s('Assigned to'), ''); $pdf->displayText($texte, $col, 1); } diff --git a/inc/itemantivirus.class.php b/inc/itemantivirus.class.php index d9821c26..1d143ff5 100644 --- a/inc/itemantivirus.class.php +++ b/inc/itemantivirus.class.php @@ -32,7 +32,7 @@ class PluginPdfItemAntivirus extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/itemvirtualmachine.class.php b/inc/itemvirtualmachine.class.php index 90779ea8..bc4fa09d 100644 --- a/inc/itemvirtualmachine.class.php +++ b/inc/itemvirtualmachine.class.php @@ -32,7 +32,7 @@ class PluginPdfItemVirtualMachine extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/itilfollowup.class.php b/inc/itilfollowup.class.php index 1ef03b1d..55895a56 100644 --- a/inc/itilfollowup.class.php +++ b/inc/itilfollowup.class.php @@ -32,7 +32,7 @@ class PluginPdfItilFollowup extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/itilsolution.class.php b/inc/itilsolution.class.php index 94302fe2..9526f1ae 100644 --- a/inc/itilsolution.class.php +++ b/inc/itilsolution.class.php @@ -32,7 +32,7 @@ class PluginPdfITILSolution extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/knowbaseitem.class.php b/inc/knowbaseitem.class.php index e01d23da..677065bc 100644 --- a/inc/knowbaseitem.class.php +++ b/inc/knowbaseitem.class.php @@ -32,7 +32,7 @@ class PluginPdfKnowbaseItem extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/link.class.php b/inc/link.class.php index b4e040db..22b5df38 100644 --- a/inc/link.class.php +++ b/inc/link.class.php @@ -32,7 +32,7 @@ class PluginPdfLink extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/log.class.php b/inc/log.class.php index feb190c1..382da092 100644 --- a/inc/log.class.php +++ b/inc/log.class.php @@ -32,7 +32,7 @@ class PluginPdfLog extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/monitor.class.php b/inc/monitor.class.php index 5d7ccc7e..a2aca15e 100644 --- a/inc/monitor.class.php +++ b/inc/monitor.class.php @@ -32,7 +32,7 @@ class PluginPdfMonitor extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/networkequipment.class.php b/inc/networkequipment.class.php index cbd11557..afba623a 100644 --- a/inc/networkequipment.class.php +++ b/inc/networkequipment.class.php @@ -32,7 +32,7 @@ class PluginPdfNetworkEquipment extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/networkport.class.php b/inc/networkport.class.php index 1d5a0eee..c2f4faa2 100644 --- a/inc/networkport.class.php +++ b/inc/networkport.class.php @@ -34,7 +34,7 @@ class PluginPdfNetworkPort extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/peripheral.class.php b/inc/peripheral.class.php index 9f383122..06d9fd70 100644 --- a/inc/peripheral.class.php +++ b/inc/peripheral.class.php @@ -32,7 +32,7 @@ class PluginPdfPeripheral extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/phone.class.php b/inc/phone.class.php index e35cf925..e69766d5 100644 --- a/inc/phone.class.php +++ b/inc/phone.class.php @@ -32,7 +32,7 @@ class PluginPdfPhone extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/preference.class.php b/inc/preference.class.php index 15a8dc78..0208cae6 100644 --- a/inc/preference.class.php +++ b/inc/preference.class.php @@ -34,7 +34,7 @@ class PluginPdfPreference extends CommonDBTM { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public static function getTypeName($nb = 0) { diff --git a/inc/printer.class.php b/inc/printer.class.php index d493fc01..35d3b242 100644 --- a/inc/printer.class.php +++ b/inc/printer.class.php @@ -32,7 +32,7 @@ class PluginPdfPrinter extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/problem.class.php b/inc/problem.class.php index 24849501..b492a5d8 100644 --- a/inc/problem.class.php +++ b/inc/problem.class.php @@ -32,7 +32,7 @@ class PluginPdfProblem extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/problem_ticket.class.php b/inc/problem_ticket.class.php index e1629ece..96c118c8 100644 --- a/inc/problem_ticket.class.php +++ b/inc/problem_ticket.class.php @@ -32,7 +32,7 @@ class PluginPdfProblem_Ticket extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { @@ -223,7 +223,7 @@ public static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $ticket) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s'), __s('Requester') . '', ''); $pdf->displayText($texte, $col, 1); } @@ -264,7 +264,7 @@ public static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $ticket) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s') . '', ('Assigned to'), ''); $pdf->displayText($texte, $col, 1); } @@ -448,7 +448,7 @@ public static function pdfForProblem(PluginPdfSimplePDF $pdf, Problem $problem) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s'), __s('Requester') . '', ''); $pdf->displayText($texte, $col, 1); } @@ -489,7 +489,7 @@ public static function pdfForProblem(PluginPdfSimplePDF $pdf, Problem $problem) $first = false; } } - if ($col) { + if ($col !== '' && $col !== '0') { $texte = '' . sprintf(__s('%1$s: %2$s') . '', __s('Assigned to'), ''); $pdf->displayText($texte, $col, 1); } diff --git a/inc/problemtask.class.php b/inc/problemtask.class.php index f89d5065..c49d4d42 100755 --- a/inc/problemtask.class.php +++ b/inc/problemtask.class.php @@ -32,7 +32,7 @@ class PluginPdfProblemTask extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/profile.class.php b/inc/profile.class.php index 19350b29..aea669e5 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -32,7 +32,7 @@ class PluginPdfProfile extends Profile { - public static $rightname = 'profile'; + public static string $rightname = 'profile'; public static function getTypeName($nb = 0) { @@ -127,11 +127,11 @@ public static function addDefaultProfileInfos($profiles_id, $rights, $drop_exist 'name' => $right]); } - if (!$dbu->countElementsInTable( + if ($dbu->countElementsInTable( 'glpi_profilerights', ['profiles_id' => $profiles_id, 'name' => $right], - )) { + ) === 0) { $myright['profiles_id'] = $profiles_id; $myright['name'] = $right; $myright['rights'] = $value; diff --git a/inc/reservation.class.php b/inc/reservation.class.php index 69c4545a..c72c521f 100644 --- a/inc/reservation.class.php +++ b/inc/reservation.class.php @@ -32,7 +32,7 @@ class PluginPdfReservation extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/software.class.php b/inc/software.class.php index 21a3526e..5a58167a 100644 --- a/inc/software.class.php +++ b/inc/software.class.php @@ -32,7 +32,7 @@ class PluginPdfSoftware extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/softwarelicense.class.php b/inc/softwarelicense.class.php index 3f712645..53f2d866 100644 --- a/inc/softwarelicense.class.php +++ b/inc/softwarelicense.class.php @@ -32,7 +32,7 @@ class PluginPdfSoftwareLicense extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/softwareversion.class.php b/inc/softwareversion.class.php index 3c1fb1b2..b404a9fb 100644 --- a/inc/softwareversion.class.php +++ b/inc/softwareversion.class.php @@ -32,7 +32,7 @@ class PluginPdfSoftwareVersion extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/ticket.class.php b/inc/ticket.class.php index 78677a76..13646308 100644 --- a/inc/ticket.class.php +++ b/inc/ticket.class.php @@ -32,7 +32,7 @@ class PluginPdfTicket extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/ticket_contract.class.php b/inc/ticket_contract.class.php index ee33a239..ff3630e2 100644 --- a/inc/ticket_contract.class.php +++ b/inc/ticket_contract.class.php @@ -32,7 +32,7 @@ class PluginPdfTicket_Contract extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/ticketsatisfaction.class.php b/inc/ticketsatisfaction.class.php index 09fbecd6..9f056c2a 100644 --- a/inc/ticketsatisfaction.class.php +++ b/inc/ticketsatisfaction.class.php @@ -32,7 +32,7 @@ class PluginPdfTicketSatisfaction extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/tickettask.class.php b/inc/tickettask.class.php index 55e5d902..596af6fa 100644 --- a/inc/tickettask.class.php +++ b/inc/tickettask.class.php @@ -32,7 +32,7 @@ class PluginPdfTicketTask extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/ticketvalidation.class.php b/inc/ticketvalidation.class.php index 848934c2..9fabf820 100644 --- a/inc/ticketvalidation.class.php +++ b/inc/ticketvalidation.class.php @@ -32,7 +32,7 @@ class PluginPdfTicketValidation extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/inc/user.class.php b/inc/user.class.php index 838d5c81..61e05357 100644 --- a/inc/user.class.php +++ b/inc/user.class.php @@ -32,7 +32,7 @@ class PluginPdfUser extends PluginPdfCommon { - public static $rightname = 'plugin_pdf'; + public static string $rightname = 'plugin_pdf'; public function __construct(?CommonGLPI $obj = null) { diff --git a/setup.php b/setup.php index de8738fc..699f5222 100644 --- a/setup.php +++ b/setup.php @@ -36,8 +36,8 @@ define('PLUGIN_PDF_VERSION', '4.1.4'); -define('PLUGIN_PDF_MIN_GLPI', '11.0.0'); -define('PLUGIN_PDF_MAX_GLPI', '11.0.99'); +define('PLUGIN_PDF_MIN_GLPI', '12.0.0'); +define('PLUGIN_PDF_MAX_GLPI', '12.0.99'); function plugin_init_pdf() { diff --git a/templates/preference_form.html.twig b/templates/preference_form.html.twig index ffbfbd41..29c493ca 100644 --- a/templates/preference_form.html.twig +++ b/templates/preference_form.html.twig @@ -146,7 +146,6 @@