Skip to content

Commit

Permalink
Merge branch 'release/2.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jun 24, 2021
2 parents 6ffe89c + c344016 commit e5fc9be
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 310 deletions.
21 changes: 11 additions & 10 deletions ajax/group_values.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@
Html::header_nocache();
Session::checkLoginUser();

if (! isset($_REQUEST['itilcategories_id'])) {
exit;
}

$ticket_id = (isset($_REQUEST['ticket_id'])) ? $_REQUEST['ticket_id'] : 0;
$tickets_id = (int) $_REQUEST['ticket_id'] ?? 0;
$ticket = new Ticket;
$ticket->getFromDB($tickets_id);

$canApplyFilter = PluginItilcategorygroupsCategory::canApplyFilter(
intval($_REQUEST['itilcategories_id'])
);
if (!isset($_REQUEST['itilcategories_id'])) {
$_REQUEST['itilcategories_id'] = $ticket->fields['itilcategories_id'];
}
if (!isset($_REQUEST['type'])) {
$_REQUEST['type'] = $ticket->fields['type'];
}

$condition = PluginItilcategorygroupsCategory::getSQLCondition(
intval($ticket_id),
$tickets_id,
intval($_REQUEST['itilcategories_id']),
$_REQUEST['type']
);

if (! $canApplyFilter || empty($condition)) {
if (empty($condition)) {
$condition = [
'glpi_groups.is_assign' => 1,
] + getEntitiesRestrictCriteria("", "entities_id", $_SESSION['glpiactive_entity'], 1);
Expand Down
Loading

0 comments on commit e5fc9be

Please sign in to comment.