. * --------------------------------------------------------------------- */ include ('../inc/includes.php'); Session::checkRight("reports", READ); if (isset($_POST["locations_id"]) && $_POST["locations_id"]) { Html::header(Report::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "tools", "report"); Report::title(); // Titre $name = Dropdown::getDropdownName("glpi_locations", $_POST["locations_id"]); echo "

".sprintf(__('Network report by location: %s'), $name). "

"; $where = []; if (!empty($_POST['locations_id'])) { $sons = getSonsOf('glpi_locations', $_POST['locations_id']); $where = ['glpi_locations.id' => $sons]; } Report::reportForNetworkInformations( 'glpi_locations', //from ['PORT_1' => 'id', 'glpi_networkportethernets' => 'networkports_id'], //joincrit $where, //where ['glpi_netpoints.name AS extra'], //select [], //left join [ 'glpi_netpoints' => [ 'ON' => [ 'glpi_netpoints' => 'locations_id', 'glpi_locations' => 'id' ] ], 'glpi_networkportethernets' => [ 'ON' => [ 'glpi_networkportethernets' => 'netpoints_id', 'glpi_netpoints' => 'id' ] ] ], //inner join ['glpi_locations.completename', 'PORT_1.name'], //order Netpoint::getTypeName() ); Html::footer(); } else { Html::redirect($CFG_GLPI['root_doc']."/front/report.networking.php"); }