Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Dec 10, 2018
2 parents bdc82d5 + 1eb4f12 commit 0ddd410
Show file tree
Hide file tree
Showing 7 changed files with 254 additions and 108 deletions.
29 changes: 13 additions & 16 deletions ajax/group_values.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,19 @@

$ticket_id = (isset($_REQUEST['ticket_id'])) ? $_REQUEST['ticket_id'] : 0;

$condition = PluginItilcategorygroupsCategory::getSQLCondition(intval($ticket_id),
intval($_REQUEST['itilcategories_id']), $_REQUEST['type']);
$rand = mt_rand();
$default_options = ['display_emptychoice' => true,
'itemtype' => 'Group',
'condition' => $rand];

$condition = PluginItilcategorygroupsCategory::getSQLCondition(
intval($ticket_id),
intval($_REQUEST['itilcategories_id']),
$_REQUEST['type']
);
if (empty($condition)) {
$condition = [
'glpi_groups.is_assign' => 1,
] + getEntitiesRestrictCriteria("", "entities_id", $_SESSION['glpiactive_entity'], 1);
}

if (! empty($condition)) {
$_GET = array_merge($_GET, $default_options);
$_SESSION['glpicondition'][$rand] = $condition;
$_POST['display_emptychoice'] = true;
$_POST['itemtype'] = 'Group';
$_POST['condition'] = Dropdown::addNewCondition($condition);

} else {
$_GET = array_merge($_GET, $default_options);
$_SESSION['glpicondition'][$rand] = getEntitiesRestrictRequest(" ", "", "entities_id",
$_SESSION['glpiactive_entity'], 1). "AND glpi_groups.is_assign";
}
$_POST += $default_options; // fix for glpi 9.1
require ("../../../ajax/getDropdownValue.php");
Loading

0 comments on commit 0ddd410

Please sign in to comment.