Skip to content

Commit dfb8435

Browse files
authored
2.11.0 (#444)
* 2.11.0 * fix phpstan and cs
1 parent bc89afe commit dfb8435

File tree

6 files changed

+45
-12
lines changed

6 files changed

+45
-12
lines changed

.php-cs-fixer.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
$finder = Finder::create()
7+
->in(__DIR__)
8+
->name('*.php');
9+
10+
$config = new Config();
11+
12+
$rules = [
13+
'@PER-CS2.0' => true,
14+
'trailing_comma_in_multiline' => ['elements' => ['arguments', 'array_destructuring', 'arrays']], // For PHP 7.4 compatibility
15+
];
16+
17+
return $config
18+
->setRules($rules)
19+
->setFinder($finder)
20+
->setUsingCache(false);

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [2.11.0] - 2025-07-10
11+
1012
### Fixed
1113

1214
- Improved access control checks when updating user preferences

front/bill.form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575
if ($config->canAddBillDetails()) {
7676
if ($bill->getFromDB($_POST["plugin_order_bills_id"])) {
7777
$input = [
78-
'id' => $ic->fields['id'],
79-
'bill' => $bill->fields['number'],
80-
'warranty_date' => $bill->fields['billdate'],
78+
'id' => $ic->fields['id'],
79+
'bill' => $bill->fields['number'],
80+
'warranty_date' => $bill->fields['billdate'],
8181
];
8282
$ic->check($input['id'], UPDATE, $input);
8383
$ic->update($input);

front/export.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,28 @@
3131
include("../../../inc/includes.php");
3232
Session::checkLoginUser();
3333

34-
PluginOrderConfig::getConfig();
35-
36-
if ($config->canGenerateOrderPDF() && ($config->canGenerateWithoutValidation() || $config->canGenerate())) {
34+
$config = PluginOrderConfig::getConfig();
35+
$PluginOrderOrder = new PluginOrderOrder();
3736

37+
if ($config->canGenerateOrderPDF() && ($PluginOrderOrder->canGenerateWithoutValidation() || $PluginOrderOrder->canGenerate())) {
3838
$PluginOrderOrder = new PluginOrderOrder();
3939

4040
// load related order with entity restrict criteria
41-
if ($PluginOrderOrder->getFromDBByCrit([
42-
"id" => $_GET['id'],
43-
"entities_id" => getEntitiesRestrictCriteria(getTableForItemType(PluginOrderOrder::class), '', '', true),
44-
])) {
41+
if (
42+
$PluginOrderOrder->getFromDBByCrit([
43+
'id' => $_GET['id'],
44+
'entities_id' => getEntitiesRestrictCriteria(
45+
getTableForItemType(PluginOrderOrder::class),
46+
'',
47+
'',
48+
true
49+
),
50+
])
51+
) {
4552
$PluginOrderOrder->generateOrder($_GET);
4653
} else {
4754
Html::displayRightError("You don't have permission to perform this action.");
4855
}
49-
5056
} else {
5157
Html::displayRightError("PDF export for Order plugin is not enable");
5258
}

plugin.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
<author>Benjamin Fontan</author>
3030
</authors>
3131
<versions>
32+
<version>
33+
<num>2.11.0</num>
34+
<compatibility>~10.0.0</compatibility>
35+
<download_url>https://github.com/pluginsGLPI/order/releases/download/2.11.0/glpi-order-2.11.0.tar.bz2</download_url>
36+
</version>
3237
<version>
3338
<num>2.10.7</num>
3439
<compatibility>~10.0.0</compatibility>

setup.php

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

31-
define('PLUGIN_ORDER_VERSION', '2.10.7');
31+
define('PLUGIN_ORDER_VERSION', '2.11.0');
3232

3333
// Minimal GLPI version, inclusive
3434
define("PLUGIN_ORDER_MIN_GLPI", "10.0.0");

0 commit comments

Comments
 (0)