Skip to content

Commit 65815f0

Browse files
RomainLvrstonebuzz
authored andcommitted
GLPI 11 compatibility
1 parent 4be0016 commit 65815f0

24 files changed

+301
-358
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"

ajax/container.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@
3131
include('../../../inc/includes.php');
3232
Session::checkLoginUser();
3333

34-
use Glpi\Http\Response;
34+
use Glpi\Exception\Http\HttpException;
3535

3636
if (isset($_GET['action']) && $_GET['action'] === 'get_fields_html') {
3737

3838
$right = PluginFieldsProfile::getRightOnContainer($_SESSION['glpiactiveprofile']['id'], $_GET['id']);
3939
if ($right < READ) {
40-
Response::sendError(403, 'Forbidden');
41-
return;
40+
throw new HttpException(403, 'Forbidden');
4241
}
4342

4443
$containers_id = $_GET['id'];
@@ -50,7 +49,7 @@
5049

5150
$item = new $itemtype();
5251
if ($items_id > 0 && !$item->getFromDB($items_id)) {
53-
Response::sendError(404, 'Not Found');
52+
throw new HttpException(404, 'Not Found');
5453
}
5554
$item->input = $input;
5655

@@ -66,5 +65,5 @@
6665
echo '';
6766
}
6867
} else {
69-
Response::sendError(404, 'Not Found');
68+
throw new HttpException(404, 'Not Found');
7069
}

ajax/reorder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
$DB->update(
7373
$table,
7474
[
75-
'ranking' => new \QueryExpression($DB->quoteName('ranking') . ' - 1'),
75+
'ranking' => new \Glpi\DBAL\QueryExpression($DB->quoteName('ranking') . ' - 1'),
7676
],
7777
[
7878
'plugin_fields_containers_id' => $container_id,
@@ -84,7 +84,7 @@
8484
$DB->update(
8585
$table,
8686
[
87-
'ranking' => new \QueryExpression($DB->quoteName('ranking') . ' + 1'),
87+
'ranking' => new \Glpi\DBAL\QueryExpression($DB->quoteName('ranking') . ' + 1'),
8888
],
8989
[
9090
'plugin_fields_containers_id' => $container_id,

ajax/viewtranslations.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,3 @@
5353
} else {
5454
echo __('Access denied');
5555
}
56-
57-
Html::ajaxFooter();

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
3-
"php": ">=7.4",
4-
"symfony/yaml": "^5.4"
3+
"php": ">=8.2",
4+
"symfony/yaml": "^7.3"
55
},
66
"require-dev": {
77
"friendsofphp/php-cs-fixer": "^3.75",
@@ -15,7 +15,7 @@
1515
"config": {
1616
"optimize-autoloader": true,
1717
"platform": {
18-
"php": "7.4.0"
18+
"php": "8.2.99"
1919
},
2020
"sort-packages": true,
2121
"allow-plugins": {

0 commit comments

Comments
 (0)