function showTransferList()
{
global $DB, $CFG_GLPI;
if (isset($_SESSION['glpitransfer_list']) && count($_SESSION['glpitransfer_list'])) {
echo "<div class='center b'>" . __('You can continue to add elements to be transferred or execute the transfer now');
echo "<br>" . __('Think of making a backup before transferring items.') . "</div>";
echo "<table class='tab_cadre_fixe' >";
echo '<tr><th>' . __('Items to transfer') . '</th><th>' . __('Transfer mode') . " ";
$rand = Transfer::dropdown(array('name' => 'id', 'comments' => false, 'toupdate' => array('value_fieldname' => 'id', 'to_update' => "transfer_form", 'url' => $CFG_GLPI["root_doc"] . "/ajax/transfers.php")));
echo '</th></tr>';
echo "<tr><td class='tab_bg_1 top'>";
foreach ($_SESSION['glpitransfer_list'] as $itemtype => $tab) {
if (count($tab)) {
$table = getTableForItemType($itemtype);
$query = "SELECT `{$table}`.`id`,\n `{$table}`.`name`,\n `glpi_entities`.`completename` AS locname,\n `glpi_entities`.`id` AS entID\n FROM `{$table}`\n LEFT JOIN `glpi_entities`\n ON (`{$table}`.`entities_id` = `glpi_entities`.`id`)\n WHERE `{$table}`.`id` IN " . $this->createSearchConditionUsingArray($tab) . "\n ORDER BY locname, `{$table}`.`name`";
$entID = -1;
if (!($item = getItemForItemtype($itemtype))) {
continue;
}
if ($result = $DB->query($query)) {
if ($DB->numrows($result)) {
echo '<h3>' . $item->getTypeName() . '</h3>';
while ($data = $DB->fetch_assoc($result)) {
if ($entID != $data['entID']) {
if ($entID != -1) {
echo '<br>';
}
$entID = $data['entID'];
echo "<span class='b spaced'>" . $data['locname'] . "</span><br>";
}
echo ($data['name'] ? $data['name'] : "(" . $data['id'] . ")") . "<br>";
}
}
}
}
}
echo "</td><td class='tab_bg_2 top'>";
if (countElementsInTable('glpi_transfers') == 0) {
_e('No item found');
} else {
$params = array('id' => '__VALUE__');
Ajax::updateItemOnSelectEvent("dropdown_id{$rand}", "transfer_form", $CFG_GLPI["root_doc"] . "/ajax/transfers.php", $params);
}
echo "<div class='center' id='transfer_form'><br>";
Html::showSimpleForm($CFG_GLPI["root_doc"] . "/front/transfer.action.php", 'clear', __('To empty the list of elements to be transferred'));
echo "</div>";
echo '</td></tr>';
echo '</table>';
} else {
_e('No selected element or badly defined operation');
}
}