diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 16370820b8..9f751ebeee 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -20,7 +20,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/.gitignore b/.gitignore index 044ece9716..8b75e501cf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ vendor/ .gh_token *.min.* var/ +.phpunit.result.cache \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee8a97de3..5a04aea38e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [UNRELEASED] +## [unreleased] + +### Added + +- GLPI 12 compatibility ### Fixed diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..ef1bed5ac8 --- /dev/null +++ b/Makefile @@ -0,0 +1 @@ +include ../../PluginsMakefile.mk diff --git a/ajax/billactions.php b/ajax/billactions.php index 1287c21992..225d2960c2 100644 --- a/ajax/billactions.php +++ b/ajax/billactions.php @@ -28,7 +28,7 @@ * ------------------------------------------------------------------------- */ -Session::checkRight("plugin_order_bill", READ); +Session::checkRight(PluginOrderBill::$rightname, READ); header("Content-Type: text/html; charset=UTF-8"); diff --git a/ajax/dropdownReference.php b/ajax/dropdownReference.php index 33595b0aff..f68164d7d7 100644 --- a/ajax/dropdownReference.php +++ b/ajax/dropdownReference.php @@ -31,9 +31,7 @@ /** @var DBmysql $DB */ global $DB; -include_once(__DIR__ . "/../../../inc/includes.php"); - -Session::checkRight("plugin_order_reference", READ); +Session::checkRight(PluginOrderReference::$rightname, READ); // Make a select box for references if (isset($_POST["itemtype"])) { diff --git a/ajax/dropdownSupplier.php b/ajax/dropdownSupplier.php index 43d524dc40..2b142d7507 100644 --- a/ajax/dropdownSupplier.php +++ b/ajax/dropdownSupplier.php @@ -35,7 +35,7 @@ Html::header_nocache(); } -Session::checkRight("contact_enterprise", READ); +Session::checkRight(Contact::$rightname, READ); // Make a select box if (isset($_POST["suppliers_id"])) { diff --git a/composer.json b/composer.json index 263a787aae..36ee69f733 100644 --- a/composer.json +++ b/composer.json @@ -4,9 +4,6 @@ "php": ">=8.2", "sboden/odtphp": "^3.2" }, - "require-dev": { - "glpi-project/tools": "^0.8" - }, "config": { "optimize-autoloader": true, "platform": { @@ -20,6 +17,11 @@ "url": "https://github.com/teclib/odtphp/" } ], + "autoload": { + "psr-4": { + "GlpiPlugin\\Order\\Tests\\": "tests" + } + }, "autoload-dev": { "psr-4": { "Glpi\\Tools\\": "../../tools/src/" diff --git a/composer.lock b/composer.lock index 7295f72ee9..62c91af32c 100644 --- a/composer.lock +++ b/composer.lock @@ -173,16 +173,16 @@ }, { "name": "symfony/console", - "version": "v6.4.43", + "version": "v6.4.45", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3b643aa587acbc42f967a429af088a56ed8f046d" + "reference": "3b8473e0d14157f2d22b0a0d7259ad23483d1e6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b643aa587acbc42f967a429af088a56ed8f046d", - "reference": "3b643aa587acbc42f967a429af088a56ed8f046d", + "url": "https://api.github.com/repos/symfony/console/zipball/3b8473e0d14157f2d22b0a0d7259ad23483d1e6d", + "reference": "3b8473e0d14157f2d22b0a0d7259ad23483d1e6d", "shasum": "" }, "require": { @@ -247,7 +247,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.43" + "source": "https://github.com/symfony/console/tree/v6.4.45" }, "funding": [ { @@ -267,7 +267,7 @@ "type": "tidelift" } ], - "time": "2026-07-26T14:44:19+00:00" + "time": "2026-08-25T13:08:31+00:00" }, { "name": "symfony/deprecation-contracts", @@ -507,16 +507,16 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.38.0", + "version": "v1.42.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", - "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/aa20edea75bd9c48cfecc8360922e5a6e5c44502", + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502", "shasum": "" }, "require": { @@ -568,7 +568,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.42.0" }, "funding": [ { @@ -588,7 +588,7 @@ "type": "tidelift" } ], - "time": "2026-05-25T13:48:31+00:00" + "time": "2026-08-07T06:33:24+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -677,16 +677,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.7.1", + "version": "v3.7.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", "shasum": "" }, "require": { @@ -740,7 +740,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" }, "funding": [ { @@ -760,7 +760,7 @@ "type": "tidelift" } ], - "time": "2026-06-16T09:55:08+00:00" + "time": "2026-07-27T15:39:01+00:00" }, { "name": "symfony/string", @@ -936,15 +936,15 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=8.2" }, - "platform-dev": {}, + "platform-dev": [], "platform-overrides": { "php": "8.2.99" }, - "plugin-api-version": "2.9.0" + "plugin-api-version": "2.6.0" } diff --git a/front/bill.form.php b/front/bill.form.php index 8bb949881b..fade990cf4 100644 --- a/front/bill.form.php +++ b/front/bill.form.php @@ -93,7 +93,7 @@ Html::back(); } -Session::checkRight("plugin_order_bill", READ); +Session::checkRight(PluginOrderBill::$rightname, READ); Html::header(PluginOrderBill::getTypeName(), $_SERVER['PHP_SELF'], "management", "PluginOrderMenu", "bill"); if (isset($_REQUEST['id'])) { diff --git a/front/bill.php b/front/bill.php index a3b0c2b8cc..813a90c93e 100644 --- a/front/bill.php +++ b/front/bill.php @@ -28,7 +28,7 @@ * ------------------------------------------------------------------------- */ -Session::checkRight("plugin_order_bill", READ); +Session::checkRight(PluginOrderBill::$rightname, READ); Html::header(PluginOrderBill::getTypeName(), $_SERVER['PHP_SELF'], "management", "PluginOrderMenu", "bill"); diff --git a/front/config.form.php b/front/config.form.php index 78faf46627..0607409ba2 100644 --- a/front/config.form.php +++ b/front/config.form.php @@ -40,7 +40,7 @@ } else { Html::header(__s("Orders", "order"), $_SERVER['PHP_SELF'], "management", "PluginOrderMenu", "order"); - Session::checkRight("config", UPDATE); + Session::checkRight(Config::$rightname, UPDATE); $config->showForm(1); Html::footer(); diff --git a/front/order.php b/front/order.php index 8711a2b1aa..0a1eb07b0e 100644 --- a/front/order.php +++ b/front/order.php @@ -42,7 +42,7 @@ "order", ); -if (PluginOrderOrder::canView() || Session::haveRight("config", UPDATE)) { +if (PluginOrderOrder::canView() || Session::haveRight(Config::$rightname, UPDATE)) { Search::show("PluginOrderOrder"); } else { echo "