diff --git a/ajax/subvisibility.php b/ajax/subvisibility.php
index 9a9608451f6..ebb12167a8f 100644
--- a/ajax/subvisibility.php
+++ b/ajax/subvisibility.php
@@ -36,7 +36,7 @@
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
-if (!empty($_POST['type']) && isset($_POST['items_id']) && ($_POST['items_id'] > 0)) {
+if (!empty($_POST['type'])) {
$prefix = '';
$suffix = '';
if (!empty($_POST['prefix'])) {
@@ -47,21 +47,26 @@
switch ($_POST['type']) {
case 'Group':
case 'Profile':
- $params = ['value' => $_SESSION['glpiactive_entity'],
+ $rand = mt_rand();
+ $params = [
+ 'value' => $_SESSION['glpiactive_entity'],
'name' => $prefix . 'entities_id' . $suffix,
+ 'width' => '100%',
+ 'rand' => $rand,
];
if (Session::canViewAllEntities()) {
$params['toadd'] = [-1 => __('No restriction')];
}
- echo "
";
switch ($_POST['type']) {
case 'User':
$params = [
'right' => isset($_POST['allusers']) ? 'all' : $_POST['right'],
- 'name' => $prefix . 'users_id' . $suffix,
+ 'name' => $prefix . 'users_id' . $suffix,
+ 'width' => '100%',
+ 'aria_label' => User::getTypeName(1),
];
User::dropdown($params);
$display = true;
break;
case 'Group':
- $params = ['rand' => $rand,
- 'name' => $prefix . 'groups_id' . $suffix,
- ];
- $params['toupdate'] = ['value_fieldname'
- => 'value',
- 'to_update' => "subvisibility$rand",
- 'url' => $CFG_GLPI["root_doc"] . "/ajax/subvisibility.php",
- 'moreparams' => ['items_id' => '__VALUE__',
- 'type' => $_POST['type'],
- 'prefix' => $_POST['prefix'],
- ],
+ $params = [
+ 'rand' => $rand,
+ 'name' => $prefix . 'groups_id' . $suffix,
+ 'width' => '100%',
+ 'aria_label' => Group::getTypeName(1),
];
-
Group::dropdown($params);
- echo "
";
$display = true;
break;
@@ -91,9 +84,9 @@
'name' => $prefix . 'entities_id' . $suffix,
'entity' => $_POST['entity'] ?? -1,
'entity_sons' => $_POST['is_recursive'] ?? false,
+ 'width' => '100%',
+ 'aria_label' => Entity::getTypeName(1),
]);
- echo '
' . __s('Child entities') . '
';
- Dropdown::showYesNo($prefix . 'is_recursive' . $suffix);
$display = true;
break;
@@ -104,26 +97,17 @@
$righttocheck = 'knowbase';
$checkright = KnowbaseItem::READFAQ;
}
- $params = [
+ $params = [
'rand' => $rand,
'name' => $prefix . 'profiles_id' . $suffix,
+ 'width' => '100%',
'condition' => [
'glpi_profilerights.name' => $righttocheck,
'glpi_profilerights.rights' => ['&', $checkright],
],
+ 'aria_label' => Profile::getTypeName(1),
];
- $params['toupdate'] = ['value_fieldname'
- => 'value',
- 'to_update' => "subvisibility$rand",
- 'url' => $CFG_GLPI["root_doc"] . "/ajax/subvisibility.php",
- 'moreparams' => ['items_id' => '__VALUE__',
- 'type' => $_POST['type'],
- 'prefix' => $_POST['prefix'],
- ],
- ];
-
Profile::dropdown($params);
- echo "
";
$display = true;
break;
}
@@ -132,5 +116,4 @@
echo "
";
}
- echo "
";
}
diff --git a/css/includes/components/_kb.scss b/css/includes/components/_kb.scss
index bde2fdc6c91..21e6901df61 100644
--- a/css/includes/components/_kb.scss
+++ b/css/includes/components/_kb.scss
@@ -710,3 +710,15 @@
padding: 1rem 1.25rem;
border-top: 1px solid var(--tblr-border-color);
}
+
+.visibility-type-col .select2-selection {
+ // Merge borders with dropdown to its right
+ border-start-end-radius: 0 !important;
+ border-end-end-radius: 0 !important;
+}
+
+.visibility-item-col .select2-selection {
+ // Merge borders with dropdown to its left
+ border-start-start-radius: 0 !important;
+ border-end-start-radius: 0 !important;
+}
diff --git a/css/includes/components/_utils.scss b/css/includes/components/_utils.scss
index cf3e43ad9f4..9afd5fc3039 100644
--- a/css/includes/components/_utils.scss
+++ b/css/includes/components/_utils.scss
@@ -77,6 +77,10 @@
font-size: 5em !important;
}
+.flex-grow-30 {
+ flex-grow: 30;
+}
+
.opacity-100-hover:hover {
opacity: 1 !important;
}
diff --git a/js/glpi_dialog.js b/js/glpi_dialog.js
index 79d610a2e11..ff013384d81 100644
--- a/js/glpi_dialog.js
+++ b/js/glpi_dialog.js
@@ -110,7 +110,7 @@ var glpi_html_dialog = function({