Example #1
0
        }
    }
    print "</td><td>";
    print "<input type='hidden' name='req' value='" . quickGet('req') . "'/>";
    print "<input type='hidden' name='param' value='" . quickGet('add_param') . "'/>";
    print "<input type='hidden' name='request' value='" . $request->toURL() . "'/>";
    print "<input type='hidden' name='id' value='{$id}'/>";
    print "</td></tr>";
    print "</table></form>";
}
// display the request in detail
if (!$request->isEmpty()) {
    print "<hr/>";
    print "<h3>" . _T("The request is : ", "dyngroup") . "</h3>";
    if ($edition) {
        $request->displayReqListInfos(true, array('id' => $id, 'gid' => $id, 'target' => $target, 'target_edit' => 'computersgroupsubedit', 'target_del' => 'computersgroupsubdel', 'request' => $request->toS()));
    } else {
        $request->displayReqListInfos(true, array('id' => $id, 'gid' => $id, 'target' => $target, 'target_edit' => 'computersgroupcreatesubedit', 'target_del' => 'computersgroupcreatesubdel', 'request' => $request->toS(), 'tab' => 'tabdyn'));
    }
}
// display action buttons in the bottom
//TODO put in class
if (!$request->isEmpty()) {
    # TODO check ACLs....
    print "<hr/>";
    print "<table>";
    print "<tr><td>";
    $b = new Button('base', 'computers', 'creator_step2');
    $url = urlStr("base/computers/creator_step2", array('id' => $id, 'request' => $request->toS(), 'imaging_server' => $imaging_server, 'is_group' => $groupedit ? '1' : 0));
    print $b->getOnClickButton(_T("Go to save step", "dyngroup"), $url);
    print "</td><td>";
Example #2
0
//TODO put in class
$modules = getPossiblesModules();
if (count($modules) == 1) {
    quickSet('add_req', $modules[0]);
} else {
    $add_req = quickget('add_req');
    if (!isset($add_req) || count($add_req) == 0 || $add_req == '') {
        $default = getDefaultModule();
        quickSet('add_req', $default);
    }
    print "<table><tr><td style=\"width:300px;border:0\">" . _T("Choose the module you want to query : ", "dyngroup") . "</td>";
    foreach ($modules as $name) {
        if ($name == quickGet('add_req')) {
            print "<td style=\"width:80px;border:0\">{$name}</td>";
        } else {
            $_SESSION['request'] = $request->toS();
            $url_params = array('add_req' => $name, 'request' => 'stored_in_session', 'id' => $id, 'imaging_server' => $imaging_server);
            // When sub_id is transmitted add it to params
            if (quickGet('sub_id') != '') {
                $url_params['sub_id'] = quickGet('sub_id');
            }
            print "<td style=\"width:80px;border:0\"><a href='" . urlStr("base/computers/{$target}", $url_params) . "'>{$name}</a></td>";
        }
    }
    print "<td style=\"border:0\"></td></tr></table>";
}
// criterion selection
//TODO put in class
if (quickGet('add_req')) {
    $criterion = getPossiblesCriterionsInModule(quickGet('add_req'));
    // If there is only one criterion, we display it directly