//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>" . _T("Choose the module you want to query : ", "dyngroup") . "</td>"; foreach ($modules as $name) { if ($name == quickGet('add_req')) { print "<td>{$name}</td>"; } else { print "<td><a href='" . urlStr("base/computers/{$target}", array('add_req' => $name, 'request' => $request->toURL(), 'id' => $id, 'imaging_server' => $imaging_server)) . "'>{$name}</a></td>"; } } print "</tr></table>"; } // criterion selection //TODO put in class if (quickGet('add_req')) { $criterion = getPossiblesCriterionsInModule(quickGet('add_req')); if (count($criterion) == 1) { quickSet('req', quickGet('add_req')); quickSet('add_param', $criterion[0]); } else { print "<table><tr><td>" . _T("Choose your field : ", "dyngroup") . "</td>"; $modulo = 0; $field_per_line = 4;
print "<select name = 'value'>"; print "<option name = 'True' value = 'True'>" . _T("Yes", "dyngroup") . "</option>"; print "<option name = 'False' value = 'False'>" . _T("No", "dyngroup") . "</option>"; print "</select>"; print "<input class = 'btnPrimary' value = '" . _T("Add", "dyngroup") . "' name = 'Add' type = 'submit'/>"; break; case 'true': print "<input type = 'hidden' value = 'True' name = 'value'/><input type = 'text' readonly value = '" . _T("Yes", "dyngroup") . "'/>"; print "<input class = 'btnPrimary' value = '" . _T("Add", "dyngroup") . "' name = 'Add' type = 'submit'/>"; break; } } 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