Skip to content

Commit 7e49c11

Browse files
committed
Do not display entity selection for group
see glpi-project#20247 (review)
1 parent 1de6828 commit 7e49c11

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

ajax/subvisibility.php

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,21 @@
4444
$suffix = ']';
4545
}
4646

47-
switch ($_POST['type']) {
48-
case 'Group':
49-
case 'Profile':
50-
$params = ['value' => $_SESSION['glpiactive_entity'],
51-
'name' => $prefix . 'entities_id' . $suffix,
52-
];
53-
if (Session::canViewAllEntities()) {
54-
$params['toadd'] = [-1 => __('No restriction')];
55-
}
56-
echo "<table class='tab_format'><tr><td>";
57-
echo htmlescape(Entity::getTypeName(1));
58-
echo "</td><td>";
59-
Entity::dropdown($params);
60-
echo "</td><td>";
61-
echo __s('Child entities');
62-
echo "</td><td>";
63-
Dropdown::showYesNo($prefix . 'is_recursive' . $suffix);
64-
echo "</td></tr></table>";
65-
break;
47+
if ($_POST['type'] === Profile::class) {
48+
$params = ['value' => $_SESSION['glpiactive_entity'],
49+
'name' => $prefix . 'entities_id' . $suffix,
50+
];
51+
if (Session::canViewAllEntities()) {
52+
$params['toadd'] = [-1 => __('No restriction')];
53+
}
54+
echo "<table class='tab_format'><tr><td>";
55+
echo htmlescape(Entity::getTypeName(1));
56+
echo "</td><td>";
57+
Entity::dropdown($params);
58+
echo "</td><td>";
59+
echo __s('Child entities');
60+
echo "</td><td>";
61+
Dropdown::showYesNo($prefix . 'is_recursive' . $suffix);
62+
echo "</td></tr></table>";
6663
}
6764
}

0 commit comments

Comments
 (0)