Skip to content

Commit

Permalink
Fix group dropdown in escalate form (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sthivet authored Feb 21, 2024
1 parent 42b77df commit ac57edc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions inc/ticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -918,19 +918,22 @@ public function showForm($ID, $options = [])
foreach ($groups as $grp) {
$assigned_groups[$grp['groups_id']] = $grp['groups_id'];
}

$config = new PluginEscaladeConfig();
$config->getFromDB(1);
$PluginEscaladeGroup_Group = new PluginEscaladeGroup_Group();
$groups_id_filtered = array_keys($PluginEscaladeGroup_Group->getGroups($tickets_id));
$groups_id_filtered = empty($groups_id_filtered) ? [-1] : $groups_id_filtered;

$condition = [
'is_assign' => 1
];
if ($config->fields['use_filter_assign_group']) {
$condition['id'] = $groups_id_filtered;
}
TemplateRenderer::getInstance()->display('@escalade/escalade_form.html.twig', [
'action' => PLUGIN_ESCALADE_WEBDIR . '/front/ticket.form.php',
'ticket' => $options['parent'],
'assigned_groups' => $assigned_groups,
'condidition' => [
'is_assign' => 1,
'id' => $groups_id_filtered,
],
'condition' => $condition,
]);
}
}
2 changes: 1 addition & 1 deletion templates/escalade_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
'required' : true,
'icon_label': true,
'entity': ticket.fields['entities_id'],
'condition': condidition,
'condition': condition,
'value' : 0,
'used': assigned_groups,
'rand': rand,
Expand Down

0 comments on commit ac57edc

Please sign in to comment.