}
if (!isset($_POST["order"])) {
    $_POST["order"] = "";
}
if (!isset($_POST["withtemplate"])) {
    $_POST["withtemplate"] = "";
}
$pfTask = new PluginFusioninventoryTask();
$pfTaskjoblog = new PluginFusioninventoryTaskjoblog();
$pfTaskjob = new PluginFusioninventoryTaskjob();
$a_taskjob = $pfTaskjob->find("`plugin_fusioninventory_tasks_id`='" . $_POST["id"] . "'\n      AND `rescheduled_taskjob_id`='0' ", "id");
$i = 1;
switch ($_POST['glpi_tab']) {
    case -1:
        foreach ($a_taskjob as $taskjob_id => $datas) {
            $pfTaskjob->showForm($taskjob_id);
            $pfTaskjoblog->showHistory($taskjob_id);
            $taskjob_id_next = $taskjob_id;
            for ($j = 2; $j > 1; $j++) {
                $a_taskjobreties = $pfTaskjob->find("`rescheduled_taskjob_id`='" . $taskjob_id_next . "' ", "", 1);
                if (!empty($a_taskjobreties)) {
                    foreach ($a_taskjobreties as $taskjob_id_next => $datas2) {
                        $pfTaskjob->showForm($taskjob_id_next);
                    }
                } else {
                    $j = 0;
                }
            }
            echo "<br/>";
        }
        break;