Skip to content

Commit e5fc9be

Browse files
committed
Merge branch 'release/2.4.2'
2 parents 6ffe89c + c344016 commit e5fc9be

File tree

7 files changed

+183
-310
lines changed

7 files changed

+183
-310
lines changed

ajax/group_values.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,24 @@
77
Html::header_nocache();
88
Session::checkLoginUser();
99

10-
if (! isset($_REQUEST['itilcategories_id'])) {
11-
exit;
12-
}
13-
14-
$ticket_id = (isset($_REQUEST['ticket_id'])) ? $_REQUEST['ticket_id'] : 0;
10+
$tickets_id = (int) $_REQUEST['ticket_id'] ?? 0;
11+
$ticket = new Ticket;
12+
$ticket->getFromDB($tickets_id);
1513

16-
$canApplyFilter = PluginItilcategorygroupsCategory::canApplyFilter(
17-
intval($_REQUEST['itilcategories_id'])
18-
);
14+
if (!isset($_REQUEST['itilcategories_id'])) {
15+
$_REQUEST['itilcategories_id'] = $ticket->fields['itilcategories_id'];
16+
}
17+
if (!isset($_REQUEST['type'])) {
18+
$_REQUEST['type'] = $ticket->fields['type'];
19+
}
1920

2021
$condition = PluginItilcategorygroupsCategory::getSQLCondition(
21-
intval($ticket_id),
22+
$tickets_id,
2223
intval($_REQUEST['itilcategories_id']),
2324
$_REQUEST['type']
2425
);
2526

26-
if (! $canApplyFilter || empty($condition)) {
27+
if (empty($condition)) {
2728
$condition = [
2829
'glpi_groups.is_assign' => 1,
2930
] + getEntitiesRestrictCriteria("", "entities_id", $_SESSION['glpiactive_entity'], 1);

0 commit comments

Comments
 (0)