Commit eba684e3 authored by Johan Cwiklinski's avatar Johan Cwiklinski

Merge branch '9.5/bugfixes'

parents 1b41357b 3a77fb51
......@@ -539,6 +539,7 @@ abstract class CommonTreeDropdown extends CommonDropdown {
$nb++;
echo "<tr class='tab_bg_1'><td>";
if ((($fk == 'entities_id') && in_array($data['id'], $_SESSION['glpiactiveentities']))
|| !$entity_assign
|| (($fk != 'entities_id') && in_array($data['entities_id'], $_SESSION['glpiactiveentities']))) {
echo "<a href='".$this->getFormURL();
echo '?id='.$data['id']."'>".$data['name']."</a>";
......
......@@ -1165,8 +1165,10 @@ class IPAddress extends CommonDBChild {
'ON' => [
'NAME' => 'items_id',
'PORT' => 'id', [
'NOT' => [
'PORT.itemtype' => $CFG_GLPI['networkport_types']
'AND' => [
'NOT' => [
'PORT.itemtype' => $CFG_GLPI['networkport_types']
]
]
]
]
......@@ -1196,13 +1198,13 @@ class IPAddress extends CommonDBChild {
$queries[] = $criteria;
$criteria = $main_criteria;
$criteria['SELECT'] = $criteria['SELECT'] + [
$criteria['SELECT'] = array_merge($criteria['SELECT'], [
new \QueryExpression("NULL AS name_id"),
new \QueryExpression("NULL AS port_id"),
new \QueryExpression('NULL AS item_id'),
new \QueryExpression("NULL AS item_type")
];
$criteria['INNER JOIN']['glpi_ipaddresses AS ADDR']['ON'][0]['AND']['ADDR.itemtype'] = ['!', 'NetworkName'];
]);
$criteria['INNER JOIN']['glpi_ipaddresses AS ADDR']['ON'][0]['AND']['ADDR.itemtype'] = ['!=', 'NetworkName'];
$queries[] = $criteria;
$union = new \QueryUnion($queries);
......
......@@ -1007,7 +1007,7 @@ class DBmysqlIterator extends DbTestCase {
AND `NAME`.`itemtype` = ?)
INNER JOIN `glpi_networkports` AS `PORT`
ON (`NAME`.`items_id` = `PORT`.`id`
NOT `PORT`.`itemtype`
AND NOT (`PORT`.`itemtype`
IN (" . implode(',', array_fill(0, count($CFG_GLPI['networkport_types']), '?')) . "))
LEFT JOIN `glpi_entities` ON (`ADDR`.`entities_id` = `glpi_entities`.`id`)
WHERE `LINK`.`ipnetworks_id` = ?)";
......@@ -1160,8 +1160,10 @@ class DBmysqlIterator extends DbTestCase {
'ON' => [
'NAME' => 'items_id',
'PORT' => 'id', [
'NOT' => [
'PORT.itemtype' => $CFG_GLPI['networkport_types']
'AND' => [
'NOT' => [
'PORT.itemtype' => $CFG_GLPI['networkport_types']
]
]
]
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment