Skip to content

Commit 9e38b2b

Browse files
MyvTsvRom1-Bstonebuzz
authored
GLPI11 Compatibility (#286)
* GLPI11 Compatibility * phpstan * fix lint * fix PHP Parallel Lint * fix composer.lock * beta1 * fix version in setup.php * beta2 * fix cs + rector + psalm * release GLPI 11.0 * fix * fix CS * fix CS * fix CS * fix --------- Co-authored-by: Rom1-B <[email protected]> Co-authored-by: Stanislas Kita <[email protected]>
1 parent cea2d98 commit 9e38b2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1566
-1483
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
name: "Generate CI matrix"
2121
uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1"
2222
with:
23-
glpi-version: "10.0.x"
23+
glpi-version: "11.0.x"
2424
ci:
2525
name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}"
2626
needs: "generate-ci-matrix"

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## [UNRELEASED]
8+
## [1.9.0] - 2025-10-01
9+
10+
### Added
11+
12+
- GLPI 11 compatibility
913

1014
## [1.8.9] - 2025-09-30
1115

ajax/common.tabs.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@
2828
* -------------------------------------------------------------------------
2929
*/
3030

31-
include('../../../inc/includes.php');
3231
header('Content-Type: text/html; charset=UTF-8');
3332
Html::header_nocache();
3433

3534
Session::checkLoginUser();
3635

3736
$common = new PluginMreportingCommon();
3837
$common->showCentral($_REQUEST);
39-
40-
Html::ajaxFooter();

ajax/dashboard.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
* -------------------------------------------------------------------------
2929
*/
3030

31-
include('../../../inc/includes.php');
3231
Html::header_nocache();
3332

3433
Session::checkLoginUser();

ajax/dropdownExport.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
* -------------------------------------------------------------------------
2929
*/
3030

31-
include('../../../inc/includes.php');
3231
header('Content-Type: text/html; charset=UTF-8');
3332
Html::header_nocache();
3433

@@ -41,8 +40,8 @@
4140
if ($_POST['ext'] == 'odt') {
4241
echo '&nbsp;';
4342
$option = [];
44-
$option[1] = __('With data', 'mreporting');
45-
$option[0] = __('Without data', 'mreporting');
43+
$option[1] = __s('With data', 'mreporting');
44+
$option[0] = __s('Without data', 'mreporting');
4645
Dropdown::showFromArray('withdata', $option, []);
4746
}
4847

@@ -59,7 +58,7 @@
5958
Html::Closeform();
6059
echo "<script type='text/javascript'>
6160
$('#export_svg_link').on('click', function () {
62-
var svg_content = vis{$randname}.scene[0].canvas.innerHTML;
61+
var svg_content = vis{" . htmlspecialchars($randname) . "}.scene[0].canvas.innerHTML;
6362
6463
var form = document.getElementById('export_svg_form');
6564
form.svg_content.value = svg_content;

ajax/dropdownGraphs.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030

3131
if (strpos($_SERVER['PHP_SELF'], 'dropdownGraphs.php')) {
32-
include('../../../inc/includes.php');
3332
header('Content-Type: text/html; charset=UTF-8');
3433
Html::header_nocache();
3534
}
@@ -42,5 +41,5 @@
4241
$_POST['name'] = $test[1];
4342

4443
$config = new PluginMreportingConfig();
45-
echo "&nbsp;<a href='" . $config->getFormURL() . '?name=' . $_POST['name'] . '&classname=' . $_POST['classname'] . "'>" . __('Send') . '</a>';
44+
echo "&nbsp;<a href='" . htmlspecialchars($config->getFormURL()) . '?name=' . htmlspecialchars($_POST['name']) . '&classname=' . htmlspecialchars($_POST['classname']) . "'>" . __s('Send') . '</a>';
4645
}

ajax/get_new_crsf_token.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030

3131
$AJAX_INCLUDE = 1;
32-
include('../../../inc/includes.php');
3332

3433
header('Content-Type: text/html; charset=UTF-8');
3534
Html::header_nocache();

ajax/homepage_link.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
* -------------------------------------------------------------------------
2929
*/
3030

31-
include('../../../inc/includes.php');
31+
/** @var array $CFG_GLPI */
32+
global $CFG_GLPI;
3233

3334
Session::checkLoginUser();
3435

35-
echo '<li id="menu99"><a href="' . Plugin::getWebDir('mreporting') .
36+
echo '<li id="menu99"><a href="' . $CFG_GLPI['root_doc'] . '/plugins/mreporting' .
3637
'/front/dashboard.form.php" class="itemP">&nbsp;&nbsp;' .
37-
__('Dashboard', 'mreporting') . '&nbsp;&nbsp;</a></li>';
38+
__s('Dashboard', 'mreporting') . '&nbsp;&nbsp;</a></li>';

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"require": {
3-
"php": ">=7.4",
4-
"masnathan/odtphp": "dev-teclib"
3+
"php": ">=8.2",
4+
"sboden/odtphp": "^3.2"
55
},
66
"require-dev": {
77
"friendsofphp/php-cs-fixer": "^3.85",
8+
"glpi-project/phpstan-glpi": "^1.0",
89
"glpi-project/tools": "^0.7",
910
"php-parallel-lint/php-parallel-lint": "^1.4",
1011
"phpstan/extension-installer": "^1.4",
@@ -14,7 +15,7 @@
1415
"config": {
1516
"optimize-autoloader": true,
1617
"platform": {
17-
"php": "7.4.0"
18+
"php": "8.2.99"
1819
},
1920
"sort-packages": true,
2021
"allow-plugins": {

0 commit comments

Comments
 (0)