Skip to content

Commit

Permalink
fix(dropdownfield): restrict by entity when needed
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Nov 22, 2018
1 parent ef73e98 commit a63c04f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inc/fields/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function displayField($canEdit = true) {
$dparams = ['name' => $fieldName,
'value' => $this->value,
'comments' => false,
'entity' => $_SESSION['glpiactive_entity'],
'rand' => $rand];

switch ($itemtype) {
Expand All @@ -78,13 +79,13 @@ public function displayField($canEdit = true) {
$dparams['condition'] .= " AND `is_incident` = '1'";
break;
case 'both':
$dparams['condition'] .= " AND `is_incident` = '1' OR `is_request` = '1' ";
$dparams['condition'] .= " AND (`is_incident` = '1' OR `is_request` = '1')";
break;
case 'change':
$dparams['condition'] .= " AND `is_change` = '1'";
break;
case 'all':
$dparams['condition'] .= " AND `is_change` = '1' OR `is_incident` = '1' OR `is_request` = '1'";
$dparams['condition'] .= " AND (`is_change` = '1' OR `is_incident` = '1' OR `is_request` = '1')";
break;
}
if (isset($decodedValues['show_ticket_categories_depth'])
Expand Down

0 comments on commit a63c04f

Please sign in to comment.